Bacs Direct Debit payments
Learn to accept Bacs Direct Debit payments.
Stripe users in the UK can use the Payment Element and a Payment Intent to accept Bacs Direct Debit payments from customers with a UK bank account.
Getting started
You need a Payment Element integration to accept Bacs Direct Debit through Payment Element. You can create one by following our quickstart guide to accept a payment using Payment Element.
Note
The Bacs Direct Debit scheme rules require that your customer accept a mandate in order for Stripe to debit their account. Payment Element collects this mandate when accepting the customer’s payment details and so you don’t need to take any action to comply with this requirement.
Set up Payment Element to accept Bacs Direct Debit
Note
Bacs Direct Debit is only available for payments in GBP. Bacs Direct Debit isn’t available if you use a different currency in your Payment Intent.
You can make Bacs Direct Debit available as a payment method in your Payment Element integration in two ways.
Handle post-payment events
Bacs Direct Debit payments are an asynchronous method, so funds are not immediately available.
A PaymentIntent for Bacs Direct Debit can remain in a pending state for up to 5 business days from its creation if it is against a newly created mandate and up to 3 business days otherwise. After the payment is complete, the PaymentIntent status is updated to succeeded
.
Bacs Direct Debit timelines
It takes 3 business days to confirm the success or failure of a Bacs Direct Debit payment when a mandate is already in place and 6 business days when a new mandate must be collected. Payments made after 20:00 UTC are submitted the following business day.
In some cases, the bank may notify us of a payment failure after the payment has been marked as successful in your Stripe account. In this case the payment failure is identified as a dispute with the appropriate reason code.
This table shows the Bacs timeline in business days from the time (T) that a payment is made when a new mandate must be collected:
T+0 | Mandate submitted |
T+3 | Mandate is active and the payment is submitted |
T+5 | Funds leave the customer’s bank account |
T+6 | Funds are available in Stripe |
Setting up webhooks
Stripe sends multiple events during the payment process and after the payment is complete. Use the Dashboard webhook tool or follow the webhook guide to receive these events and run actions, like sending an order confirmation email to your customer, logging the sale in a database, or starting a shipping workflow.
For Bacs Direct Debit you need to handle the payment_intent.succeeded event in order to confirm that the payment has succeeded. Stripe also recommends handling the payment_intent.processing, and payment_intent.payment_failed events.
To test webhooks locally, you can use Stripe CLI. After you have it installed, you can forward events to your server:
stripe listen --forward-to localhost:4242/webhook Ready! Your webhook signing secret is '{{WEBHOOK_SIGNING_SECRET}}' (^C to quit)
Learn more about setting up webhooks.
Test the integration
There are several test bank account numbers you can use in a sandbox to make sure this integration is ready.
Sort code | Account number | Description |
---|---|---|
108800 | 00012345 | The payment succeeds and the PaymentIntent transitions from processing to succeeded . |
108800 | 90012345 | The payment succeeds after three minutes and the PaymentIntent transitions from processing to succeeded . |
108800 | 33333335 | The payment is accepted but then immediately fails with a debit_ failure code and the PaymentIntent transitions from processing to requires_ . The Mandate becomes inactive and the PaymentMethod can not be used again. |
108800 | 93333335 | The payment fails after three minutes with a debit_ failure code and the PaymentIntent transitions from processing to requires_ . The Mandate becomes inactive and the PaymentMethod can not be used again. |
108800 | 22222227 | The payment fails with an insufficient_ failure code and the PaymentIntent transitions from processing to requires_ . The Mandate remains active and the PaymentMethod can be used again. |
108800 | 92222227 | The payment fails after three minutes with an insufficient_ failure code and the PaymentIntent transitions from processing to requires_ . The Mandate remains active and the PaymentMethod can be used again. |
108800 | 55555559 | The payment succeeds after three minutes and the PaymentIntent transitions from processing to succeeded , but a dispute is immediately created. |
108800 | 00033333 | Payment Method creation succeeds, but the Mandate is refused by the customer’s bank and immediately transitions to inactive. |
108800 | 00044444 | The request to set up Bacs Direct Debit fails immediately due to an invalid account number and the customer is prompted to update their information before submitting. Payment details are not collected. |
108800 | 34343434 | The payment fails with a charge_ failure code due to the payment amount causing the account to exceed its weekly payment volume limit. |
108800 | 12121212 | The payment fails with a charge_ failure code due to the payment amount exceeding the account’s transaction volume limit. |
You can test using any of the account numbers provided above. However, because Bacs Direct Debit payments take several days to process, use the test account numbers that operate on a three-minute delay to better simulate the behavior of live payments.
Note
By default, Stripe automatically sends emails to the customer when payment details are initially collected and each time a debit will be made on their account. These notifications aren’t sent in sandboxes.
Payment failures
Payments can fail for a variety of reasons. The reason for a failure is available through charge.failure_code. Only payments with certain failure codes may be retried. If a payment can’t be retried, we recommend reaching out to the customer and asking them to pay again using a different bank account or a different payment method.
Below is a list of failure codes we currently send for Bacs Direct Debit. We may add more at any time, so in developing and maintaining your code, you should not assume that only these types exist.
Failure code | Description | Retryable |
---|---|---|
account_ | The bank account has been closed. | No |
bank_ | The account has been transferred to a new Payment Service Provider (PSP). Check if you have been notified of the new PSP’s details. If not, you must collect a new mandate from the customer. | No |
debit_ | The customer has notified their bank that this payment was unauthorized or there is no mandate held by the paying bank. | No |
generic_ | This payment could not be processed. | Yes |
insufficient_ | The customer’s account has insufficient funds to cover this payment. | Yes |
invalid_ | The account number is not valid. This could mean it is not for a GBP account or that the account can’t process Direct Debit payments. | No |
To retry a payment, confirm the PaymentIntent again using the same PaymentMethod.
To ensure success, we recommend reaching out to the payer before retrying a payment.