Step 4: Receive Push Notifications

Push notifications will inform you about important status changes of the Payment Transaction, for instance:

  • accepted payments;

  • received advance payments;

  • payment issues;

  • cancellation.

If such an event occurs, you will receive an HTTP POST request to the configured push URL (s. step 2):

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-03-16T18:21:02+01:00",
  "target": "payment.transactions",
  "type": "changed",
  "data": [
    {
      "object": "payment.transactions",
      "id": "PCI_WHP5N34N5XX5G5NYU07CC54PJ4Q3N8"
    }
  ]
}

Now you would normally retrieve the object to update the data in your system according to the changes:

Request
GET /api/v2/Payment/Transactions/PCI_WHP5N34N5XX5G5NYU07CC54PJ4Q3N8 HTTP/1.1
Host: connect-testing.secupay-ag.de
Authorization: Bearer qb56tjj1bcvo9n2nj4u38k84lo
Accept: application/json
Response
HTTP/1.1 200 OK
Content-Type: application/json
...
 
{
"object": "payment.transactions",
"id": "PCI_WHP5N34N5XX5G5NYU07CC54PJ4Q3N8",
// ...
"trans_id": 33326868,
// ...
"product": "Lastschrift",
// ...
"amount": 5350,
"currency": "EUR",
"created": "2021-03-16T18:20:14+01:00",
"updated": "2021-03-16T18:20:14+01:00",
// ...
"status": 6,
"status_text": "abgeschlossen",
"details": {
"cleared": "open",
"status": 6,
"status_text": "abgeschlossen",
"status_simple": 1,
"status_simple_text": "accepted",
      // ...
},
// ...
}

In our example, the payment has just been accepted.