【问题标题】:how to add a Recurly Billinginfo with the Python API?如何使用 Python API 添加 Recurly Billinginfo?
【发布时间】:2014-09-25 16:52:19
【问题描述】:

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

我需要在不知道信用卡号或其他我在本地看不到的字段的情况下创建 BillingInfo 以保持 PCI 合规性,因此我尝试使用https://docs.recurly.com/api/billing-info#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

【问题讨论】:

    标签: python recurly


    【解决方案1】:

    使用Account:update_billing_info 方法。

    在您的代码 sn-p 中,它将类似于:acct.update_billing_info(b_i)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-09-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-01-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多