chargify/chargify_api_ares

Subscription::PaymentProfile

Opened this issue · 0 comments

I have some use cases where one customer has many subscriptions and wants to replace the existing credit cards with one card. We'd like to be able to handle this internally so the customer does not have to enter new card info 30 times.

I received these instructions from support:

Below I have listed the steps for the best method of updating the payment profile information across multiple subscriptions, as well as attached the relevant API documentation:

  1. Create a new payment profile for each of the subscriptions, using the vault_token​ information of the newly updated card. https://docs.chargify.com/api-payment-profiles#create.
  2. Change the payment profiles, as to make the newly created payment profile the active one on each subscription. https://docs.chargify.com/api-subscriptions#change-default-payment-profile.

Ideally I would like to be able to:

  • Look up the PaymentProfile by the customer_id with the new card
  • Then create a new payment_profile for each subscription based on that result
  • Then make that newly created payment_profile the default payment_profile for the subscription
  • Related to #124, Deleting the old payment_profile would also be useful here

If any of this is supported in the gem now or there is a better way to do this, please point me in the right direction.