Search code examples
phplaravelauthorize.netauthorize.net-arb

Authorize.net apply one time cash discount on ARB subscription


Is it possible to apply a one time/ multiple time cash discount to an Automated Recurring Billing Subscription? I can't seem to find any of it on Google.

What I currently have:

  1. Compute the discounted price first and then creates a single charge with the new price and manually create a local subscription (not an ARB anymore) on which I have to create my own billing scheduler.

What I am trying to achieve is something like this:

  1. Apply $100 on first and/or second month of the subscription
  2. After the 2 discounts have been applied, the subscription price should be back to its original price on its next billing.

I'm using a Laravel cashier package for authorize.net, so I want to add a functionality like ->withDiscount() and ->discountUsage()

$user->newSubscription('main', $planId)
    ->skipTrial()
    ->withDiscount(100) // these are the functions I want to achieve 
    ->discountUsage(2)  // the number of times discount is applicable
    ->create($user->authorize_id, [
        'email' => $user->email_address
    ]);

Is what I'm thinking achievable with Authorize.net's current ARB API? Can someone please enlighten me or give some advise for a better option. Thanks!


Solution

  • If you only want to reduce the price for the first one or two payments you can use the trial period functionality in ARB. This allows you to set a different, usually lower, price for a set amount of payments before the regular price is charged on the remaining payments.

    I don't know the package you are using but in the second line you are actively disabling this functionality.

    $user->newSubscription('main', $planId)
        ->skipTrial()  // <-- HERE. This needs to be changed to enable the trial period.
        ->create($user->authorize_id, [
            'email' => $user->email_address
        ]);
    

    You need to read that library's documentation to see how you set that trial period for ARB.

    It looks like you can set that in a config:

    'monthly-10-1' => [
        'name' => 'main',
        'interval' => [
            'length' => 1, // number of instances for billing
            'unit' => 'months' //months, days, years
        ],
        'total_occurances' => 9999, // 9999 means without end date
        'trial_occurances' => 0,
        'amount' => 9.99,
        'trial_amount' => 0, <-- HERE
        'trial_days' => 0, <-- AND HERE
        'trial_delay' => 0, // days you wish to delay the start of billing
    ]
    

    The bottom line what you want to do is possible.