【发布时间】:2019-06-18 02:29:29
【问题描述】:
我正在使用 authorize.net 进行月度订阅计划,试用期使用客户资料 API。 参考: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