代码之家  ›  专栏  ›  技术社区  ›  Dexter Bengil

授权.net对ARB认购申请一次性现金折扣

  •  0
  • Dexter Bengil  · 技术社区  · 6 年前

    我目前拥有:

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

    1. 在订阅的第一个月和/或第二个月申请100美元
    2. 在应用了2个折扣后,订阅价格应在下次计费时恢复到原来的价格。

    Laravel cashier package 为了authorize.net,所以我想添加如下功能 ->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
        ]);
    

    我的想法是可以实现的吗授权.net的电流 ARB API

    1 回复  |  直到 6 年前
        1
  •  3
  •   John Conde    6 年前

    如果您只想降低前一两次付款的价格,您可以使用 trial period 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
    ]