ACH Direct Debit
Server-side Implementation
GraphQL
Click here to view the
server-side implementation using GraphQL.
Availability
ACH Direct Debit is available to
eligible merchants who
can implement a custom client-side integration using our
JavaScript v3 SDK. It's
currently not available in our Drop-in UI.
Server-side flows
Your server-side implementation depends on the verification method(s) you intend to use:
Network check
- Vault the payment method using the payment method nonce from your client
- Check for successful verification
- Create transactions using the vaulted payment method token
You may also find it useful to:
Micro-transfers
- Vault the payment method using the payment method nonce from your client
- Confirm micro-deposit amounts
- Periodically look up the verification's status
- Create transactions using the vaulted payment method token
You may also find it useful to:
Independent check
- Vault the payment method using the payment method nonce from your client
- Create transactions using the vaulted payment method token
You may also find it useful to set up webhooks.
Vaulting the payment method
Note
This step is required in order to verify the payment method and begin transacting on it.
Payment Method: Create
to specify the verification method (network check, micro-transfers, or independent check) and store
the bank account information as a payment method in your Vault:
- Callback
- Promise
gateway.paymentMethod.create({
customerId: "131866",
paymentMethodNonce: nonceFromTheClient,
options: {
usBankAccountVerificationMethod: braintree.UsBankAccountVerification.VerificationMethod.NetworkCheck // or MicroTransfers or IndependentCheck
}
}, (err, result) => { });
Verification Add Ons
Note
This step is optional and only applies to network check verifications.
customer_verification
under verification_add_ons
.
- Callback
- Promise
gateway.paymentMethod.create({
customerId: "131866",
paymentMethodNonce: nonceFromTheClient,
options: {
usBankAccountVerificationMethod: braintree.UsBankAccountVerification.VerificationMethod.NetworkCheck,
verificationAddOns: braintree.UsBankAccountVerification.VerificationAddOns.CustomerVerification
}
}, (err, result) => { });
Checking for successful verification
Note
This step is required when using the network check method.
- Node
if (result.success) {
const usBankAccount = result.paymentMethod;
const verified = usBankAccount.verified;
const responseCode = usBankAccount.verifications[0].processorResponseCode;
// ...
}
Confirming micro-deposit amounts
Note
This step is required when using the micro-transfers method. Until micro-deposit amounts are
confirmed, the vaulted bank account will not be verified or transactable.
- Callback
- Promise
gateway.usBankAccountVerification.confirmMicroTransferAmounts(
verificationIdFromPaymentMethod,
[17, 29],
(err, response) => { }
);
Looking up individual verification status
Note
This step is required when using the micro-transfers method.
- Callback
- Promise
gateway.usBankAccountVerification.find(verificationId, (err, verification) => {
const status = verification.status;
if (status == UsBankAccountVerification.StatusType.Verified) {
// ready for transacting
} else if (status == UsBankAccountVerification.StatusType.Pending) {
// continue waiting
} else {
// verification failed
}
});
Creating transactions
From payment method tokens
Note
This step is applicable to all verification methods.
Payment Method: Create
on a nonce created from your customer's payment information. Pass the token to your server, and
create a transaction.
Collect device data
from the client and include the deviceDataFromTheClient in the
transaction.
- Callback
- Promise
gateway.transaction.sale({
amount: "10.00",
paymentMethodToken: tokenFromVault,
deviceData: deviceDataFromTheClient,
options: {
submitForSettlement: true
}
}, (err, result) => {
if (result.success) {
// See result.transaction for details
} else {
// Handle errors
}
});
Retrying verifications
Note
This step is applicable to the network check and micro-transfer methods.
- Callback
- Promise
gateway.paymentMethod.update("theToken", {
options: {
usBankAccountVerificationMethod: UsBankAccountVerification.VerificationMethod.MicroTransfers // or NetworkCheck or IndependentCheck
}
}, (err, result) => {
// handle result
});
Note
You can't change the details of a vaulted US Bank Account payment method using
Payment Method: Update
. If you need to retry verification with new bank account information,
create a new payment method.
Setting up webhooks
Note
This step is applicable to all verification methods.
- See the webhooks guide for details on how to configure webhooks in general
- See the Transaction webhooks reference for details on the specific notifications available for sales and refunds