Laravel Cashier 让交换计划变得非常简单:
$user->subscription('premium')
->swapAndInvoice();
此功能也很棒,因为它会立即向用户开具发票,但是,它也迫使用户立即付款,而不是像通常那样等待一个小时。这似乎妨碍了我的invoice.created
webhook,因为一旦swapAndInvoice
发生,我似乎无法对发票进行进一步更改。
如果我只使用->swap()
,它似乎根本不会创建发票,而只是创建等待添加到下一张发票的行项目。想法受到赞赏。