-1

I am following the example code snippets the one in the right panel here. So I have a Recurly token and am trying to start a subscription using it.

    subscription = Subscription()
    subscription.plan_code = 'monthly'
    subscription.currency = 'USD'

    account = Account(account_code='1a')
    account.email = 'mark@example.com'
    account.first_name = 'mark'
    account.last_name = 'lname'

    billing_info = BillingInfo()
    billing_info.number = '4111-1111-1111-1111'
    billing_info.month = 1
    billing_info.year = 2019

    account.billing_info = billing_info
    subscription.account = account

    subscription.save()

I get error 500 when the code above runs. If I comment out subscription.save() the logs show ParseError: mismatched tag: line 6, col 2 which seems like xml parsing error. I get no error(but of course I presume the subscription is not being saved). Could this error be as a result of testing many times? or what could be the issue? am using sandbox.

Alexxio
  • 1,091
  • 3
  • 16
  • 38

1 Answers1

1

My bad. I was missing recurly.SUBDOMAIN together with recurly.RECURLY_API_KEY settings. All save() methods for recurly.Subscription(), recurly.BillingInfo(), recurly.Account() were throwing the error when called.

Alexxio
  • 1,091
  • 3
  • 16
  • 38