Re: subscriptionBillingAttempt returns INVALID_PAYMENT_METHOD, Bug?

subscriptionBillingAttempt returns INVALID_PAYMENT_METHOD, Bug?

Jiazhen
Shopify Partner
23 1 1

Hi Shopify,

 

We've been following https://shopify.dev/apps/subscriptions/migrate/contracts#migrating-from-stripe

to migrate Stripe payment methods to Shopify subscription API.

 

Note that we used to use Recharge. And we connected with three different Stripe accounts before.

So we use `{SHOP_URL}/admin/payments/legacy_subscription` to connect to one Stripe account, do the payment method migration, disconnect and connect to another Stripe account. Until all three finishes.

 

When we try to bill customers, SubscriptionBillingAttempt

We got error code and message

ERROR INVALID_PAYMENT_METHOD No such PaymentMethod: 'pm_xxxxx' null.

 

This payment method is valid, not expired, right band, right last 4 digits.

 

Is this a bug in Shopify API?

 

Thanks

Replies 11 (11)

matart
Shopify Staff (Retired)
31 4 5

Hi @Jiazhen 

 

Do you have the GID for the billingAttempt? I can look up what is happening.

 

Just to verify, are you trying migrate 3 different stripe accounts to Shopify? 

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

Jiazhen
Shopify Partner
23 1 1

Hi @matart , thank you for the reply.

The billingAttempt GID is gid://shopify/SubscriptionBillingAttempt/3888447536

Thanks!

Look forward to hearing from you

Best regards

Jiazhen

Jiazhen
Shopify Partner
23 1 1

Hi @matart ,

To your second question,

"Just to verify, are you trying migrate 3 different stripe accounts to Shopify? "

Yes. I've migrated three different Stripe accounts to our new Shopify store.

 

I connected one Stripe account, migrated payment methods, disconnect, connect with another Stripe account, and migrate.

matart
Shopify Staff (Retired)
31 4 5

So the way the migration works is that you import your stripe tokens and we use those tokens to talk to stripe. We do not import the details of those tokens it remains on stripe attached to that stripe account. If you deactivate that stripe account and setup another one, your migrated payment methods will not work. I believe this the error you are seeing.

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

Jiazhen
Shopify Partner
23 1 1

Thanks for the reply @matart .

 

In your migration doc it says

"If your current payment gateway is Stripe or Braintree, then you'll use Shopify Payments after the migration."

So, isn't it true that we can just disconnect the Stripe account after migration? If what you explain is true, we then need Stripe connected after migration?

And your migration guide doesn't work for multiple Stripe accounts?

Jiazhen
Shopify Partner
23 1 1

@matart could you help to clarify this? Do we always have to connect a Stripe account even after we enable Shopify gateway?

And the migration can't work with multiple Stripe accounts?

Jiazhen
Shopify Partner
23 1 1

@matart one more question please, will the migration work if I merge three Stripe accounts into one?

matart
Shopify Staff (Retired)
31 4 5

In your migration doc it says

"If your current payment gateway is Stripe or Braintree, then you'll use Shopify Payments after the migration."

So, isn't it true that we can just disconnect the Stripe account after migration? If what you explain is true, we then need Stripe connected after migration?

And your migration guide doesn't work for multiple Stripe accounts?



All new payment methods will be stored by us and use Shopify Payments. We will use the stripe token for the migrated payment methods only. You will need to keep the stripe account active for these to work. When a customer updates their payment method we will store the new details and use Shopify Payments for it going forward. This will not work for multiple accounts.

@matart could you help to clarify this? Do we always have to connect a Stripe account even after we enable Shopify gateway?

And the migration can't work with multiple Stripe accounts?



Like above we will use the Stripe gateway for all migrated payment methods and Shopify Payments for all newly created methods. Because stripe tokens are unique to the account that created them you will need to keep the stripe account active.


@Jiazhen wrote:

@matart one more question please, will the migration work if I merge three Stripe accounts into one?


If you merge all your stripe accounts into a single account that should work. I don't know how stripe handles that but you may need to re migrate the payment methods if any of the token details change.

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

Jiazhen
Shopify Partner
23 1 1

Hi @matart ,

 

One more question please, from the Shopify API, can I query the remote payment method that I migrated? I want to see the payment token I migrated.

 

Thanks

 

Best regards

Jiazhen

matart
Shopify Staff (Retired)
31 4 5

@Jiazhen wrote:

Hi @matart ,

 

One more question please, from the Shopify API, can I query the remote payment method that I migrated? I want to see the payment token I migrated.

 

Thanks

 

Best regards

Jiazhen


You should be able to see the payment method attached to the customer if your app has the correct permissions: https://shopify.dev/api/admin-graphql/2022-07/objects/CustomerPaymentMethod

 

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

Jiazhen
Shopify Partner
23 1 1

@matart I mean the payment token? the CustomerPaymentMethod object from GQL does not include the payment token? It only tells `source: remote`