Ir al contenido

Settle, reject or return a test payment

POST/test-helpers/payments/{id}/resolveProbar
Parámetros de ruta

La llamada la hace tu navegador, contra el servidor que elijas arriba. Si la documentación no está servida desde el mismo origen que la API, el navegador puede bloquear la respuesta por CORS: en ese caso abre estas páginas desde la propia API (/docs) o usa el curl de arriba.

POST
/test-helpers/payments/{id}/resolve
curl --request POST \
--url http://localhost:3000/v1/test-helpers/payments/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/resolve \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '{ "outcome": "settled", "reason": "example" }'

Scope payments:write; without it, 403 insufficient_scope. Otherwise, the same conditions as /test-helpers/seed. Only for a payment of YOURS that went through the simulated bank: it arrives as in production (signed event to ingestion) and fires the outcome webhook.

  • settled: settles a submitted or unknown payment (payment.settled). With an own account, a payment without a scenario settles on its own in about 20 s: no need to resolve it.
  • failed: the network rejects a payment it had in progress (submitted or unknown); it is reverted (payment.failed). Returns 409 if the network already paid it (scenario TEST:TIMEOUT_AFTER_SUBMIT).
  • returned: returns a settled payment; it ends reversed (payment.reversed), fully reverted, fee included.

To reach submitted or unknown, use the reference of POST /payouts (TEST:SUBMITTED, TEST:UNKNOWN, TEST:TIMEOUT_AFTER_SUBMIT).

id
required
string format: uuid
Media typeapplication/json
object
outcome
required
string
Allowed values: settled failed returned
reason

Opcional, para failed o returned (3 a 120 caracteres)

string

El pago con su estado nuevo

Media typeapplication/json
object
paymentId
string format: uuid
outcome
string
Allowed values: settled failed returned
status
string
Example
{
"outcome": "settled"
}

test_account_required (la key no es sk_test_ de una cuenta de pruebas) o insufficient_scope (la key no tiene payments:write)

El pago no existe (o es de otra cuenta), o la ruta no existe en este entorno

El pago no salió por el banco simulado, su estado no admite ese resultado, o (con failed) la red ya lo pagó