Transaction Status
Understand the lifecycle of a transaction.
Status values
Section titled “Status values”| Status | Description |
|---|---|
pending |
Charge initiated, awaiting customer action |
processing |
Customer authorized, transaction being processed |
succeeded |
Payment completed successfully |
failed |
Payment failed (see failure_reason) |
declined |
Customer declined or cancelled the payment |
expired |
Charge expired before completion |
refunded |
Charge was fully refunded |
partially_refunded |
Charge was partially refunded |
Status flow
Section titled “Status flow”pending → processing → succeeded ↓ ↓ failed declined ↓ expiredPolling for status
Section titled “Polling for status”For server-side integrations, poll the charge endpoint until a terminal state is reached:
async function waitForCompletion(chargeId) { while (true) { const charge = await malipo.charges.retrieve(chargeId); if (["succeeded", "failed", "declined", "expired"].includes(charge.status)) { return charge; } await new Promise(r => setTimeout(r, 2000)); // 2s delay }}