Manage Direct Debit Secured payment
Manage Direct Debit Secured payments for your customers.
If you are using payment type sepa-direct-debit-secured
, note that this method is now deprecated. It is currently supported but there are no further developments planned for them.
If you want to access the relevant documentation, see (Deprecated) Unzer Direct Debit Secured.
After the successful authorize
transaction, you must perform additional operations on the payment resource. Some of the important ones are described in the following section.
For a full reference of managing payments, go to relevant server-side integration documentation page: Manage API resources (direct API calls), Manage API resources (PHP SDK), or Manage API resources (Java SDK).
Full charge
Making a charge
transaction signals you are shipping goods to your customer while capturing the respective order amount.
The charge call is a crucial API call that initiates the process for payout of the charged amount to the merchant and the deduction of the money from the customer’s bank account.
POST: https://api.unzer.com/v1/payments/s-pay-1/charges
{
}
$unzer = new Unzer('s-priv-xxxxxxxxxx');
$chargeInstance = new Charge();
$chargeTransaction = $unzer->performChargeOnPayment('s-pay-1', $chargeInstance);
Unzer unzer = new Unzer("s-priv-xxxxxxxxxx");
Charge charge = unzer.chargeAuthorization("s-pay-1");
The response looks similar to the following example:
{
"id": "s-chg-1",
"isSuccess": true,
"isPending": false,
"isResumed": false,
"isError": false,
"card3ds": false,
"message": {
"code": "COR.000.000.000",
"merchant": "Transaction succeeded",
"customer": "Your payments have been successfully processed."
},
"amount": "100.0000",
"currency": "EUR",
"date": "2023-09-19 14:40:35",
"resources": {
"customerId": "s-cst-16b2a47d5102",
"paymentId": "s-pay-11",
"basketId": "s-bsk-77db7cd504c3",
"metadataId": "",
"payPageId": "",
"traceId": "ab11a5121cc793b1144820e36a990ed7",
"typeId": "s-pdd-rnnb0vxjlguy"
},
"additionalTransactionData": {
"riskData": {
"threatMetrixId": "f544if49wo4f74ef1x",
"customerGroup": "TOP",
"customerId": "C-122345",
"confirmedAmount": "2569",
"confirmedOrders": "14",
"internalScore": "95",
"registrationLevel": "1",
"registrationDate": "20160412"
},
"shipping": {
"deliveryTrackingId": "0034043423434443222",
"deliveryService": "DHL"
}
},
"orderId": "order-1695134426065-594",
"paymentReference": "",
"processing": {
"uniqueId": "Tx-5i4bd8qxb3t",
"shortId": "Tx-5i4bd8qxb3t",
"descriptor": "MRGB-ZQZQ-MDTP",
"traceId": "ab11a5121cc793b1144820e36a990ed7"
}
}
Provide shipping information
To allow Unzer to track the customer’s order, you can provide shipping information in your charges
request. Based on the information provided, the customer’s payment period will only start when the order has reached your customer.
Shipping information can be provided in the following fields:
Parameter | Type | Description |
---|---|---|
deliveryTrackingId (optional) |
string | Tracking ID of the selected delivery service provider for the delivery to the customer. |
deliveryService (optional) |
string | Delivery service provider used for ship the goods to your customer (such as, DHL, UPS, and Hermes) |
POST: https://api.unzer.com/v1/payments/s-pay-1/charges
{
"amount": "100",
"additionalTransactionData": {
"shipping": {
"deliveryTrackingId": "0034043423434443222",
"deliveryService": "DHL"
}
}
}
$unzer = new Unzer('s-priv-xxxxxxxxxx');
$shipping = (new ShippingData())
->setDeliveryTrackingId('0034043423434443222')
->setReturnTrackingId('00123434286851877897')
->setDeliveryService('DHL');
$chargeInstance = new Charge();
$chargeInstance->setShipping($shipping);
$chargeTransaction = $unzer->performChargeOnPayment('s-pay-1', $chargeInstance);
Partial charge
If you ship an order in multiple steps, you can make make a partial charge for each part you want to ship.
The charge call is a crucial API call that initiates the process for payout of the charged amount to the merchant and the deduction of the money from the customer’s bank account.
POST: https://api.unzer.com/v1/payments/s-pay-1/charges
{
"amount" : "50",
}
The response looks similar to the following example:
{
"id": "s-chg-1",
"isSuccess": true,
"isPending": false,
"isResumed": false,
"isError": false,
"card3ds": false,
"message": {
"code": "COR.000.000.000",
"merchant": "Transaction succeeded",
"customer": "Your payments have been successfully processed."
},
"amount": "50.0000",
"currency": "EUR",
"date": "2023-09-19 14:56:28",
"resources": {
"customerId": "s-cst-95cbe13f774c",
"paymentId": "s-pay-13",
"basketId": "s-bsk-dd7818ed3e8a",
"metadataId": "",
"payPageId": "",
"traceId": "f1402497b04038a9d053ae67f0b17921",
"typeId": "s-pdd-pr4yb9bp2g5g"
},
"additionalTransactionData": {
"riskData": {
"threatMetrixId": "f544if49wo4f74ef1x",
"customerGroup": "TOP",
"customerId": "C-122345",
"confirmedAmount": "2569",
"confirmedOrders": "14",
"internalScore": "95",
"registrationLevel": "1",
"registrationDate": "20160412"
},
"shipping": {
"deliveryTrackingId": "0034043423434443222",
"deliveryService": "DHL"
}
},
"orderId": "order-1695135378369-314",
"paymentReference": "",
"processing": {
"uniqueId": "Tx-q8zuuk2ndw6",
"shortId": "Tx-q8zuuk2ndw6",
"descriptor": "ZMRD-QZWK-BDHK",
"traceId": "f1402497b04038a9d053ae67f0b17921"
}
}
You should also provide the shipping information as previously explained in the full charge section.
Cancel before charge (reversal)
If the customer cancels an order completely before you ship the goods or if the goods are not available in stock, you must cancel the order by initializing a reversal.
charge
the remaining items as soon as you ship it.
POST: https://api.unzer.com/v1/payments/s-cnl-1/authorize/cancels
{
}
$unzer = new Unzer('s-priv-xxxxxxxxxx');
$cancel = $unzer->cancelAuthorizedPayment('s-pay-101');
The response looks similar to the following example:
{
"id": "s-cnl-1",
"isSuccess": true,
"isPending": false,
"isResumed": false,
"isError": false,
"card3ds": false,
"message": {
"code": "COR.000.000.000",
"merchant": "Transaction succeeded",
"customer": "Your payments have been successfully processed."
},
"amount": "100.0000",
"currency": "EUR",
"date": "2023-09-19 15:00:30",
"resources": {
"customerId": "s-cst-501a05f7a25f",
"paymentId": "s-pay-541",
"basketId": "s-bsk-5aa634d40cf4",
"metadataId": "",
"payPageId": "",
"traceId": "ccb7deffbd8c178336fdbf59d5f282d8",
"typeId": "s-pdd-yk4xngpkk2eu"
},
"orderId": "order-1695135606256-575",
"paymentReference": "",
"processing": {
"uniqueId": "Tx-qx672atk952",
"shortId": "Tx-qx672atk952",
"traceId": "ccb7deffbd8c178336fdbf59d5f282d8"
}
}
Cancel after charge (refund)
In case you already charged a payment for an order that the customer wants to cancel/return, you can refund it up to the charged amount. To do this you have to make a cancels
transaction on the respective paymentId
.
POST: https://api.unzer.com/v1/payments/s-cnl-1/charges/cancels
{
"amount" : "100.00"
}
The response looks similar to the following example:
{
"id": "s-cnl-1",
"isSuccess": true,
"isPending": false,
"isResumed": false,
"isError": false,
"card3ds": false,
"message": {
"code": "COR.000.000.000",
"merchant": "Transaction succeeded",
"customer": "Your payments have been successfully processed."
},
"amount": "100.0000",
"currency": "EUR",
"date": "2023-09-19 15:16:11",
"resources": {
"customerId": "s-cst-e16d996021e6",
"paymentId": "s-pay-16",
"basketId": "s-bsk-986d52aee1a0",
"metadataId": "",
"payPageId": "",
"traceId": "fd0ad1b3961445da984d941ab6a085e8",
"typeId": "s-pdd-pe9ittjo3zie"
},
"orderId": "order-1695136565466-315",
"paymentReference": "",
"processing": {
"uniqueId": "Tx-rj4s6zu86z8",
"shortId": "Tx-rj4s6zu86z8",
"traceId": "fd0ad1b3961445da984d941ab6a085e8"
}
}
charges
initialized after the authorize
are actual payments and can be refunded by canceling them.