Creating Recurly BillingInfo using only a token_id -


i have recurly token , trying start subscription using it. following example code snippets, such the 1 in right panel here.

subscription = recurly.subscription(   plan_code = 'bazooka_monthly',   account = recurly.account(     account_code = 'john_rambo',     billing_info = recurly.billinginfo(token_id = 'token_id')   ) ) subscription.save 

however whenever try pass token_id billinginfo, complains "subscription.account.billing_info.number required".

how can create billinginfo token_id without getting validationerror?

to solve problem, upgraded latest version of recurly client library python.

my billing code ended looking , works long card number valid:

account_code = "%s_%s" % (int(time.time()), random.randint(0,10**9))  account = recurly.account(     account_code = account_code,      first_name = form.first_name,      last_name = form.last_name,     email = form.email,     billing_info = recurly.billinginfo(         token_id = form.token     ) ) account.save()  subscription = recurly.subscription() subscription.plan_code = 'bimonthly-candy' subscription.currency = 'usd' subscription.account = recurly.account.get(account_code) subscription.save() 

Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -