The worst time to find out your payment gateway is misconfigured is when a real customer is standing at your checkout with a real card. A sandbox lets you find those problems first, with fake money and no embarrassment.
This guide to testing a payment gateway sandbox in WooCommerce explains what a sandbox is, what it cannot tell you, the tests worth running and the order in which to run them before you go live. It applies to any gateway that offers a test mode. Where we mention plugin features, we describe the TechBella CCAvenue plugins, which include a sandbox mode in both the free and the Pro version.
| Stage | What to confirm |
|---|---|
| Setup | Test credentials, region and currency are correct and kept private |
| Core tests | Successful, declined, cancelled and abandoned payments behave as designed |
| Real life | Mobile, app switching, coupons, shipping and VAT totals |
| Go-live | Live credentials, one small real order and test data removed |
What a payment gateway sandbox is
A sandbox is a separate test environment run by your payment provider, such as CCAvenue for UAE merchants. It behaves like the live gateway, but it accepts test card details and moves no real money. You get a separate set of credentials for it, and your store is switched to those credentials while you test. When you are happy, you switch to the live credentials.
Because the sandbox is separate, it has its own limits. Test and live credentials are not interchangeable, a payment made in the sandbox will never appear in your live dashboard and some features may behave a little differently. Treat a passing sandbox test as evidence that your store is wired correctly, not as proof that every real bank will approve every real card.
Before you test: set up safely
Use a staging copy when you can
If your host offers a staging site, test there. It keeps experiments away from customers and stops test orders cluttering your live reports. If you test on the live site, use a private product or hide the test product from the shop, and remember to delete the test orders later.
Collect the right credentials
For CCAvenue you need the merchant ID, access code and working key that belong to the test environment. Ask your provider for them in writing. Never put keys into a screenshot, an email or a support ticket. The Pro plugin and the free plugin both let you enter test credentials and switch sandbox mode on, which keeps live and test setups apart.
Check your region and currency
The region setting decides which gateway endpoint is used, so confirm it. If you sell in AED, make sure the store currency is AED and that the gateway account supports it. Our guide to accepting AED payments lists the settings that most often cause mismatches.
The tests to run, in order
Test 1: a successful payment
Place an order with a test card from your provider’s documentation and complete the payment. Check that the customer lands on a proper thank-you page, the order moves to the right status, stock is reduced and the confirmation email arrives. Read the order notes to see what the gateway returned.
Test 2: a failed payment
Use the provider’s test details for a declined card. The order should end as Failed or stay unpaid, the customer should see a clear message and be able to try again, and no stock should stay locked for long. A failed payment that leaves the customer on a blank page is a common bug.
Test 3: a cancelled payment
Start a payment and cancel it on the gateway page, then return to the store. The order should be cancelled or pending in a way you understand, and the cart should be easy to recover. Our guide to failed payment orders explains the statuses.
Test 4: closing the page mid-payment
Close the browser tab on the gateway page. This simulates a customer who loses signal or switches apps. The order should stay unpaid, not complete, and your hold-stock setting should eventually release the items.
Test 5: mobile and desktop
Repeat the successful payment on a phone, on mobile data, and switch between the browser and another app during the payment. This matters even more now that banks use app approval, as we describe in our guide to UAE online payment authentication.
Test 6: the checkout type
If you use the Blocks checkout, test it as well as the classic checkout. The Pro plugin supports Blocks, and the free plugin supports the classic checkout only. Read our checkout block guide for what to look for.
Test 7: coupons, shipping and taxes
Run one order with a coupon, one with shipping and one with VAT. The amount sent to the gateway should equal the order total shown to the customer. Compare the two numbers on the gateway dashboard and the WooCommerce order.
What to record
Keep a simple table of each test with the date, the result, the order number and anything odd. A short record turns testing into evidence, and it helps a developer if something later breaks.
| Test | Expected result |
|---|---|
| Successful payment | Order Processing, stock reduced, email sent |
| Declined payment | Order Failed, clear message, easy retry |
| Cancelled payment | Order cancelled or pending as designed, cart recoverable |
| Closed page | Order unpaid, stock released after hold time |
| Totals | Gateway amount equals order total |
Moving from sandbox to live
- Switch sandbox mode off and enter the live credentials. Double-check each value.
- Confirm that the live merchant account is approved for your region and currency.
- Place a small real order yourself and refund or cancel it through your gateway’s own process.
- Check that the live dashboard shows the payment and the order status matches.
- Delete or archive your test orders and test products.
- Turn on debug logging only while you investigate, and turn it off afterwards. Logs can hold sensitive details, so read them before you share them.
Common sandbox mistakes
- Entering live credentials while sandbox mode is on, or the reverse.
- Testing only the successful payment.
- Forgetting that test and live accounts are separate.
- Leaving test products visible in the shop.
- Sharing keys in tickets and screenshots.
Where the plugin helps and where it does not
TechBella Payment Gateway Pro and the free plugin both include sandbox mode, debug logging and automatic order status sync. They do not create merchant accounts, they cannot make a provider approve a region and they cannot change which payment methods your gateway enables. Pro adds the CCAvenue UAE region and the Blocks checkout, and you need your own CCAvenue account. Confirm UAE eligibility with CCAvenue in writing before you buy.
When to get a second opinion
If you cannot reproduce the same result twice, or the sandbox and live behaviour differ, ask a developer to review the setup. Our website maintenance team can run the test plan on staging and write up the results.
A sample sandbox test day
Block out half a day, and do the tests in one sitting so the results are comparable. In the first hour, set up staging, switch the gateway to sandbox and confirm the credentials and region. In the second hour, run the successful, declined and cancelled tests on a laptop and note the results.
In the third hour, repeat on a phone, including an app switch, and test the Blocks and classic checkouts if you use both. In the last hour, test totals with a coupon, shipping and VAT, and write a one-page summary with any fixes. At the end you know exactly what works, what does not and who needs to fix it.
Testing refunds and cancellations
Many stores test the happy path and never test what happens after. In sandbox mode, create a paid order and then cancel or refund it using your gateway’s own process. Check that the order status, stock and emails behave as you expect, and note what the gateway dashboard shows.
Remember that WooCommerce can record a refund on the order, but whether it moves money depends on the gateway and the plugin, so confirm what your setup does. Our plugins keep order status in line with the gateway result, and they do not claim to process refunds from inside WooCommerce.
Testing the emails and the thank-you page
The payment result is only part of the customer’s experience. Check that the thank-you page shows the right order number and message, that the confirmation email arrives within a minute or two, that it looks right on a phone and that it is not caught by spam filters. For failed payments, check the message on the page and any email. Customers who see a blank or confusing page after paying tend to pay twice or contact support, and both cost you time.
What to do when a test fails
Do not change several things at once. Note exactly what you did and what happened, switch debug logging on for one more try and read the order notes. Check credentials and region first, because they cause most early failures. Then check the site address and security rules, then plugin conflicts. If you are stuck, send a developer the test steps, the time, the order number and the cleaned log lines. Our guide to failed payment orders explains how to read what you find.
Keep your test plan for later
The same list is useful after every update. Save it as a document, and run it on staging whenever you update WooCommerce, PHP or the payment plugin. A routine like this takes less time each round and prevents most surprises. Our website maintenance checklist shows where it fits in your quarterly work.
Payment gateway sandbox: a quick summary
A payment gateway sandbox lets you test with fake money before real customers arrive. Run the successful, declined, cancelled, closed-page, mobile and totals tests, record each result and switch to live only after a small real order works. A payment gateway sandbox test does not guarantee that every bank will approve every card, but it shows your store is wired correctly.
Key takeaways on payment gateway sandbox
- Use the payment gateway sandbox with test credentials only.
- Test a decline, a cancel and a closed page in the payment gateway sandbox, not only a success.
- Place one small live order after the payment gateway sandbox tests pass.
Need a CCAvenue gateway for WooCommerce?
TechBella Payment Gateway Pro connects WooCommerce to your own CCAvenue merchant account, with the UAE region, Blocks checkout and compatibility updates. It is an independent plugin, not an official CCAvenue product.
Frequently Asked Questions
Can I use my live credentials in sandbox mode?
No. Test and live credentials are separate. Using the wrong set is one of the most common reasons a test fails.
Do I need a staging site to test payments?
It is the safest option, but not required. If you test on the live site, hide the test product and clean up the test orders afterwards.
Does a passing sandbox test guarantee live payments will work?
No. It shows your store is wired correctly. Real banks, real cards and live account settings can still behave differently, so place a small live order before you launch.
Which gateway features should I test besides a successful payment?
A declined payment, a cancelled payment, closing the page mid-payment, mobile checkout and totals with coupons, shipping and VAT.

