Skip to content

Commit 8713163

Browse files
authored
Update one-off-payments.md
added info on callbacks
1 parent 0089a22 commit 8713163

File tree

1 file changed

+25
-22
lines changed

1 file changed

+25
-22
lines changed

docs/subscriptions/one-off-payments.md

+25-22
Original file line numberDiff line numberDiff line change
@@ -169,28 +169,31 @@ Once the one-off payment status changes from *Requested* to *Reserved*, *Rejecte
169169
|Expired |_1. One-off payment was neither accepted, nor rejected by user. 2. User didn't any action after the automatic reservation failed._| 1 day after you requested one-off payment |Expired|Expired by the system.| 50008 |
170170
|Requested |_The automatic reservation of a one-off payment failed. User action is needed._| Right after the automatic reservation has failed |Requested|Automatic reservation failed. User action is needed.| 50013 |
171171

172-
### Callbacks about one-off and Agreement
173-
174-
You will get callbacks about the payment to your callback address. Moreover, you will get callbacks about the agreement to either success or failure URL, that you have set upon agreement creation. However, unless a one-off payment automatic reservation fails, you will not get callbacks for either, before their status changes. So you should expect a callback when the agreement is *accepted* / *rejected* / *expired* and a callback when the OneOff is either `accepted`/`rejected`/`expired`. If the one-off payment's automatic reservation fails, then the status of the one-off payment will not change, but a callback about the event will be sent.
175-
176-
The response for agreement creation, on the other hand, consists of both agreement and OneOff.
177-
178-
```json title="One-off callback body example"
179-
[
180-
{
181-
"agreement_id": "8380f9e4-10a6-4f6d-b2f4-cdb7f80a4d7f",
182-
"payment_id": "022a08d8-73c6-4393-aeda-d0c8ae5172a5",
183-
"amount": "19.45",
184-
"currency": "DKK",
185-
"payment_date": "2019-09-18",
186-
"status": "Reserved",
187-
"status_text": "Payment successfully reserved.",
188-
"status_code": 0,
189-
"external_id": "3280100",
190-
"payment_type": "OneOff"
191-
}
192-
]
193-
```
172+
### One-off payment sent with an agreement:
173+
174+
175+
| Status | Status code | Status text | Callback sending condition
176+
|---------------|------------------|-----------------------------------------------------------|------------------------------
177+
| Cancelled | 70003 | Payment cancelled. | Pending agreement with one-off payment has expired
178+
| | | | Pending agreement with one-off payment was rejected by user
179+
| | | | Merchant cancels pending agreement with one-off payment
180+
| | | | Merchant cancels active agreement and one-off payment is Reserved
181+
| | | | Merchant cancells Reserved one-off payment
182+
| | | |
183+
| Reserved | 0 | Payment successfully reserved. | Agreement with one-off payment was accepted and payment was reserved
184+
185+
### Autoreserve one-off payment:
186+
187+
| Status | Status code | Status text | Callback sending condition
188+
|---------------|------------------|-----------------------------------------------------------|------------------------------
189+
| Cancelled | 70003 | Payment cancelled. | Merchant cancells autoreserve one-off payment in Requested or Reserved status
190+
| | | | Merchant cancels active agreement and one-off payment is Reserved or Requested
191+
| | | | Payment expires
192+
| | | |
193+
| Reserved | 0 | Payment successfully reserved. | Payment reserved
194+
| Requested | 50013 | Automatic reservation failed. User action is needed. | Reservation failed
195+
196+
Reservation failure and expiration callbacks are sent only after payment expiration with few seconds delay between each other.
194197

195198
## User notifications
196199

0 commit comments

Comments
 (0)