Testing

Test your integration end to end with test keys, the test checkout page and test cards, without moving real money.

Everything you build can be tested before your account is approved. Use a test secret key (sk_test_…): payments, refunds, payment links and webhooks behave like live mode, but no money moves and every object has "livemode": false. See Test mode and live mode.

The test checkout page

In test mode, checkout_url opens the same Teyra Pay checkout page your customers will see in live mode, marked with a TEST badge and the note "Test mode — no real money moves". The secure card fields are connected to the card processor's test environment, so only test cards work and no real money moves.

What you do on the pageResultCustomer is sent toWebhook
Pay with a test card that succeedsstatus becomes succeeded, paid_at is setreturn_url?payment_id=…&status=succeededpayment.succeeded
Pay with a test card that is declinedstatus becomes failed, with failure_code and failure_messagereturn_url?payment_id=…&status=failedpayment.failed
Click Cancelstatus becomes canceledreturn_url?payment_id=…&status=failedpayment.canceled

A canceled payment returns status=failed in the redirect, because the redirect only carries succeeded, failed or processing. Your server reads the exact status (canceled) from GET /v1/payments/:id.

A failed or canceled payment can still be paid at the same checkout_url until expires_at, so a payment.failed event can be followed by payment.succeeded. See Payments.

This lets you test every branch of your return page and webhook handler in a few minutes.

Test scenarios

Run through these before going live:

ScenarioHow to testExpected
Successful paymentPay with a successful test cardOrder marked paid once, by the return page or the webhook, whichever comes first.
Declined paymentPay with a declined test cardCustomer sees a failure page and can try again.
Canceled paymentClick Cancel on the checkout pageOrder stays unpaid; customer can try again.
Retry after a declineDecline once, then open the same checkout_url and pay with a successful cardpayment.failed, then payment.succeeded; the order ends up paid.
Customer never returnsPay, then close the tab before the redirect finishesThe payment.succeeded webhook still marks the order paid.
Expired paymentCreate a payment with "expires_in_minutes": 5 (the minimum) and waitpayment.expired webhook; checkout shows "This payment has expired".
Forged redirectOpen your return URL with ?payment_id=<a failed payment>&status=succeededOrder is not marked paid.
Duplicate webhookRetry a delivery from Developers → WebhooksOrder is processed only once.
Full and partial refundsRefund a succeeded test paymentamount_refunded updates; refund.succeeded webhook.
Over-refundRefund more than what remains422 refund_exceeds_amount.
Network retrySend the same POST twice with the same Idempotency-KeyOne payment; identical responses, the second with the Idempotent-Replayed: true header.
Three-decimal currencyCreate a KWD payment for 1500Checkout shows 1.500 KWD.
Amount ending in 5Create a KWD payment for 1505On accounts with the three-decimal rule: 422 validation_error with details.fields.amount. Otherwise 201.
Unsupported methodCreate a payment with a payment_method your account doesn't offer, such as knet on a UAE account422 validation_error with details.fields.payment_method = "unsupported".
3-D SecurePay with a test card that asks for authenticationThe challenge opens (in a window on the page or on the bank's page, depending on your account); completing it succeeds, failing it declines.
Apple Pay / Google PayOpen checkout_url on a device with a wallet set upThe wallet option appears; payment_method is apple_pay or google_pay with the wallet card's brand and last4. In test mode no real money moves.

Test cards

Test cards depend on the country of your account. Unless the table says otherwise, use any future expiry date and any 3-digit CVV. Never type real card numbers into the card fields in test mode.

Kuwait accounts

CardNumberExpiryResult
Visa4508 7500 1574 1019Any future dateSuccess, after the 3-D Secure test page
Mastercard5123 4500 0000 000801/39Success, after the 3-D Secure test page
Mastercard5123 4500 0000 000805/39Declined

On the 3-D Secure test page, approve the authentication to complete the payment; reject it to see a declined payment.

KNET, mada and other local methods have their own test credentials. Email support@teyra.co for the ones your account supports.

UAE accounts

CardNumberResult
Visa4242 4242 4242 4242Success
Visa4000 0027 6000 3184Asks for 3-D Secure; approve it to succeed, fail it to decline
Visa4000 0000 0000 0002Declined
Visa4000 0000 0000 9995Declined: insufficient funds

KNET and other local methods can only be tested on accounts that support them. See Payment methods and your account for a checklist.

Test webhooks

  • Use Send test event in Developers → Webhooks to send a signed payment.succeeded event to an endpoint.
  • Every test payment you complete sends real test-mode events to your test-mode endpoints.
  • Check delivery attempts, response codes and retry times in the deliveries list.

See Webhooks.