javascript - 如何使用 Braintree 在每月付款中每次折扣不同的值

标签 javascript php payment braintree recurring-billing

我正在使用 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/

相关文章:

javascript - 将 id 从 php while 循环传递给 jquery

javascript - Stripe 无法使用错误 'Uncaught (in promise) Error: We could not retrieve data from the specified Element.'

web-applications - 您将如何向潜在投资者和利益相关者证明/捍卫免费增值支付模式?

payment - 支付时POS如何决定生成100条消息还是200条消息

javascript - 如何影响多个动态元素中的一个元素

php - 使用带有 PHP 的 AJAX 返回远程服务器状态

javascript - 有人可以解释一下吗 : 'create({email: emailArg} = {}) {}' ?

javascript - 无法使用 setState 动态更改复选框的状态

php - 空白页 Codeigniter(本地主机正常,网络不正常)

javascript - Tablesorter 将不会显示可排序的标题