Appearance
Transaction States
All transaction types share the same state codes.
State Reference
| State | Final | Description |
|---|---|---|
-1 | No | New transaction, not confirmed |
0 | No | Pending (processing) |
1 | Yes | Successful |
2 | Yes | Failed |
3 | Yes | Cancelled |
4 | Yes | Replaced (manual action by support) |
6 | No | Paused (contact support) |
Final vs Non-Final States
Final States
When you receive a final state, the transaction is complete:
- State 1 (Success) — Transaction completed successfully
- State 2 (Failed) — Transaction failed, check
errorfield for details - State 3 (Cancelled) — Transaction was cancelled
- State 4 (Replaced) — Transaction was manually replaced by support
Non-Final States
When you receive a non-final state, you must keep polling /transaction/find:
- State -1 (New) — Transaction reserved but not confirmed yet
- State 0 (Pending) — Transaction is being processed
- State 6 (Paused) — Transaction paused due to security reasons
Handling States
Best Practices
Always poll for final state — Never assume a transaction is complete until you receive state
1,2,3, or4.Handle pending states — If Confirm returns state
0or6, immediately start polling Find.Use exponential backoff — Start with 5-second intervals, increase to 60 seconds for long-pending transactions.
Set timeouts — Don't poll indefinitely. Set a reasonable timeout (e.g., 1 hour) and contact support if exceeded.
Log everything — Keep detailed logs of all responses for troubleshooting.
State Flow Diagram
Error Handling by State
| State | Action |
|---|---|
-1 | Call Confirm to proceed |
0 | Poll Find until final state |
1 | Success — display receipt to customer |
2 | Failed — show transaction.error message |
3 | Cancelled — inform customer |
4 | Replaced — contact support for details |
6 | Poll Find, contact support if persists |