Authorise for Direct Debit Payment

In order to authorise the Smart Transaction for direct debit payment, you need to call POST Smart/Transactions/STX_xxx/prepare/debit and pass the Payment Container.

Request
POST /api/v2/Smart/Transactions/STX_33PXAW2YN2NJTPM5KPGMK7QF5PBVA2/prepare/debit HTTP/1.1
Host: connect-testing.secupay-ag.de
Authorization: Bearer qb56tjj1bcvo9n2nj4u38k84lo
Content-Type: application/json
Accept: application/json
 
{
"container": {
"type": "bank_account",
"private": {
"owner": "John Doe",
"iban": "DE12500105170648489890",
"bic": "ABCDDE12XXX"
}
 }
}

If not passed before, you can pass the customer a last time.

If everything is fine, the API responds with HTTP status 200 OK, and the Smart Transaction changes its status:

Response
HTTP/1.1 200 OK
Content-Type: application/json
...
{
"object": "smart.transactions",
"id": "STX_33PXAW2YN2NJTPM5KPGMK7QF5PBVA2",
// ...
"container": {
"object": "payment.containers",
"id": "PCT_J0KNRWG67AV66AHKXRF2BU82N90ZES"
},
"transactions": [
{
"object": "payment.transactions",
"id": "PCI_FDBREW9ZS7P6FTN4ZY2ATC6NK0QWO7"
}
],
"created": "2020-03-27T10:55:23+01:00",
"updated": "2020-03-27T10:56:10+01:00",
  "status": "approved",
// ...
}

As you see there is a new status, a Payment Container and a Payment Transaction. Status approved means the payment is authorised and you should be able to capture it. Status failed means you must repeat the payment process. You must also repeat the payment process when you update the Smart Transaction. It is then set back to created.

If auto_capture is enabled, the Smart Transaction is automatically captured immediately after sccuessful authorisation. Status ok, received or collection means you can deliver. Status pending means you have to wait for one of these statusses. Status failed means the payment failed, and you must repeat the payment process.