Search…
SEPA Direct Debit
SEPA 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.

Configuring SEPA Direct Debit for DigitalRiver.js

Create a SEPA (Single European Payment Area) Direct Debit payment method for your app or website in four easy steps:

Step 1: Build a SEPA Direct Debit source request and details objects

Build the SEPA Direct Debit Source Request and Details objects.

SEPA Direct Debit source request object

A SEPA Direct Debit Source Request object requires the following fields.
Field
Value
type
directDebit
sessionId
The payment session identifier.
owner
directDebit
A SEPA Direct Debit Source Details object that includes the details of the transaction.

SEPA Direct Debit source details object

The SEPA Direct Debit Source Details object requires the following fields.
1
{
2
"returnUrl": "https://example.com"
3
}
Copied!
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 SEPA Direct Debit experience.

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

Use the DigitalRiver.js library to create and mount elements to the HTML container.
1
var data = {
2
"type": "directDebit",
3
"sessionId": "ea03bf6f-84ef-4993-b1e7-b7d5ecf71d1f",
4
"owner": {
5
firstName: "John",
6
lastName: "Doe",
7
8
phoneNumber: "000-000-0000",
9
address: {
10
line1: "123 Main Street",
11
line2: "",
12
city: "Paris",
13
postalCode: "14390",
14
country: "FR"
15
}
16
},
17
"directDebit": {
18
"returnUrl": "https://mypage.com"
19
}
20
}
21
22
digitalriver.createSource(data).then(function(result) {
23
if (result.error) {
24
//handle errors
25
} else {
26
var source = result.source;
27
//send source to back end
28
sendToBackend(source);
29
}
30
});
Copied!

SEPA Direct Debit source example

1
{
2
"clientId": "gc",
3
"channelId": "drdod15",
4
"liveMode": false,
5
"id": "bddccfc7-4fa8-401b-b661-421cd5047792",
6
"clientSecret": "bddccfc7-4fa8-401b-b661-421cd5047792_bdddssccfc7-4fa8-401b-b661-421cd5047792",
7
"type": "directDebit",
8
"reusable": false,
9
"owner": {
10
"firstName": "John",
11
"lastName": "Doe",
12
"email": "[email protected]",
13
"phoneNumber": "000-000-0000",
14
"address": {
15
"line1": "98 Boulevard Saint-Germain",
16
"city": "Paris",
17
"state": "Île-de-France",
18
"country": "FR",
19
"postalCode": "75005"
20
}
21
},
22
"amount": "778.39",
23
"currency": "EUR",
24
"state": "pending_redirect",
25
"creationIp": "209.87.178.4",
26
"createdTime": "2019-05-22T01:48:42.168Z",
27
"updatedTime": "2019-05-22T01:48:42.168Z",
28
"flow": "redirect",
29
"redirect": {
30
"redirectUrl": "https://api.digitalriver.com:443/payments/redirects/4e478578-843a-48a5-beef-66c0dae99f5d?apiKey=pk_test_6cb0fe9ce3124093a9ad906f6c589e2d",
31
"returnUrl": "https://example.com?action=paymentSuccess"
32
},
33
"directDebit": {}
34
}
Copied!

Step 3: Authorize a SEPA Direct Debit source

When you create a SEPA 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 SEPA Direct Debit authorization

To redirect your customer for authorization, use the redirectUrl parameter in your createSource response.
HTML
1
window.location.href = sourceResponse.redirect.redirectUrl;
Copied!
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 SEPA 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 attaching it to a cart or attaching it to a shopper.

Option 1: Attach the source to a cart

POST /v1/shoppers/me/carts/active/apply-payment-method
1
{
2
"paymentMethod": {
3
"sourceId": "e7ba0595-059c-460c-bad8-2812123b9313"
4
}
5
}
Copied!

Option 2: Attach the source to a shopper

POST /v1/shoppers/me/payment-options
1
{
2
"paymentOption": {
3
"nickName": "My Token",
4
"isDefault": "true",
5
"sourceId": "61033d62-c0f4-4a7e-b844-07daf26ba84e"
6
}
7
}
Copied!

Supported markets

For information on supported markets and currencies for Drop-in and DigitalRiver.js, go to:
Last modified 1mo ago