
Before you take real money through Cybersource, run your WooCommerce checkout against the Cybersource sandbox. You can place orders with test cards, check approvals and declines, and try refunds and captures without charging anyone. This guide covers the setup, the test card numbers, what to test and how to switch to live.
How do I test Cybersource payments in WooCommerce?
Short answer: Create REST API keys in the Cybersource test Business Center (businesscentertest.cybersource.com), set the plugin’s Environment to Test, and enter the test Merchant ID and keys in WooCommerce. Then place orders with Cybersource test cards, such as Visa 4111 1111 1111 1111 with any future expiry date, and confirm each one in the test Business Center.
Step 1: Get a sandbox account and test keys
- If you don’t have a test account yet, create a free sandbox account on the Cybersource developer site. If you already have a merchant account, ask Cybersource for its test Business Center login.
- Sign in to
https://businesscentertest.cybersource.com/ebc2. - Go to Payment Configuration › Key Management and generate a REST shared secret key. Copy the Key ID and the Shared Secret; the secret is shown only once.
- For Unified Checkout, enable the payment methods you want to test under Payment Configuration › Unified Checkout. The Unified Checkout setup guide walks through each screen.
Using the Secure Acceptance gateway instead? Create the profile and keys in the same test Business Center: see how to create a Secure Acceptance profile and how to generate the access key and secret key.
Step 2: Put the WooCommerce plugin in test mode
- Go to WooCommerce › Settings › Payments and open the Cybersource gateway.
- Set Environment to Test.
- Enter the test Merchant ID, REST API Key ID and Shared Secret.
- Turn on Debug Mode / Logging while you test, so every request and response is written to WooCommerce › Status › Logs.
- Save, then open your checkout in a private browser window.
Test keys only work with the Test environment, and live keys only with Live. Mixing them is the most common reason the payment form fails to load. If that happens, see how to fix “call failed” errors.
Step 3: Use Cybersource test cards
Enter the full card number, any expiry date in the future and the CVV shown. These cards only work in the sandbox and never move real money.
| Card brand | Test card number | CVV |
|---|---|---|
| Visa | 4111 1111 1111 1111 | 123 |
| Mastercard | 5555 5555 5555 4444 | 265 |
| American Express | 3782 8224 6310 005 | 7890 |
| Discover | 6445 6445 6445 6445 | 123 |
| JCB | 3530 1113 3330 0000 | 123 |
| Diners Club | 3056 9309 0259 04 | 123 |
| Maestro | 6759 6498 2643 8453 | 123 |
| China UnionPay | 6279 8862 4809 4966 | 123 |
| Cartes Bancaires | 4360 0000 0100 0005 | 123 |
| mada | 4464 0400 0000 0007 | 123 |
| ELO | 4514 1600 0000 0003 | 123 |
| EFTPOS | 4017 9500 0000 0009 | 123 |
| Meeza | 5078 0830 0000 0002 | 123 |
A brand only works if it is enabled for your test merchant ID and selected under Allowed Card Networks in the plugin. Visa and Mastercard are enough for most tests.
Step 4: Run these test scenarios
| Test | How | What should happen |
|---|---|---|
| Approved payment | Visa or Mastercard test card | Order moves to Processing, and the transaction shows in the test Business Center |
| Expired card | Any test card with a past expiry date | Declined with a clear message, and the order stays unpaid |
| Invalid card number | Change one digit of a test card | Rejected by the card form before submission |
| Authorize, then capture | Set Payment Action to Authorize only and place an order | Order is On hold. Capturing from the order screen completes it |
| Refund | Refund a paid order from the WooCommerce order screen | The refund appears on the order and in the Business Center |
| Saved card | Add a card from My Account, then pay with it | Checkout offers the saved card and the payment is approved |
| Subscription renewal | Buy a subscription product, then process a renewal from the subscription screen | The renewal is charged to the saved token |
| Block and classic checkout | Repeat the approved payment on both, if you use both | Same result on each |
To check a result, open Transaction Management › Transactions in the test Business Center and search for the WooCommerce order number.
Testing declines and 3D Secure
In the sandbox, specific declines and 3D Secure challenges are triggered by test values that depend on your processor and Payer Authentication setup. Use the numbers in Cybersource’s testing guides for your processor and for Payer Authentication, rather than random cards, so you can tell a configuration problem from an expected decline.
Testing Apple Pay and Google Pay
Wallets need their own enrollment and domain verification before they appear, even in test mode. The Apple Pay and Google Pay enrollment guide covers both.
Step 5: Switch from sandbox to live
- In the live Business Center (
businesscenter.cybersource.com), generate new REST keys. Test keys never work in production. - Enable the same payment methods, fraud settings and 3D Secure on the live merchant ID. They don’t carry over from test.
- Set Environment to Live and enter the live Merchant ID and keys.
- Place one small real order with your own card, then refund it.
- Turn off debug logging.
Frequently asked questions
Do Cybersource test cards charge real money?
No. Test cards only work in the Cybersource sandbox, and the test environment never sends transactions to a real bank. Entered in a live store, they are simply declined.
What expiry date should I use with test cards?
Any date in the future. An expiry date in the past is useful when you want to test an expired-card decline.
Why does my test order fail with valid test cards?
Check that the plugin’s Environment is Test, that the keys come from the test Business Center, and that the card brand is enabled for your merchant ID and in the plugin. The WooCommerce debug log shows Cybersource’s exact response.
Can I test on a staging site?
Yes, as long as it runs on HTTPS. For Unified Checkout, the payment form only loads on the domain the session was created for, so load the staging site on its own address rather than through a proxy.