1:如何测试和触发预定的订阅。
$plan = Plan::create([
'currency' => $currency,
'interval' => 'day',
'product' => $product,
'amount' => $amount
]);
$schedule = SubscriptionSchedule::create([
'customer' => $customer_id,
'start_date' => 'now',
'end_behavior' => 'release',
'phases' => [
[
'plans' => [
[
'price' => $plan->id,
'quantity' => 1,
],
],
'iterations' => 3,
'collection_method'=> 'charge_automatically'
],
],
]);
return $schedule;
因此,我今天创建一个订阅,以进行测试。同样,在创建计划时,我们只能将结算频率指定为日,周,月或年。
已经尝试使用参数更新订阅ID
setting trial_end: Few seconds from now
prorate: false
但这会创建同一个月的发票。此外,它还会使用amt:0创建另一个发票。(不知道为什么创建了该发票)。
2:这是测试订阅时间表的相同方法。