Stripe - undefined method Stripe\\Subscription::create()

匿名 (未验证) 提交于 2019-12-03 01:39:01

问题:

So I am having a problem creating a stripe payment and keep getting this error.

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

回答1:

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.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!