Skip to content

Wallet and Backup Payment#491

Merged
naspthorp merged 5 commits into
v2from
sim-421-wallet
Apr 16, 2021
Merged

Wallet and Backup Payment#491
naspthorp merged 5 commits into
v2from
sim-421-wallet

Conversation

@joannasese

@joannasese joannasese commented Apr 13, 2021

Copy link
Copy Markdown
Contributor

POST v2/accounts/:account_code/billing_infos

account = recurly.Account.get("accountCode");
binfo = recurly.BillingInfo(
    first_name = 'Benjamin',
    last_name = 'DuMonde',
    number = '4111111111111111',
    verification_value = '123',
    month = 11,
    year = 2025,
    address1 = '123 Main St',
    city = 'New Orleans',
    state = 'LA',
    zip = '70114',
    country = 'US',
    primary_payment_method = True,
    backup_payment_method = False
)
account.create_billing_info(binfo)

GET v2/accounts/{account_code}/billing_infos

account.get_billing_infos()

GET v2/accounts/{account_code}/billing_infos/{uuid}

account.get_billing_info("billingInfoUuid")

PUT v2/accounts/{account_code}/billing_infos/{billing_info_id}

binfo_to_update = account.get_billing_info("billingInfoUuid")
binfo_to_update.city = "Washington"
binfo_to_update.backup_payment_method = True
account.update_billing_info(binfo_to_update)

DELETE v2/accounts/{account_code}/billing_infos/{billing_info_id}

binfo = account.get_billing_info("billingInfoUuid")
binfo.delete()

POST v2/accounts and PUT v2/accounts/{account_code}
These endpoints are documented https://developers.recurly.com/api-v2/v2.29/index.html#operation/updateAccountsBillingInfoCreditCard and https://developers.recurly.com/api-v2/v2.29/index.html#operation/updateAccount, for example.

POST v2/purchases

purchase = recurly.Purchase(
  account = account,
  billing_info_uuid = account.get_billing_infos()[0].uuid,
...
)
collection = purchase.invoice()

POST v2/subscriptions

subscription = recurly.Subscription()
subscription.plan_code = plan.plan_code
subscription.account = account
...
subscription.billing_info_uuid = account.get_billing_infos()[0].uuid
subscription.save()

PUT v2/subscriptions/{uuid}

sub = recurly.Subscription.get('5a3b66415f973d7e4c68b74b07b7dc70')
sub.quantity = 3
sub.billing_info_uuid = account.get_billing_infos()[1].uuid
sub.save()

PUT v2/invoices/{invoice_number}/collect

invoice = recurly.Invoice.get('2505')
invoice.billing_info_uuid = account.get_billing_infos()[0].uuid
invoice.force_collect()

- url will depend on billing info param
@joannasese joannasese marked this pull request as ready for review April 14, 2021 15:40
@naspthorp naspthorp merged commit dffa1cf into v2 Apr 16, 2021
@naspthorp naspthorp deleted the sim-421-wallet branch April 16, 2021 21:05
recurly-integrations pushed a commit that referenced this pull request Apr 20, 2021
[Full Changelog](2.9.24...2.9.25)

**Merged Pull Requests**

- Wallet and Backup Payment [#491](#491) ([joannasese](https://github.com/joannasese))
recurly-integrations pushed a commit that referenced this pull request Apr 20, 2021
[Full Changelog](2.9.24...2.9.25)

**Merged Pull Requests**

- Wallet and Backup Payment [#491](#491) ([joannasese](https://github.com/joannasese))
recurly-integrations pushed a commit that referenced this pull request Apr 22, 2021
[Full Changelog](2.9.24...2.9.26)

**Merged Pull Requests**

- Wallet and Backup Payment [#491](#491) ([joannasese](https://github.com/joannasese))
recurly-integrations pushed a commit that referenced this pull request Apr 22, 2021
[Full Changelog](2.9.24...2.9.25)

**Merged Pull Requests**

- Wallet and Backup Payment [#491](#491) ([joannasese](https://github.com/joannasese))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

V2 V2 Client

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants