Step 3: Check the Status

We recommend to check the status of the Payment Transaction, after the customer was directed back to your success URL.

The API endpoint to obtain the status of a direct debit transaction is GET /api/v2/Payment/Secupaydebits/{id}:

Request
GET /api/v2/Payment/Secupaydebits/xoevuoacybse5221103 HTTP/1.1
Host: connect-testing.secupay-ag.de
Authorization: Bearer qb56tjj1bcvo9n2nj4u38k84lo
Accept: application/json

If everything is fine, the API responds with 200 OK and the representation of the Payment Transaction:

Response
HTTP/1.1 200 OK
Content-Type: application/json
...
 
{
"object": "payment.secupaydebits",
"id": "xoevuoacybse5221103",
"trans_id": 33922083,
"payment_id": "PCI_47RJ95TKJGCTZ0W2CBKMKE4PP484N3",
"status": "accepted",
"amount": 2495,
"currency": "EUR",
"purpose": "",
"order_id": null,
"transaction_status": 11,
"basket": null,
"accrual": false,
"payment_action": "sale",
"customer": {
"object": "payment.customers",
"id": "PCU_W7B3GGUDH2X3GH3YJ37YQ82Z03JFAZ",
"merchant": {
"object": "general.merchants",
"id": "MRC_WVHJQFQ4JNVYNG5B55TYK748ZCHQP8"
},
"contact": {
"forename": "Grover",
"surname": "Mustermann",
"name": "Grover Mustermann",
"address": {
"street": "Koelpinstr.",
"street_number": "604",
"postal_code": "09999",
"city": "Musterstadt",
"country": "DE"
},
"email": "SAS187@example.net"
},
"created": "2021-04-09T19:03:39+02:00"
},
"redirect_url": {
"iframe_url": "https:\/\/api-dev6.secupay-ag.de\/payment\/xoevuoacybse5221103",
"url_success": "https:\/\/shop.example.com\/checkout\/payment\/success",
"url_failure": "https:\/\/shop.example.com\/checkout\/payment\/failure",
"url_push": "https:\/\/shop.example.com\/order\/payment\/update"
},
"iframe_url": "https:\/\/api-dev6.secupay-ag.de\/payment\/xoevuoacybse5221103",
"used_payment_instrument": {
"type": "bank_account",
"data": {
"owner": "",
"iban": "DE02 XXXX XXXX 6808",
"bic": "PBNKDEFFXXX",
"bankname": "Postbank Ndl der Deutsche Bank"
}
},
"mandate": {
"identification": "OPI\/xoevuoacybse5221103",
"creditor_id": "DE17ZZZ00000011109"
}
}

Since the status is 11, accepted, we know everything is fine. The statusses are explained in the Reference part.

Note: You also need to respond to later status changes, signalised by the callback API. A payment can also fail after it was already accepted.