首页 > 解决方案 > Authorize.net 对 ARB 订阅申请一次现金折扣

问题描述

是否可以对自动定期计费订阅应用一次/多次现金折扣?我似乎无法在 Google 上找到任何内容。

我目前拥有的:

  1. 首先计算折扣价,然后使用新价格创建单笔费用,并手动创建本地订阅(不再是 ARB),我必须在该订阅上创建自己的计费计划程序。

我想要实现的是这样的:

  1. 在订阅的第一个月和/或第二个月申请 100 美元
  2. 应用 2 次折扣后,订阅价格应在下一次结算时恢复为原始价格。

我正在为 authorize.net 使用Laravel 收银员包,所以我想添加一个功能,比如->withDiscount()->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
    ]);

我认为 Authorize.net 当前的ARB API可以实现吗?有人可以启发我或提供一些建议以获得更好的选择。谢谢!

标签: phplaravelauthorize.netauthorize.net-arb

解决方案


如果您只想降低前一两次付款的价格,您可以使用 ARB 中的试用期功能。这允许您在对剩余付款收取正常价格之前,为一定数量的付款设置不同的(通常较低的)价格。

我不知道您正在使用的软件包,但在第二行中您正在积极禁用此功能。

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

您需要阅读该库的文档以了解如何为 ARB 设置试用期。

看起来您可以在配置中进行设置:

'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
]

最重要的是,您想做的事情是可能的。


推荐阅读