Step 4: Authorise and Capture for SEPA Direct Debit Payment

We try to authorise the Smart Transaction for SEPA direct debit payment:

Request
POST /api/v2/Smart/Transactions/STX_WHCJCB3SD2NSZZ73E33NP3TJJ4RKA2/prepare/debit HTTP/1.1
Host: testing.secupay-ag.de
Authorization: Bearer qb56tjj1bcvo9n2nj4u38k84lo
Content-Type: application/json
Accept: application/json
 
{
"container": {
  "type": "bank_account",
"private": {
"owner": "Max Mustermann",
"iban": "DE35500105175418493188"
}
}
}

Instead of passing the container details, you can also use an existing Payment Container ID.

If everything is fine, the API responds with 200 OK:

Response
HTTP/1.1 200 OK
Content-Type: application/json
...
 
{
"object": "smart.transactions",
"id": "STX_WHCJCB3SD2NSZZ73E33NP3TJJ4RKA2",
// ...
"container": {
"object": "payment.containers",
"id": "PCT_CUYN3MB372NSZZVDRZ02T5ENZSX5A3"
},
// ...
"transactions": [
{
"object": "payment.transactions",
"id": "PCI_W8BP8E5PD783TDMC44783S4KP8P2N9"
}
],
"created": "2020-10-23T10:18:14+02:00",
"updated": "2020-10-23T10:45:40+02:00",
"status": "ok",
// ...
"intent": "sale",
// ...
"receipt": [
{
"type": "separator",
"value": {
"caption": "Kundenkarte"
}
},
{
"type": "name-value",
"value": {
"name": "Kartennummer:",
"value": "9276004424644352",
"decoration": []
}
},
{
"type": "name-value",
"value": {
"name": "TA Code:",
"value": "29946450",
"decoration": []
}
},
{
"type": "space"
},
{
"type": "textline",
"value": {
"text": "Zahlung über:",
"decoration": []
}
},
{
"type": "textline",
"value": {
"text": "2,20 EUR",
"decoration": [
"important"
]
}
},
{
"type": "space"
},
{
"type": "textline",
"value": {
"text": "Umsatz erfasst:",
"decoration": []
}
},
{
"type": "textline",
"value": {
"text": "7,96 EUR",
"decoration": [
"important"
]
}
},
{
"type": "space"
},
{
"type": "textline",
"value": {
"text": "Bonus:",
"decoration": []
}
},
{
"type": "textline",
"value": {
"text": "0,16 EUR",
"decoration": [
"important"
]
}
},
{
"type": "space"
},
{
"type": "textline",
"value": {
"text": "Aktuelles Guthaben",
"decoration": []
}
},
{
"type": "textline",
"value": {
"text": "0,16 EUR",
"decoration": [
"important"
]
}
}
],
"basket_info": {
"sum": 796,
"currency": "EUR",
"gratuity": null,
"missing_sum": 576
},
"idents": [
{
"object": "smart.idents",
"id": "smi_1",
"prefix": "9276",
"name": "secucard Kundenkarte",
"type": "card",
"value": "9276004424644352",
"valid": true,
"merchantcard": {
"object": "loyalty.merchantcards",
"id": "MCD_2UXQJ84A62MENH7UWH6QXDYJSBNAA9",
"merchant": {
"object": "general.merchants",
"id": "MRC_WVHJQFQ4JNVYNG5B55TYK748ZCHQP8"
},
"created_for_merchant": {
"object": "general.merchants",
"id": "MRC_F40KSJYW5AAJHHC93TQ6C7A8X76WO6"
},
"card": {
"object": "loyalty.cards",
"id": "CRD_22H4H5D47Q44URN2K8KTP876H6M3PM",
"cardnumber": "9276004424644352",
"created": "2015-02-20T08:51:46+01:00"
},
"cardgroup": {
"object": "loyalty.cardgroups",
"id": "CRG_4VA6040D2DWRYHJKCWXZEW24654PRH",
"display_name": "Bonus",
"display_name_raw": "Bonus",
"stock_warn_limit": 0,
"picture": "https://connect.secucard.com/ds_g/8e79737df1e2513db48908b342c3cc436edf501a"
},
"created_for_store": {
"object": "general.stores",
"id": "STO_3522R8MS2MSHCN7D37UVJYR4P6C4PX"
},
"is_base_card": false,
"points": 0,
"cash_balance": 0,
"bonus_balance": 16,
"balance": 16,
"last_usage": "2020-10-23T10:48:06+02:00",
"last_charge": "2020-10-23T10:48:06+02:00",
"stock_status": "active",
"lock_status": "unlocked",
"passcode": 1,
"expiry_date": null
}
}
],
"payment_method": "debit",
"trans_id": "29946449",
"is_demo": true,
// ...
}

Because we have used auto_capture, the payment is already captured. The Smart Transaction has status ok in our case, and you can deliver.