Prerequisites
Before you read this, you should understand this:
What Is a Push Notification?
Our secuconnect API can send host-to-host push notifications to inform you about new transactions or important changes. There are also push notifications for more elaborate use cases like subscriptions, or activation of contracted merchants (marketplaces) or projects (crowd platforms).
Push notifications are sent for Payment Transactions whenever the simple status has changed, or when a subscription payment or a refund transaction have been created.
Set a Push URL
If you want to receive status updates, you can pass a push URL to the Smart Transaction:
{ // ... "application_context": { "return_urls": { "url_push": "https://shop.example.org/PUSH?order=12345" } }}The push URL is forwarded to objects created during the life cycle of the Smart Transaction.
Process a Push Notification
Our system sends an HTTP POST request to the push URL. The JSON body contains information about the object and the event it was generated for.
POST /order/payment/status-push?order=OID_100716 HTTP/1.1Host: shop.example.comContent-Type: application/jsonAccept: */*{ "object": "event.pushes", "id": "evt_d7a9cbd91c125ae409398b4e0e3199be", "created": "2021-06-21T08:30:28+02:00", "target": "payment.transactions", "type": "changed", "data": [ { "object": "payment.transactions", "id": "PCI_2FY48DT0P2X6G636N5QK64UK2ADZAZ" } ]}These are the details of the notification:
Field | Type | Meaning |
|---|---|---|
|
| Object type (always |
|
| Object ID of the push event |
|
| Time of the event |
|
| Object type:
|
|
| Event type:
|
|
| Related data objects. There should be only one object |
Every related object (data) has these fields:
Field | Type | Meaning |
|---|---|---|
|
| Object type; same as |
|
| Object ID |
Now you might read the related data object, or perhaps related ones, and process the outcome. Finally you would signalise our push service whether your system could process the push notification successfully or not.
The message is sent repeatedly until your system responds with 200 OK or another 2xx status code. After 24 hours without such acknowledgement, our system discards the notification for this event. You can also provide a short response body in any format for help us with troubleshooting.
Push Events for Payments
For payments you receive a push notification for important status changes:
Event |
|
|
|---|---|---|
Payment status changed (s. Read a Payment Transaction) |
|
|
The Payment Transaction is already known from the authorised or captured Smart Transaction.
Check the Status and Amount of the Payment
For concerns of security and simplicity, you should not regard the Payment Transaction ID in the push event as definitive. The Payment Transaction ID could be the original ID, associated with a refund, a mixed-basket or stakeholder payment relating to the same transaction. But it could also be completely forged.
Although it is unlikely that anyone would obtain both the URL and one of your IDs, you should only work with the Payment Transaction ID that you found in the Smart Transaction after the payment has been authorised.
Using the original Payment Transaction ID also simplifies your implementation, since it is much easier to consider refunds based on the remaining amount returned by `checkStatus`, provided these do not need to be recorded individually.
The API endpoint to obtain the current status and the effective amount is GET /api/v2/Payment/Transactions/{id}/checkStatus.
GET /api/v2/Payment/Transactions/PCI_AEVDQO42JC3YHO4PSAZ3CQJU4S0P5A/checkStatus HTTP/1.1Host: connect-testing.secuconnect.comAuthorization: Bearer qb56tjj1bcvo9n2nj4u38k84loThe request needs no body.
If everything is fine, the API responds with 200 OK and these details:
HTTP/1.1 200 OKContent-Type: application/json{ "status": 9, "status_text": "vorautorisiert", "status_simple": 2, "status_simple_text": "authorized", "amount": 8600, "currency": "EUR"}The fields are:
Field | Type | Meaning |
|---|---|---|
|
| Status ID |
|
| Status text (translated) |
|
| Simple status ID:
|
|
| Simple status text (English) |
|
| Effective amount of the transaction including refunds. Like all monetary amounts, it is rendered in the smallest currency unit, e. g. Euro Cents. Zero (0), when the transaction has been completely cancelled. Otherwise the current transaction amount minus all promising or completed refund transactions. A more complex example:
|
|
| ISO 4217 currency code such as |