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 FAILED with the reason technical_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.url points to the non-existent .invalid zone.
  • 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 REJECTED or FAILED without an attempt. No label produces REJECTED.

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.

LabelAfter creationAfter the checkWhat it tests
no label or pay_on_inquiryAWAITING_CUSTOMERSUCCEEDEDA regular payment: the redirect by action and crediting.
paidSUCCEEDEDCrediting from the creation response.
provider_paidPROCESSINGSUCCEEDEDThe provider accepted and confirmed later.
pendingAWAITING_CUSTOMERAWAITING_CUSTOMERThe payer does not pay: by the deadline EXPIRED under review.
abandonedAWAITING_CUSTOMEREXPIREDThe payer cancelled the payment at the provider.
declinedFAILEDA bank decline, reason declined_by_bank.
declined_laterAWAITING_CUSTOMERFAILEDA decline after waiting for the payer.
rejectedFAILEDThe provider did not accept the request.
rate_limitedFAILEDThe provider answered "too many requests".
not_sentFAILEDThe request did not reach the provider.
not_sent_finalFAILEDThe request could not be built.
cascade_paidSUCCEEDEDThe first provider did not accept, the next one paid.
timeout_paidPROCESSING, under reviewSUCCEEDEDNo answer, but the money went through: a timeout is not a decline.
timeout_declinedPROCESSING, under reviewFAILEDNo answer, then a decline.
timeout_abandonedPROCESSING, under reviewEXPIREDNo answer, the payer did not pay.
timeout_unknownPROCESSING, under reviewPROCESSING, under reviewThe outcome is never learned: the payment waits for a person.
unparsedPROCESSING, under reviewSUCCEEDEDThe provider's answer was not understood; the money went through.
unknown_statusAWAITING_CUSTOMERPROCESSING, under reviewThe provider named a status we do not know.
underpaidAWAITING_CUSTOMERPARTIALLY_PAID, under reviewUnderpayment: do not credit.
overpaidAWAITING_CUSTOMEROVERPAID, under reviewOverpayment: do not credit.
wrong_currencyAWAITING_CUSTOMERAWAITING_CUSTOMER, under reviewMoney in another currency: do not credit.