Gift card testing
Use this page to plan gift card tests on staging. For the test cards, amounts and the full payment walkthrough, see Testing payments on staging: full walkthrough. That page is the single source for those details.
Two funding models
Model | Endpoint | Payment |
Hosted payment |
| The customer pays on a hosted payment page. Spendstream then issues the card. |
Float |
| The card is issued directly against your prepaid balance. Use |
checkPBalance may be permission gated for your account. Ask Spendstream if it is not available.
Key test data
Item | Value |
Successful Visa |
|
Successful Mastercard |
|
Expiry and CVV | Any future expiry, CVV |
Declined amount |
|
Bank error amount |
|
Safe amount |
|
American Express | Not supported |
Sandbox confirmation
Staging is sandboxed end to end. The payment URL contains a test_ site reference, and the returned voucher link points at a sandbox. host. No real money or float is used, and sandbox vouchers cannot be redeemed.
⚠️ Warning: In production both the payment and the voucher are real, and the voucher cost is deducted from your float.
Test scenarios
Scenario | How to test | Expected result |
Successful order | Pay with a test card for | Card issued, |
Failed payment | Use amount | No card issued. Your app shows a clear failure message. |
Bank error | Use amount | No card issued. Your app handles the error state. |
Invalid promotion | Send a | Error reply. Use the |
Brand unavailable | Choose a promotion whose brand is not active in | Do not offer it. Confirm your catalogue filters inactive brands. |
Invalid value | Send an amount outside the promotion’s allowed range. | Error reply. Validate amounts before calling. |
Unknown user | Send a | The user is created with blank details, so validate |
Duplicate submission | Submit the same purchase twice. | See the warning below. |
Insufficient float | Float model only. Request more than your balance. | Error reply. Your app handles it and alerts your team. |
⚠️ Warning: Gift card API requests have no server-side idempotency. Prevent duplicate submissions in your own code, for example by disabling the buy button and keeping an order record. Avoid refreshing the payment success page: a repeat visit to a paid order is rejected, but a narrow timing overlap is still being hardened.
Checks on every reply
- Read the
responsefield in the body, because HTTP200does not mean success. - Store the
order-idand the returned voucher fields. - Confirm the balance effect described in
giftCardBalanceCheckfor the card you issued.
Checklist
- [ ] Successful Visa and Mastercard purchases complete.
- [ ] Amount
700.00is handled as a decline. - [ ] Amount
600.10is handled as a bank error. - [ ]
promo_idis taken frompromotion-id, never frombrand-id. - [ ] Inactive brands are not offered.
- [ ]
user_idis validated beforepaymentLinkis called. - [ ] Duplicate submissions are blocked in my code.
- [ ] I avoid refreshing the success page.
- [ ] I store the
order-idand voucher details. - [ ] Float model only: insufficient balance is handled.
On this page
- Gift card testing