循环:检测发票是否有非订阅 charges/adjustment

Recurly: Detecting if an Invoices has non-subscription charges/adjustment

有没有办法区分以编程方式产生的费用、通过续订订阅产生的费用以及手动产生的费用?

编程方式:https://dev.recurly.com/docs/create-a-charge-or-credit

订阅方式:Recurly自动产生费用

手动方式:https://docs.recurly.com/docs/adjustments#section-charging-an-account

区分收费类型的最佳方式可能是为每种收费类型使用不同的会计代码。例如: 以编程方式创建的费用:P-12345 续订订阅产生的费用:R-12345 手动充电:M-12345

然后,例如使用列表帐户的调整 API 调用,循环遍历 returned 数据,按 accounting_code 参数过滤包含 P 的字符串, RM, return 具体调整详情请关注

我想您可以通过

获得有关发票级别的一些详细信息
$isInvoiceFromSubscription = !is_null($invoice->subscription)
//If true the invoice is from an automatic subscription.