如何设置试用期的时间间隔在authorize.net?

问题描述 投票:0回答:1

我使用的客户资料API使用authorize.net的包月计划,试用期。参考:https://developer.authorize.net/api/reference/#recurring-billing-create-a-subscription-from-customer-profile我要为订阅的试用期区间。在API中,我无法得到相关试用期的时间间隔。场景:如果我订阅的日期2019年1月1日,然后用户将获得7天第一次试用期。因此,审判结束日期必须是2019年8月1日0金额。然后实际订阅结束日期必须是2019年8月2日(用于试用期后1个月)和100量订阅。

$subscription = new AnetAPI\ARBSubscriptionType();
$subscription->setName("Sample Subscription");

$interval = new AnetAPI\PaymentScheduleType\IntervalAType();
$interval->setLength('30');
$interval->setUnit("days");

$paymentSchedule = new AnetAPI\PaymentScheduleType();
$paymentSchedule->setInterval($interval);
$paymentSchedule->setStartDate(new DateTime('2019-01-01'));
$paymentSchedule->setTotalOccurrences("9999");
$paymentSchedule->setTrialOccurrences("1");

$subscription->setPaymentSchedule($paymentSchedule);
$subscription->setAmount(100);
$subscription->setTrialAmount("0.00");

使用什么参数,我可以通过试用期的authorize.net?请帮我在这。提前致谢。

php authorize.net recurring-billing authorize.net-arb
1个回答
1
投票

这不是一个试用期在Authorize.Net条款。这仅仅是开始在认购延迟。所有你需要做的是设置开始日期是一个星期后,然后创建了一个月的时间框架内的正常申购。这里不需要特殊的代码或参数。

因此,在你具体的例子变化

 $paymentSchedule->setStartDate(new DateTime('2019-01-01'));

$paymentSchedule->setStartDate(new DateTime('2019-01-08'));

或者,如果你想让它动态地进行:

$paymentSchedule->setStartDate(new DateTime('+7 days'));
© www.soinside.com 2019 - 2024. All rights reserved.