The first thing to do when testing is to make sure that you have a test environment. You cannot test payments in production (your live environment) because you then have to make a real payment. If you’re testing multiple payments at once, it’s very inefficient to have to cancel those payments or to make refunds afterwards.
Shopify have an option for this for premium customers called Test Mode in Shopify Payments. For non-premium customers, Shopify have created a workaround called Bogus Gateway.
To use the Bogus Gateway, navigate to Settings > Payment Providers and click Add a Provider. Click Third Party Credit Card Provider and select (for testing) Bogus Gateway from the drop down menu. From here, Shopify provide you with the instructions on how to use this method.
Next, to start your test, navigate to your previewed site, and add at least one item to your basket.
Then, click check out, and fill in the required fields with customer data. If you’re using an application that pre-fills fields, make sure to turn this off first.
Before you proceed to payment, select any shipping method.
At this stage, you need to enter credit card details.
If you’re using the Bogus Gateway method, all you need to do is select the yellow B option as payment method and enter 1, 2, or 3 as your credit card details, depending on what you want to test (again, this is explained when you activate the Bogus Gateway).
If you’re using test mode, you’ll need test credit card data. You should test both successful and failed transactions to check that the message customers receive after payment is accurate.
You can use the simulation data provided by Shopify to do this:
For successful transactions:
Card type
Test credit number
Visa
4242424242424242
Mastercard
5555555555554444
American Express
378282246310005
Discover
6011111111111117
Diners Club
30569309025904
JCB
3530111333300000
For failed transactions:
Error message
Card declined
4000000000000002
Incorrect number
4242424242424241
Disputed transaction
4000000000000259
Invalid expiry month
Expiry month: 13 (any invalid month)
Invalid expiry year
Expiry year: 2020 (any past year)
Invalid security code
Security code: 99 (any two digits)
Once you’ve completed your tests, make sure to exit test mode or switch off the Bogus Gateway method, to ensure that payments can be processed as normal again.
Last updated Jun 23, 2022
Views 293
Applies to: Other