如何使用Braintree每月支付不同的价值折扣

I am using recurring payment from Braintree but it looks like they only allow to fix the bonus amount to subtract from each month payment.

https://developers.braintreepayments.com/javascript+php/guides/recurring-billing/plans#add-ons-and-discounts

However the bonus is different from each user and each month for each user. So do you have any idea to customize this ?

Thank you very much!

I work for Braintree.

You will need to create your custom add-ons and discounts in the Control Panel before they can be applied to your users' subscriptions. After they are created, you can update users' add-ons and discounts as needed using Braintree_Subscription::Update.

$result = Braintree_Subscription::update('theSubscriptionId', [
    'discounts' => [
        'add' => [
            [
                'inheritedFromId' => 'discountId1',
                'amount' => '7.00'
            ]
        ],
        'update' => [
            [
                'existingId' => 'discountId2',
                'amount' => '15.00'
            ]
    ],
    'remove' => ['discountId3']
    ]
]);