Card Test Refund Transaction Guide
Learn how to perform a card test refund transaction with our comprehensive guide.
Redeem your gift cards at any of our Merchants
Onyx Gift Cards is a Grenadian company designed to introduce, market and manage gift cards systems in Grenada for retailers and corporations. We are enthusiastic about the effect and influence we will have on the local market. We intend to expand our systems regionally with a range of product offerings and services.
Gift cards are the preferred way of giving and receiving gifts. They carry a monetary value that can be redeemed for gifts at your favorite store.
Onyx GiftCards are “Open Gift Cards” which means that they can be redeemed at multiple merchant locations. They are standard credit card size, can fit into the average wallet and made of PVC plastic. Onyx GiftCards are Barcoded for security and safety for the consumer and bear a disclaimer at the back.
Onyx Giftcards can be bought with a branded Card backer which is black in colour and is designed to fit the card. There is an area to write a brief message to the recipient as well.
A refund test card is a card number that payment processors provide for sandbox testing. You use it to trigger refunds without moving real money. These cards behave like real ones in test mode, but they are tied to simulated transactions. When you process a refund against a test card, the gateway returns a simulated response. That lets you verify your refund logic, error handling, and UI without touching live accounts.
Most payment gateways separate test and live modes. In test mode, you create charges with test cards. Then you refund those charges using the same card or a refund endpoint. The gateway doesn't contact banks. Instead, it follows rules you define in your test dashboard. For example, you can set a test card to always succeed, always fail, or return specific error codes. Some gateways also let you simulate partial refunds, multiple refunds, and refunds after a delay.
Test cards come with preset behaviors. Here are typical ones you'll see:
Each gateway publishes its own test card numbers and behaviors. Stripe, for instance, has cards that trigger specific decline codes. PayPal's sandbox uses test accounts instead of card numbers. Braintree and Adyen also provide test card sets. I always check the gateway's docs for the exact numbers and expected outcomes.
First, create a test charge using a test card number. Then call your gateway's refund API with the charge ID. In many sandboxes, you can also refund directly from the dashboard. The card number itself doesn't change the refund outcome; the gateway's test rules do. So if you want to test a failed refund, use a card that's configured to decline refunds. If you want a successful refund, use a card that's configured to approve them. Some gateways let you pass a special amount or metadata to control the result.
Test refunds early in your development cycle. Write automated tests that cover success, failure, and edge cases. Use idempotency keys to avoid duplicate refunds. Check that your system handles webhooks correctly, since refunds often arrive asynchronously. Also test partial refunds and multiple refunds on the same charge. Finally, make sure your error messages are clear for customers. A good refund test suite catches bugs before they hit production.
Remember that test cards only work in sandbox mode. Never use them in live mode. They are not real credit cards and cannot be used to buy anything. If you need to test refunds for a real business, always follow your payment processor's guidelines and comply with card network rules.