我正在使用 Braintree 的定期付款,但看起来他们只允许固定奖金金额以从每月付款中扣除。
https://developers.braintreepayments.com/javascript+php/guides/recurring-billing/plans#add-ons-and-discounts
但是,每个用户以及每个用户每月的奖金都不同。 那么你有什么想法来定制这个吗?
非常感谢!
最佳答案
我在 Braintree 工作。
您需要在控制面板中创建自定义附加服务和折扣,然后才能将其应用于用户的订阅。创建后,您可以根据需要使用 Braintree_Subscription::Update 更新用户的附加服务和折扣。 .
$result = Braintree_Subscription::update('theSubscriptionId', [
'discounts' => [
'add' => [
[
'inheritedFromId' => 'discountId1',
'amount' => '7.00'
]
],
'update' => [
[
'existingId' => 'discountId2',
'amount' => '15.00'
]
],
'remove' => ['discountId3']
]
]);
关于javascript - 如何使用 Braintree 在每月付款中每次折扣不同的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33120105/