With the recurly V2 python client (2.2.17, python 3.5), creating a new account and then reading account.billing_info raised AttributeError — even after re-fetching with Account.get('1'). The reporter was following the docs example for updating billing info. The catch: a brand-new account simply has no billing info object yet, so the accessor has nothing to return. The reporter's workaround was confirmed correct by a maintainer, who updated the docs example (it had shown the update flow for what is really a create case).
recurly python: account.billing_info raises AttributeError on new accounts
- account.billing_infoproduct
- BillingInfoproduct
- recurly V2 python clientlibrary
- recurly-client-pythonlibrary
- Account.getproduct
- +2 more
Don't read billinginfo off a new account — create one and attach it. The verified pattern: account = Account.get('1'), then `billinginfo = BillingInfo(), billinginfo.tokenid = 'TOKENID', account.updatebillinginfo(billinginfo)`. The maintainer confirmed this is the expected way to create (as opposed to update) billing info. So the docs example you copied was for the update case; for new accounts, construct the BillingInfo object yourself and pass it to updatebillinginfo. Source: https://github.com/recurly/recurly-client-python/issues/145
Source: https://github.com/recurly/recurly-client-python/issues/145