Rub*_*byx 3 php stripe-payments stripe-connect
我正在使用Stripe构建一个相对简单的基于订阅的应用程序。
目前,我唯一真正遇到的麻烦是订阅需要支付初始安装费,而我确实很难受。
示例:
新用户注册Subscription-A;订阅A的月度间隔价格为10美元。注册后,新用户将被收取一次性费用1美元和10美元的订阅费用,随后的几个月仅需支付10美元。
目前,我的代码是:
// Stripe New customer
$customer = \Stripe\Customer::create(array(
"email" => $customer_email,
"source" => $token,
),
array("stripe_account" => $connected_account)
);
// Stripe Subscription
$sub = \Stripe\Subscription::create(array(
"customer" => $customer['id'],
"items" => array(
array(
"plan" => $plan_id,
),
),
),
array("stripe_account" => $connected_account)
);
Run Code Online (Sandbox Code Playgroud)
任何的想法?谢谢