There doesn't seem to be a way to test a failed transaction.

eat_to_evolve
Tourist
5 0 1

If we are using Shopify Payments in test mode, it doesn't allow you to put in an invalid credit card number from https://help.shopify.com/en/manual/payments/shopify-payments/testing-shopify-payments#simulate-faile.... When you try to checkout, it fails. If you try to update your payment method to one of those, it just says 'Failed to update payment method'.  So this means the payment method on a subscription is always valid in test mode, since we can't add non valid ones.

any ideas?

chris_mctavish
Tourist
4 0 1

I agree, this is very important to test our failed credit card flows. Would revoking a customer's payment method lead to a failed billing attempt?

There needs to be a way to add an invalid credit card number or to invalidate a credit card using test mode.

0 Likes
matart
Shopify Staff
Shopify Staff
5 0 2

Hey eat_to_evolve!

Currently there isn't a way to test a card that succeeds initially and then fails for the reasons that you mentioned. The best way right now is to look at the error code[1] that will be returned when a billing attempt fails.

 

References:

1. https://shopify.dev/docs/admin-api/graphql/reference/orders/subscriptionbillingattempterrorcode

0 Likes
matart
Shopify Staff
Shopify Staff
5 0 2

Hey  chris_mctavish!

 

I believe revoking a customer payment method will give you an error code but it won't be the same as if a card was declined, or another error. 

 

Here is a current list of error codes that can be returned: https://shopify.dev/docs/admin-api/graphql/reference/orders/subscriptionbillingattempterrorcode 

0 Likes
eat_to_evolve
Tourist
5 0 1

Hey @matart , I understand we can look at the error code, but the issue is I cannot actually make sure a transaction fails so I can test my flow properly with retries. Is there any plans to allow us to enter invalid card numbers?

0 Likes
matart
Shopify Staff
Shopify Staff
5 0 2

Hey @eat_to_evolve!

I wish I had better news, this issue is on our radar but there currently isn't a timeline for implementing it.

0 Likes