Stripe_Subscription::create(array(
"customer" => $customer_id,
"plan" => $plan_id,
"trial_end" => $strtotime,
));
此代碼不適用於我,我嘗試過很多方法。我已經創建了客戶和計劃,但我無法爲用戶添加訂閱。致命錯誤:調用未定義的方法在PHP中的Stripe_Subscription :: create()
Stripe_Subscription::create(array(
"customer" => $customer_id,
"plan" => $plan_id,
"trial_end" => $strtotime,
));
此代碼不適用於我,我嘗試過很多方法。我已經創建了客戶和計劃,但我無法爲用戶添加訂閱。致命錯誤:調用未定義的方法在PHP中的Stripe_Subscription :: create()
不加載庫文件,所以你可以使用這個鏈接 =>https://github.com/myg0v/Simple-Bootstrap-Stripe-Payment-Form/tree/master/lib
您可能使用條紋的PHP的舊版本圖書館。您使用的語法與1.x版本的語法相匹配,但這些版本從不支持/v1/subscriptions
端點 - 支持在版本3.13.0中添加此端點。
我會建議你使用最新版本(4.4.0)和升級整合的代碼以使用新的語法:
\Stripe\Subscription::create(array(
"customer" => $customer_id,
"plan" => $plan_id,
"trial_end" => $strtotime,
));