0

如果我使用 Recurly Web 界面创建帐户,它没有帐单信息,当我尝试访问它时会收到 AttributeError。我似乎无法向该帐户添加帐单信息。我正在使用 Python API 版本 2.2.4。

我需要在不知道信用卡号或我在本地看不到的其他字段的情况下创建 BillingInfo 以保持 PCI 合规性,因此我尝试使用https://docs.recurly.com/api/中所述的令牌计费信息#update-billing-info-token。我可以为现有的 BillingInfo 执行此操作(通过设置 token_id 并保存 BillingInfo),但我需要一个 BillingInfo 来执行此操作。

如何为还没有帐户的帐户保存帐单信息?

(Pdb) acct = recurly.Account.get(code)
(Pdb) acct
<recurly.Account object at 0x7f2a160530d0>
(Pdb) acct.billing_info
*** AttributeError: billing_info
(Pdb) b_i = recurly.BillingInfo()
(Pdb) b_i.email = 'karl@example.com'
(Pdb) b_i.save()
*** AttributeError: collection_path
(Pdb) account.billing_info = b_i
*** AttributeError: can't set attribute
4

1 回答 1

1

使用Account:update_billing_info方法。

在您的代码片段中,它将类似于:acct.update_billing_info(b_i).

于 2014-10-08T13:22:26.147 回答