So I am having a problem creating a stripe payment and keep getting this error.
<br />↵<b>Fatal error</b>: Call to undefined method Stripe\Subscription::create() in <b>D:\username\Programs\xampp\htdocs\myapp\services\sec.php</b> on line <b>219</b><br />
Here is the code.
} else if($stripetoken != "") {
$customer = \Stripe\Customer::create(array(
"email" => $email,
"source" => $stripetoken,
));
if ($term == "1") {
\Stripe\Subscription::create(array( <-- line 219
"customer" => $customer->id,
"plan" => "monthly-sub-test",
));
}
I believe I have set up the code to what the documentation says
https://stripe.com/docs/subscriptions/quickstart
You are using an older version of Stripe's PHP library. The \Stripe\Subscription::create() method was added in version 3.13.0. Make sure you're using this version or a more recent one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With