Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.revtain.com/llms.txt

Use this file to discover all available pages before exploring further.

Use https://api.revtain.com for all development and testing. Test mode is controlled by your gateway type — onboard with a test gateway for sandbox behavior.
Test cards and artificial decline codes are only recognised when your primary gateway is a test gateway. Using them with a live gateway will fail.

Test Cards (Test Gateway Only)

Card NumberBrandTest Gateway ResultLive Gateway
4111 1111 1111 1111VisaAlways succeedsRejected
5555 5555 5555 4444MastercardAlways succeedsRejected
3782 822463 10005AmexAlways succeedsRejected
3530 1113 3330 0000JCBAlways succeedsRejected
Live gateways: Use only real credit card numbers from your actual test merchant accounts (e.g., Stripe Test mode, Braintree Sandbox).

Simulating Failures with Decline Codes

Pass originalDeclineCode values with a test gateway to test how the engine responds to specific decline scenarios.
Decline CodeTest Gateway Behaviour
do_not_honorImmediate retry — 200 with recovery result
insufficient_fundsQueued — 202 Accepted
expired_cardToken refresh queued — 202 Accepted
fraudulentBlocked — 403 Forbidden
gateway_timeoutRecovery retry — 200
Forcing a test failure: Use an amount of exactly 44 cents ("amount": 44). This only works with test gateways to simulate a gateway-level failure.

End-to-End Testing with simulateOutcome

The simulateOutcome parameter lets you test recovery logic, retry handlers, and webhook processing without relying on test gateway limitations.

How It Works

1

Set primary gateway to a Test Gateway

Revtain Test Gateway, Stripe test keys, etc.
2

Send a recovery request with simulateOutcome

Set to success, failed, or blocked.
3

Engine returns the simulated response

The corresponding webhook fires automatically.
4

Simulated transactions are flagged

Recorded with isSimulated: true for easy filtering.

Example Request

{
  "paymentMethodToken": "01KKZ10AD66A3VX260WKM0YFPG",
  "amount": 5000,
  "currency": "USD",
  "originalDeclineCode": "do_not_honor",
  "simulateOutcome": "failed"
}

Use Cases

ScenariosimulateOutcomeResponseWebhook Fired
Test success path + webhook handler"success"200 OK, success: truerecovery.success
Test failed recovery path"failed"200 OK, success: falserecovery.failed
Test blocked transaction handler"blocked"403 Forbiddenrecovery.blocked
  • simulateOutcome only works when your primary gateway is a Test Gateway
  • In production, simulateOutcome is silently ignored
  • All simulated transactions return strategyUsed: "simulated" for easy identification