Desktop/Mobile Website Browser
This step-by-step guide describes how to accept a payment using Bacs Direct Debit as a payment method.
Step 1: Initialize a PaymentIntent
Create a PaymentIntent object with a request_id
, amount
, currency
and a merchant_order_id
from your backend server.
Example request
Example response
If you want to skip verification for all transactions, please contact your Airwallex account manager for instructions.
Step 2: Collect payment method details and mandate acknowledgment
When a shopper submits Bacs Direct Debit on the checkout page, you must call Confirm a PaymentIntent API to collect the mandate and complete the payment. For Bacs Direct Debit, we support two verification methods: TrueLayer and micro-deposit.
Option 1: TrueLayer verification
TrueLayer requires bank_name
when confirming the PaymentIntent. You can call Get available bank names API with payment_method_type
to get the supported banks.
Example request
Set the verification method to truelayer
using thepayment_method_options.bacs_direct_debit.verification_method
field. You can also provide owner_name
and owner_email
in the request so that the shopper will see these fields pre-filled on the confirmation page.
Example request
Example response
Option 2: Micro-deposit verification
You can also verify Bacs Direct Debit with micro-deposits by providing the following payload.
Example request
You will see the transaction with REQUIRES_CUSTOMER_ACTION
status. Please find the next action in the response.
Example response
Airwallex will send out a notification email to your shopper automatically to guide them on micro-deposits verification. If you want to customize the experience, please contact our Sales Support to turn off the Airwallex notification email and use the URL returned from the response to build your own verification flow.
You can use instructions as below to guide your shoppers on checkout. Learn more about micro-deposit verification.
This account cannot be charged at the moment, please verify the account.
You will receive two micro-deposits to your account in 1-2 business days. You can click the verify button or verify through the email we have sent you.
Step 3: Send Direct Debit Instruction confirmation and advance notice emails
Airwallex will send Direct Debit Instuction (DDI) confirmation and advance notification emails on your behalf to shoppers. If you wish to customize the emails, provide your company logo and support email address to your Airwallex Account Manager. If you choose to turn off Airwallex notification emails and send your own, you should use payment_consent.verified
to trigger DDI confirmation email, and payment_intent.pending
to trigger advance notice email. Learn more on mandate and advance notice.
Step 4: Wait for notification from Airwallex
Bacs Direct Debit is a delayed notification payment method, which means that the transaction cannot be authorized instantly. A Bacs Direct Debit PaymentIntent remains in a pending state after submission to the Bacs network. Once the payment succeeds, the associated PaymentIntent status updates from PENDING
to SUCCEEDED
.
The following events are sent when the status is updated.
EVENT | DESCRIPTION | NEXT STEPS |
---|---|---|
payment_intent.pending | The customer’s payment is submitted to Airwallex successfully. | Wait for the initiated payment to succeed or fail. |
payment_intent.succeeded | The customer’s payment has succeeded. | Provision goods and services. |
payment_attempt.authorization_failed | The customer’s payment is declined. | Contact the customer and request for another payment method. |
payment_consent.pending_verification | The payment is undergoing the verification process. | N/A. This status should last for a short time for TrueLayer verification, but may take 1-2 days for micro-deposit verification. |
payment_consent.pending | The payment verification is complete and has been sent for DDI registration. | You may want to notify your shopper that the verification is complete and that the bank account has been sent for DDI registration. |
payment_consent.verified | The customer’s DDI is successfully registered. | If you have disabled the DDI confirmation emails sent from Airwallex, you should notify your customers that the DDI is successfully registered. |
dispute.accepted | Any bank rejections or indemnity claims are treated as disputes by Airwallex. The amount of the dispute is deducted from your pending settlement amount. | You cannot defend against Bacs Direct Debit disputes. You must contact your customer to resolve the situation. |
Succeeded PaymentIntents can be disputed due to various reasons. You should familiarize with the dispute risks of direct debits and contact your customers to resolve the situation. Learn more about disputes.
If the transaction fails after the request is sent to bank, you can get the failed reason from the webhook event payment_attempt.authorization_failed
.
You can also query the status of a payment anytime using Retrieve a PaymentIntent API.
Step 5: Test Bacs Direct Debit
Use the following details to test Bacs Direct Debit in the demo environment.
1. Account verification
1.1 Account verification using Truelayer
Account holder name | Test scenario |
---|---|
John Doe | For successful Truelayer verification |
Any other name | For failed Truelayer verification |
1.2 Account verification using micro-deposits
Account number | Test scenario |
---|---|
40000000 | Verification required |
10000000 | No verification required |
Verification amounts | Description |
---|---|
0.04, 0.04 | For failed verification |
Any other amount | For successful verification |
2. Payment
Payment amounts | Test scenario |
---|---|
400 | For failed payment intent |
Any other amount | For successful payment intent |
3. Refund
Refund amounts | Test scenario |
---|---|
4 | For failed refund |
Any other amount less than payment amount | For successful partial/full refund |