SEPA Direct Debit

Accept SEPA Direct Debit payments in your online store.


SEPA Direct Debit is a standardised payment method facilitating bank-to-bank transactions within the European Union. Use the emerchantpay  API to accept SEPA Direct Debit as a payment method across the supported emerchantpay’s payment integrations.

Payment method Countries/regions Supported flows
Bank transfer Austria, Belgium, Cyprus, Estonia, Finland, France, Germany, Greece, Ireland, Italy, Latvia, Lithuania, Luxembourg, Malta, Monaco, Netherlands, Portugal, Slovakia, San Marino, Slovenia, Spain Click flow and SEPA verified payment flow


Prerequisites


Payment flow


The type of payment flow you use is decided during your initial setup. SEPA Direct Debit offers two types of flows:

  • Standard SEPA Direct Debit flow

  • This flow uses the Click mandate. When customers proceed with a Click flow, they agree to the terms and conditions directly on the checkout page, authorising future payments from their account. No additional verification is performed during this process.

  • SEPA verified payment flow (SDDVP)

  • The SEPA verified payment flow adds an extra layer of security to the SEPA Direct Debit process by redirecting customers to their online banking platform for payment verification and confirmation.



1. Create a SEPA Direct Debit payment request

To submit a payment using SEPA Direct Debit, create a payment request to the emerchantpay Genesis payment gateway. Specify sdd_sale as the transaction_type.

Example of passing a SEPA Direct Debit transaction request with the Click flow:


<payment_transaction>
<transaction_type>sdd_sale</transaction_type>
<transaction_id>119643250547501c79d8295</transaction_id>
<usage>40208 concert tickets</usage>
<remote_ip>245.253.2.12</remote_ip>
<amount>100</amount>
<currency>EUR</currency>
<iban>DE09100100101234567891</iban>
<bic>PBNKDEFFXXX</bic>
<billing_address>
<first_name>Travis</first_name>
<last_name>Pastrana</last_name>
<country>DE</country>
</billing_address>
</payment_transaction>’ 

Example of passing a SEPA Direct Debit transaction request with the SEPA verified payment flow:

<payment_transaction>
<transaction_type>sdd_sale</transaction_type>
<transaction_id>56194064335298463722639</transaction_id>
<notification_url>https://example.com/notification</notification_url>
<return_success_url>https://example.com/success</return_success_url>
<return_failure_url>https://example.com/failure</return_failure_url>
<return_pending_url>https://example.com/pending</return_pending_url>
<return_cancel_url>https://example.com/cancel</return_cancel_url>
<usage>concert tickets</usage>
<remote_ip>245.253.2.12</remote_ip>
<amount>2960</amount>
<currency>EUR</currency>
<billing_address>
<first_name>Travis</first_name>
<last_name>Pastrana</last_name>
<address1>Ziegelstr 58</address1>
<zip_code>12689</zip_code>
<city>Berlin</city>
<country>DE</country>
</billing_address>
<customer_email>travis.pastrana@example.com</customer_email>
<iban>DE87500105175728219266</iban>
</payment_transaction>


2. Receive a response

You will receive a Success or Error response to your payment request.

Example of a Success response with the Click flow:

 
<payment_response>
<transaction_type>sdd_sale</transaction_type>
<status>approved</status>
<mode>live</mode>
<transaction_id>119643250547501c79d8295</transaction_id>
<unique_id>44177a21403427eb96664a6d7e5d5d48</unique_id>
<technical_message>Transaction successful!</technical_message>
<message>Transaction successful!</message>
<timestamp>2023-03-06T16:33:10Z</timestamp>
<descriptor>Descriptor one</descriptor>
<amount>100</amount>
<currency>EUR</currency>
<sent_to_acquirer>true</sent_to_acquirer>
</payment_response>
<

Example of a Success response with the SEPA verified payment flow:

<payment_response>
<transaction_type>sdd_sale</transaction_type>
<status>pending_async</status>
<unique_id>4ca953760286de6bc67327c307b3a92f</unique_id>
<transaction_id>56194064335298463722639</transaction_id>
<bank_account_number>DE87500105175728219266</bank_account_number>
<redirect_url>https://gate.emerchantpay.net/redirect/to_acquirer/a5c154a18f4cc95d7cb53e455b734e5c</redirect_url>
<mode>live</mode>
<timestamp>2024-02-07T18:17:36Z</timestamp>
<descriptor>Descriptor one</descriptor>
<amount>2960</amount>
<currency>EUR</currency>
<sent_to_acquirer>true</sent_to_acquirer>
</payment_response>

Asynchronous notification

Because the SEPA Direct Debit payment transaction is asynchronous, the result of your customer’s payment is sent as a separate HTTP POST notification from the gateway to the notification_url that you supplied with the transaction request.

Example of a notification for a SEPA Direct Debit transaction with the Click flow:

“transaction_id”: “tm_api_1678195297”
“terminal_token”: “e4de7c9d4ea4bccea3cac90190e2ea0be8ad7610”
“unique_id”: “52775aed3ee5776c906aeba74da69612”
“transaction_type”: “sdd_sale”
“status”: “error”
“signature”: “3bbdb69c48739a41eabf7acb6d95d23a1135d558”
“amount”: “100”
“card_number”: “…”
“card_holder”: “Travis Pastrana”
“customer_email”: “test@test.de”
“customer_phone”: “+498563698777”
“first_name”: “Travis”
“last_name”: “Pastrana”
“address1”: “Berlin”
“zip_code”: “1000”
“city”: “Berlin”
“country”: “DE”
“bank_identifier_code”: “PBNKDEFFXXX”
“invoice_amount”: “100”
“mandate_id”: “tm_api_1678195297”
“iban”: “DE86100000001234400013”

Example of a notification for a SEPA Direct Debit transaction with the SEPA verified payment flow:

“transaction_id”: “56194064335298463722639”
“terminal_token”: “c2bd9a3e7bc5dcdabb2dbd31406e1bc0ab5ac641”
“unique_id”: “4ca953760286de6bc67327c307b3a92f”
“transaction_type”: “sdd_sale”
“status”: “approved”
“signature”: “3bbdb69c48739a41eabf7acb6d95d23a1135d558”
“amount”: “2960”
“invoice_amount”: “2960”
“mandate_id”: “tm_api_1678195297”
“iban”: “DE87500105175728219266”

Use the signature field to verify that the notification has been sent by the Genesis gateway. Each session signature is generated by combining the unique_id of the transaction and your API password, and generating a SHA-1 hash function of the combined string.

signature = SHA-1 hash value of <unique_id><API password>

Notification signature examples:
unique_id API password signature
26aa150ee68b1b2d6758a0e6c44fce4c 50fd87e65eb415f42fb5af4c9cf497662e00b785 c5219b3d385e74496b2b48a549
3f760162ef57a829011e5e2379b3fa17 50fd87e65eb415f42fb5af4c9cf497662e00b785 14519d0db2f7f8f407efccc9b099

After you have verified the notification state and validity, render an XML page containing the transaction’s unique id to acknowledge that you have received the notification.

Example of a notification reply you use to confirm a notification:
<?xml version=”1.0″ encoding=”UTF-8″?>
<notification_echo>
  <unique_id>3f760162ef57a829011e5e2379b3fa17</unique_id>
</notification_echo>


3. Test your integration

Before you can accept live payments, you must test your integration in the emerchantpay staging environment.

Test the integration for the Click flow:

  1. Add an item to your cart in your online store.
  2. Navigate to the checkout page and select SEPA Direct Debit as the payment method.
  3. Follow the redirect link in the response.
  4. In the payment simulator, follow the instructions to simulate a transaction.
  5. Complete the order and verify that you are redirected to the order confirmation page.
  6. Log in to Genesis.
  7. In the navigation menu, go to Payment transactions.
  8. Verify that the transaction appears at the top of the list and is successful.

Test the integration for the SEPA verified payment flow:

  1. Add an item to your cart in your online store.
  2. Navigate to the checkout page and select SEPA Direct Debit as the payment method.
  3. Follow the redirect link in the response.
  4. If you use the test IBAN DE62888888880012345678, the redirect link will open a payment simulator. In the simulator, enter random values for the account number (Kontonummer) and PIN, and agree to the Terms and Conditions.
  5. Click Next/Weiter to finish the transaction simulation.
  6. Verify the transaction in Genesis:
    • Log in to Genesis.
    • Navigate to Payment Transactions in the menu.
    • Verify that the transaction appears at the top of the list and is successful.


4. Accept live payments

After you have successfully tested your SEPA Direct Debit integration, you are ready to move to the production environment and accept live payments. Contact your emerchantpay Account Manager to get your login credentials for the Genesis production environment.

You are now ready to accept live payments using SEPA Direct Debit.