Direct Debit

Direct Debit allows users to authorize transactions directly from their bank account, which is a popular international payment method.

You can find an example of integration here.

Create a Direct Debit payment method for your app or website in four easy steps:

Supported geographies

Direct Debit supports the following geographies and currencies.

Supported geographies

Austria Belgium Bulgaria Croatia Cyprus Czech Republic Denmark Estonia Finland France Germany Greece Hungary

Iceland

Ireland

Italy

Latvia

Liechtenstein

Lithuania

Luxembourg

Malta

Monaco

Netherlands

Norway

Poland

Portugal

Romania

San Marino

Slovakia

Slovenia

Spain

Sweden

Switzerland

United Kingdom

Vatican City State / Holy See Principality of Andorra

Supported currencies

EUR

Step 1. Build a Direct Debit Source Request and Details objects

Build the Direct Debit Source Request and Details objects.

Direct Debit Source Request object

A Direct Debit Source Request object requires the following fields.

Field

Value

type

directDebit

amount

The total value of the transaction.

currency

The currency of the transaction.

owner

An Owner object.

directDebit

A Direct Debit Source Details object that includes the details of the transaction.

Direct Debit Source Details object

The Direct Debit Source Details object requires the following fields.

{
"returnUrl": "https://example.com"
}

Field

Required/Optional

Description

returnUrl

Required

If you choose to use the full redirect flow, this is where you will redirect your customer to after authorizing or canceling within the Direct Debit experience.

Step 2. Create a Direct Debit source using DigitalRiver.js

To create a Direct Debit payment source, you must use the createSource method exposed via DigitalRiver.js.

let directDebitSourceData = {
"type": "directDebit",
"amount": 100,
"currency": "EUR",
"owner": {
firstName: "Fred",
lastName: "Flintstone",
email: "test@digitalriver.com",
phoneNumber: "000-000-0000",
address: {
line1: "123 Main Street",
line2: "",
city: "Paris",
postalCode: "14390",
country: "FR"
}
},
"directDebit": {
"returnUrl": "https://mypage.com"
}
}
digitalriver.createSource(directDebitSourceData).then(function(result) {
hideOverlay();
console.log(result);
if (result.error) {
//handle errors as something went wrong
} else {
var source = result.source;
//do something with the created source
}
});

Direct Debit source example

{
"clientId": "gc",
"channelId": "drdod15",
"liveMode": false,
"id": "bddccfc7-4fa8-401b-b661-421cd5047792",
"clientSecret": "bddccfc7-4fa8-401b-b661-421cd5047792_bdddssccfc7-4fa8-401b-b661-421cd5047792",
"type": "directDebit",
"reusable": false,
"owner": {
"firstName": "Rickie",
"lastName": "Senger",
"email": "Stanford.Hane1@hotmail.com",
"phoneNumber": "000-000-0000",
"address": {
"line1": "98 Boulevard Saint-Germain",
"city": "Paris",
"state": "Île-de-France",
"country": "FR",
"postalCode": "75005"
}
},
"amount": "778.39",
"currency": "EUR",
"state": "pending_redirect",
"creationIp": "209.87.178.4",
"createdTime": "2019-05-22T01:48:42.168Z",
"updatedTime": "2019-05-22T01:48:42.168Z",
"flow": "redirect",
"redirect": {
"redirectUrl": "https://api.digitalriver.com:443/payments/redirects/4e478578-843a-48a5-beef-66c0dae99f5d?apiKey=pk_test_6cb0fe9ce3124093a9ad906f6c589e2d",
"returnUrl": "https://example.com?action=paymentSuccess"
},
"directDebit": {}
}

Step 3. Authorize a Direct Debit source

When you create a Direct Debit source, the customer is required to authorize the charge through their payment provider. You can accomplish this by redirecting the customer to their payment provider.

Redirecting the Customer for Direct Debit authorization

To redirect your customer for authorization, use the redirectUrl parameter in your createSource response.

HTML
window.location.href = sourceResponse.redirect.redirectUrl;

The payment provider will present the customer with the transaction details where they can authorize or cancel the transaction. A successful authorization redirects the customer to the Direct Debit Return URL parameter you specified when you created the source.

Step 4. Use the Authorized source

Once authorized, you can use the source by either attaching it to a checkout or attaching it to a customer for multiple uses.

Option 1. Attach the source to a checkout

POST /checkouts/{id}
{
"customerId": "5774321008",
"sourceId": "src_a78cfeae-f7ae-4719-8e1c-d05ec04e4d37"
}

Option 2. Attach the source to a customer

POST /customers/{id}/sources/{sourcesId}
{
"id": "5774321008",
"sourceId": "src_a78cfeae-f7ae-4719-8e1c-d05ec04e4d37"
}