Push Notifications for Payments

Prerequisites

Before you read this, you should understand this:

Set a Push URL

If you want to receive status updates, you can pass a push URL to the Smart Transaction:

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.

Callback Request
POST /order/payment/status-push?order=OID_100716
Host: shop.example.com
Content-Type: application/json
Accept: */*
...
 
{
"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"
}
]
}

The message is sent repeatedly until your system responds with 200 OK. After 24 hours without such acknowledgement, our system discards the notification for this event.

These are the details of the notification:

Field

Type

Meaning

object

string

Object type (always "event.pushes")

id

string

Object ID of the push event

created

string

Time of the event

target

string

Object type:

  • payment.transactions: Payment Transaction

  • payment.subscriptions: Subscription

type

string

Event type:

  • changed: The object has changed

  • added: The object has been added

data

array

Related data objects. There should be only one object /data/0.

Every related object (data) has these fields:

Field

Type

Meaning

object

string

Object type; same as target (see above)

id

string

Object ID

Now you would read the related data object.

Push Events for Payments

For payments you receive a push notification for important status changes:

Event

"target"

"type"

Payment status changed (s. Read a Payment Transaction)

"payment.transactions"

"changed"

The Payment Transaction is already known from the authorised or captured Smart Transaction.