Statuses
Every payment status, which changes are possible, and the event each one sends.
A payment always has one status:
| Status | Meaning | Final? |
|---|---|---|
pending |
Created, waiting for the customer to pay. | No |
paid |
The provider confirmed the payment. Deliver the order. | No, it can be refunded |
failed |
The card was declined or the provider rejected the payment. | Yes, unless Alphabet set it by hand |
cancelled |
The customer, your server or Alphabet cancelled it before it was paid. | Almost, see below |
expired |
Nobody paid before expires_at. |
Yes, unless Alphabet set it by hand |
partially_refunded |
Paid, and part of the amount has been refunded. | No |
refunded |
Paid, and the whole amount has been refunded. | Yes |
Possible changes
| From | To | Event |
|---|---|---|
pending |
paid |
payment.paid |
pending |
failed |
payment.failed |
pending |
cancelled |
payment.cancelled |
pending |
expired |
payment.expired |
paid |
partially_refunded |
payment.partially_refunded |
paid |
refunded |
payment.refunded |
partially_refunded |
partially_refunded (another partial refund) |
payment.partially_refunded |
partially_refunded |
refunded |
payment.refunded |
cancelled, or failed/expired set by Alphabet by hand (until the original expires_at) |
paid |
payment.paid |
Every change sends exactly one webhook. See Webhooks.
Paid after it was closed
The provider's card page cannot be closed from outside, so a customer can still pay a payment the
bridge has already closed. That covers a payment cancelled through the API and one Alphabet set
to failed or expired by hand. The bridge keeps checking such a payment until its original
expires_at. If the provider reports it paid, it becomes paid and you receive payment.paid.
The money has been taken, so your application must then deliver the order or refund the payment. Alphabet sees these payments flagged for review.
Payments that the provider itself declined or expired are final.
Amounts and refunds
refunded_amount is the total of every confirmed refund, in whole IQD. The amount still
refundable is amount − refunded_amount. A live refund that has only been requested does not
change the status or refunded_amount; see Refunds.
Expiry
An unpaid payment expires 30 minutes after creation by default; Alphabet can set a different time
per application. expires_at on the payment is the exact time. The bridge checks pending payments
with the provider about once a minute, so the expired status and its webhook can come up to a
few minutes after expires_at.