2017-04-18 123 views
1

所以我有一个问题创建一个条纹付款并不断收到此错误。条纹 - 未定义的方法条纹订阅::创建()

<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 />

这里是代码。

} 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", 
     ));       
    } 

我相信我已经设置了代码是什么文件说

https://stripe.com/docs/subscriptions/quickstart

+0

您使用的是什么版本的PHP库。这听起来像你可能在使用'\ Stripe \ Subscription :: create()'之前使用了一个版本。 – duck

+0

我的xampp服务器运行'PHP 5.6.30'如果这是你要求的 – luckyging3r

+0

我使用的Stripe版本是'2.2.0'版本,并且过时。 @Ywain是正确的http://stackoverflow.com/a/43494202/5184092 – luckyging3r

回答