I'm using stripe and had all my subscriptions working properly before. Just recently I am trying to move the same code to a different stripe account and I am receiving errors when trying to charge a subscription.
<?php
require_once('../stripe-php-master/init.php');
// (switch to the live key later)
\Stripe\Stripe::setApiKey("sk_test_hlQNSE1fy1cGmsqDSbR9LfDF");
try
{
$customer = \Stripe\Customer::create(array(
'email' => $_POST['stripeEmail'],
'source' => $_POST['stripeToken'],
'plan' => 'basic_annually'
));
header('Location: ../../subscription-success.html');
exit;
}
catch(Exception $e)
{
header('Location:oops.html');
error_log("unable to sign up customer:" . $_POST['stripeEmail'].
", error:" . $e->getMessage());
}
this is returning the following error
unable to sign up customer: 'test@example.com', error:No such plan: basic_monthly; one exists with a name of basic_monthly, but its ID is 504102373103330.