我在订阅中添加发票项目时遇到问题,目前我的头撞在墙上。
我已经在 stripe 上创建了一个发票项目,并且我希望将发票项目包含在定期付款中
这是我的代码,它在第一张发票上添加发票项目,但不在下一张发票上添加发票项目。
$new_customer = Stripe_Customer::create(array(
'card' => $card,
'email' => $email,)
);
Stripe_InvoiceItem::create(array(
'customer' => $new_customer['id'],
'amount' => $additiona_charges,
'currency' => 'gbp',
'description' => 'Addtional Cities'
));
$new_customer->updateSubscription(array('plan' => $selected_plan, 'prorate' => true));
就我目前的设置而言。我根据订阅时的客户选择收取额外的自定义费用,这就是我需要在定期付款时添加额外费用的方式。
它是这样的
Plan
1 Cookie - 99GBP / Per month
2 Cookies - 199GBP / Per month
3 Cookies - 300GBP / Per month
额外费用 - 发票项目
-With Candle - +20GBP // must be included on recurring payment.
-With Icecream - +26GBP // must be included on recurring payment.
-With Cheese - +28GBP // must be included on recurring payment.
-With Ketchup - +30 // must be included on recurring payment.
-With Poison (for your X) - +50 // must be included on recurring payment.
我希望有人能帮忙。非常感谢
干杯
肯恩