如何在使用Braintree的每月付款中每次贴现不同的价值

How discount different values each time in monthly payment using Braintree

本文关键字:Braintree 付款      更新时间:2023-09-26

我正在使用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']
    ]
]);