Update Payment Method APIs (Recharge)

awmly
Shopify Partner
3 0 0

Hi Guys,

 

Does anyone know of an alternative way of updating card details associated with a subscription payment method without using the https://shopify.dev/docs/api/admin-graphql/2023-01/mutations/customerpaymentmethodsendupdateemail API?

 

Ideally we want to build the UI directly in our app, use the stripe API and update the payment method. I can only see a any of creating a new payment method though, not updating the current one? https://shopify.dev/docs/api/admin-graphql/2023-01/mutations/customerPaymentMethodRemoteCreate

 

For context, we are using Recharge for subs and they won't allow us to change the payment method associated with a sub, only update it.

 

Thanks

Replies 4 (4)

JuanHoyos
Shopify Staff
43 4 6

Hi @awmly!

 

I assume you are using Stripe as payment processor and you want to have your customers enter new payment method details using Stripe's platform, and later, you want to update your customer's subscription contract in Shopify with the new payment method.

 

After you obtain the new Stripe payment method, you should be able to achieve that with the following:

  1. create a new remote payment method for the customer. You are in the right direction with customerPaymentMethodRemoteCreate (see Step 3 here for more details), and
  2. update the subscription contract's payment method (start at Step 2 from this guide)

 

Please notice that customerPaymentMethodRemoteCreate exists to support migrations from other subscriptions platforms. Shopify will not follow changes made to the payment method in Stripe (expiry date, last digits, etc.)

 

Let us know how it goes.

 

Best,

 

Juan

To learn more visit the Shopify Help Center or the Community Blog.

awmly
Shopify Partner
3 0 0

Hi @JuanHoyos 

Thanks for your reply.

 

The payment methods in question are Shopify Payments and do not exist in our stripe account.

 

We do however have scripts in place that can connect to the stripe API and then use the customerPaymentMethodRemoteCreate  API to create a new Shopify Payments payment method. 

 

As we are using Recharge for our subscriptions, if we update the subscription contract (as you outlined in point #2) would the new payement method ID then get pushed through to recharge?

 

Thanks

Andrew.

JuanHoyos
Shopify Staff
43 4 6

> if we update the subscription contract (as you outlined in point #2) would the new payement method ID then get pushed through to recharge?

 

This would be a question for ReCharge, but I'd guess that they should be listening to the contract's changes webhook and can follow through.

 

Please notice that payment methods created with customerPaymentMethodRemoteCreate are not handled by Shopify Payments, but through the corresponding remote payment processor (Stripe, PayPal, etc.)

 

Best,

 

Jua

To learn more visit the Shopify Help Center or the Community Blog.

JuanHoyos
Shopify Staff
43 4 6

By the way, we do not expect to provide APIs for handling credit card details because this is out of our PCI scope.

To learn more visit the Shopify Help Center or the Community Blog.