Test Payments Before Going Live
Place a test order with each payment method, check the result, then switch Stripe and PayPal to real payments.
Before you start
- Set up Stripe with keys from a Stripe sandbox, and PayPal with Environment set to Sandbox. A sandbox is the test environment of a payment provider: no real money moves. See Set Up Stripe and Set Up PayPal.
- Test on the public address your customers will use. Stripe and PayPal send payment updates to your store as webhooks (automatic messages).
- Test orders are real orders in EverShop. They lower stock, send emails and use order numbers. Finish them before you go live: see Finish your test orders.
- At checkout, use your own email address, so you get the emails your customers get.
Test Stripe payments
The Stripe keys decide between test and live payments. While the Publishable Key starts with pk_test_, the Stripe form at checkout shows a box with a test card. Click Test success or Test failure in the box to see a card that Stripe accepts or declines.
- On your storefront, add a product to the cart, go to checkout, enter an address and choose a shipping method.
- Under Pick a payment method, choose Stripe. Its display name is Credit Card by default.
- Enter a test card number from the table. Use any future expiry date, such as 12/34, and any three-digit security code (CVC).
- Click Pay with Stripe, then check the order. See What to check after a test order.
| Test card number | What happens |
|---|---|
4242 4242 4242 4242 | The payment succeeds, and the order confirmation page opens. |
4000 0000 0000 9995 | Declined for insufficient funds. The cart opens with the message "Payment failed". The order gets the payment status Failed. |
4000 0025 0000 3155 | The card asks for 3D Secure, an extra check by the card's bank. Stripe shows a test page where you can pass or fail the check. Pass it, and the payment succeeds. |
Stripe lists more cards on its testing page. Use only test cards: Stripe's terms do not allow tests with real cards. Every try creates a new order. EverShop cancels a Failed Stripe order by itself, one hour or more later: see Orders canceled automatically. To test a capture, first set Payment mode to Authorize only: see Choose when customers are charged.
Find your PayPal sandbox buyer account
To pay in the PayPal sandbox, you log in at PayPal as a test buyer. PayPal creates this account for you. Do these steps on PayPal's website, or see PayPal's guide to sandbox accounts.
- Log in to the PayPal Developer Dashboard.
- Go to Testing Tools › Sandbox Accounts.
- Find the personal account. Its email address ends with
@personal.example.com. - Open the account's details (View/Edit account). Copy its email address and password.
Test PayPal payments
- On your storefront, add a product to the cart, go to checkout, enter an address and choose a shipping method.
- Choose PayPal. Its display name is Paypal by default. Click Pay with PayPal.
- On PayPal's page, log in with the sandbox buyer account and approve the payment.
- PayPal sends you back to the order confirmation page. Check the order. See What to check after a test order.
Optional: start a second order and cancel it on PayPal's page. EverShop cancels that order, and you return to the checkout with your cart. To see your test payments at PayPal, log in at sandbox.paypal.com with your sandbox business account.
Test cash on delivery
- On your storefront, place an order with cash on delivery.
- In Sale › Orders, open the order. The payment status is Pending, and the order status is New.
- Click Capture Payment, as you will when a customer pays. The payment status becomes Paid. See Capture a Payment.
What to check after a test order
| Check | What you should see |
|---|---|
| The order in Sale › Orders | The new order at the top of the list, with the right items, shipping cost, tax and total. |
| The payment status, in the payment card of the order | Stripe and PayPal: Captured, or Authorized with Authorize only. Cash on delivery: Pending. See Payment status. |
| Activities, at the bottom of the order page | For Stripe and PayPal, a line with the transaction ID, such as "Payment captured by using Stripe. Transaction ID: …". |
| Your inbox | The order confirmation email, if email sending is set up. For Stripe, it comes when the Stripe webhook reaches your store. See Order Emails. |
| Stock, in Catalog › Products | The quantity went down by the amount you ordered. See Manage Stock. |
| Your Stripe sandbox, or the PayPal sandbox business account | A payment with the same amount. |
| Capture and refund | Capture an Authorized test order, and refund a captured one. The refund shows at Stripe or PayPal. See Refund an Order. |
Finish your test orders
Test orders count in the Lifetime Sales and Sale Statistics cards on the Dashboard, even when canceled. Order numbers continue after them. For example, in a new store with five test orders, the first real order is #10006.
Finish every test order before you switch to live:
- Unpaid (Pending, Authorized or Failed): cancel it, with a reason such as "Test order". Its items go back to stock. See Cancel an Order.
- Paid (Paid or Captured): refund the full amount. The order becomes Closed. Then correct the stock quantities.
Get your live keys from Stripe and PayPal
Do these steps on Stripe's and PayPal's websites. They are the steps you did for the sandbox, now in live mode.
- In the Stripe Dashboard, switch to live mode. Copy the publishable key (
pk_live_) and the secret key (sk_live_). See Copy your Stripe API keys. - In live mode, add a Stripe webhook with the same address and events as your sandbox webhook. Copy its signing secret. See Add the Stripe webhook.
- In the PayPal Developer Dashboard, choose Live. In Apps & Credentials, open or create your live app. Copy its client ID and secret. You need a verified PayPal Business account.
- Add a webhook to the live PayPal app, with the same address and events as your sandbox webhook. Copy its webhook ID. See Create the PayPal webhook.
A sandbox webhook does not get live payments. Without the live Stripe webhook, paid orders stay Pending for an hour or more.
Switch EverShop to live payments
Change all values of one provider at the same time. Sandbox values and live values do not work together.
Switch Stripe to live
-
Go to Setting › Payment Setting.
-
In the Stripe Payment card, replace the Publishable Key with the key that starts with
pk_live_. -
Replace the Secret Key with the key that starts with
sk_live_. -
Replace the Webhook Secret Key with the signing secret of the live webhook.
-
Click Save at the bottom of the page.
The test card box no longer shows at checkout. If you chose Authorize only for your tests, set the Payment mode you want for real orders.
Switch PayPal to live
-
Go to Setting › Payment Setting.
-
In the PayPal Payment card, replace the Client ID with the live client ID.
-
Replace the Client Secret with the live secret.
-
Replace the Webhook ID with the ID of the live webhook.
-
In Environment, choose Live.
-
Click Save at the bottom of the page.
The new values apply from the next checkout. If customers then see an error, see Why do customers see an error after they click Pay with PayPal?.
Troubleshooting
Why does a paid Stripe test order stay Pending?
The Stripe webhook did not reach your store, or EverShop refused it. The webhook and the keys must come from the same sandbox. See Why does a paid Stripe order stay Pending?.
Why does checkout still show Test success and Test failure?
The Publishable Key still starts with pk_test_, so your store still takes only test payments. Replace all three Stripe values: see Switch Stripe to live.
If a key field shows the test key again after you save, or a key that ends in stars (*****), the key is set in your store's configuration file. A key there wins over the admin panel. Ask your developer to change it there.
Why do Capture Payment and Refund fail on a test order?
EverShop now sends your live values to Stripe or PayPal, also for test orders. Live values cannot reach a test payment, so the provider refuses, and the order keeps its status. You can still cancel a Pending or Failed test order.
Next steps
- Capture a PaymentTake the money for an authorized payment.
- Refund an OrderGive a customer all or part of their money back.
- Cancel an OrderStop an unpaid order and return its stock.
- Set Up Email SendingSend order emails to your customers.
For developers
Keys set under system.stripe and system.paypal in the configuration override the admin panel: see Credential Resolution. To send Stripe webhooks to a store on your own computer, use the Stripe CLI.