Test data
How to get the payment outcome you need in the test environment, from success and decline to an unknown outcome and an amount mismatch.
In the test environment a mock provider processes the payment, with no money and no network. A label in metadata.sandbox sets the outcome when the payment is created, and each scenario can be repeated as many times as you like.
{ "metadata": { "sandbox": "timeout_paid" } }- Without a label, the payment waits for the payer and is paid at the first check.
- An unknown label is not the same as no label: the payment immediately gets
FAILEDwith the reasontechnical_failure. This way a typo in the label never silently tests the wrong scenario. - We check the outcome for the first time about 30 seconds after creation, or about 2 seconds after creation in scenarios where the provider does not answer.
- The mock provider has no payment page: the address in
action.urlpoints to the non-existent.invalidzone. - Labels have no effect in the live environment.
- Customer blocks and routing rules apply in the test environment too and act before the label: a payment with any label may get
REJECTEDorFAILEDwithout an attempt. No label producesREJECTED.
Scenarios
"Under review" means inReview: true: such a payment is not credited.
The "After the check" column holds when the first check comes before the payment deadline expiresAt. If the deadline comes first, the payment is closed by the deadline: declined_later ends as EXPIRED, while pending, unknown_status and wrong_currency end as EXPIRED under review.
| Label | After creation | After the check | What it tests |
|---|---|---|---|
no label or pay_on_inquiry | AWAITING_CUSTOMER | SUCCEEDED | A regular payment: the redirect by action and crediting. |
paid | SUCCEEDED | Crediting from the creation response. | |
provider_paid | PROCESSING | SUCCEEDED | The provider accepted and confirmed later. |
pending | AWAITING_CUSTOMER | AWAITING_CUSTOMER | The payer does not pay: by the deadline EXPIRED under review. |
abandoned | AWAITING_CUSTOMER | EXPIRED | The payer cancelled the payment at the provider. |
declined | FAILED | A bank decline, reason declined_by_bank. | |
declined_later | AWAITING_CUSTOMER | FAILED | A decline after waiting for the payer. |
rejected | FAILED | The provider did not accept the request. | |
rate_limited | FAILED | The provider answered "too many requests". | |
not_sent | FAILED | The request did not reach the provider. | |
not_sent_final | FAILED | The request could not be built. | |
cascade_paid | SUCCEEDED | The first provider did not accept, the next one paid. | |
timeout_paid | PROCESSING, under review | SUCCEEDED | No answer, but the money went through: a timeout is not a decline. |
timeout_declined | PROCESSING, under review | FAILED | No answer, then a decline. |
timeout_abandoned | PROCESSING, under review | EXPIRED | No answer, the payer did not pay. |
timeout_unknown | PROCESSING, under review | PROCESSING, under review | The outcome is never learned: the payment waits for a person. |
unparsed | PROCESSING, under review | SUCCEEDED | The provider's answer was not understood; the money went through. |
unknown_status | AWAITING_CUSTOMER | PROCESSING, under review | The provider named a status we do not know. |
underpaid | AWAITING_CUSTOMER | PARTIALLY_PAID, under review | Underpayment: do not credit. |
overpaid | AWAITING_CUSTOMER | OVERPAID, under review | Overpayment: do not credit. |
wrong_currency | AWAITING_CUSTOMER | AWAITING_CUSTOMER, under review | Money in another currency: do not credit. |