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:
- C#
var request = new PaymentMethodRequest {
CustomerId = "131866",
PaymentMethodNonce = nonceFromTheClient,
Options = new PaymentMethodOptionsRequest {
UsBankAccountVerificationMethod = UsBankAccountVerificationMethod.NETWORK_CHECK // or MICRO_TRANSFERS or INDEPENDENT_CHECK
}
};
Result<paymentmethod> paymentMethodResult = gateway.PaymentMethod.Create(request);
Verification Add Ons
Note
This step is optional and only applies to network check verifications.
customer_verification
under verification_add_ons
.
- C#
var request = new PaymentMethodRequest {
CustomerId = "131866",
PaymentMethodNonce = nonceFromTheClient,
Options = new PaymentMethodOptionsRequest {
UsBankAccountVerificationMethod = UsBankAccountVerificationMethod.NETWORK_CHECK,
VerificationAddOns = VerificationAddOns.CUSTOMER_VERIFICATION
}
};
Result<paymentmethod> paymentMethodResult = gateway.PaymentMethod.Create(request);
Checking for successful verification
Note
This step is required when using the network check method.
- C#
if (paymentMethodResult.IsSuccess()) {
UsBankAccount usBankAccount = (UsBankAccount) paymentMethodResult.Target;
bool verified = usBankAccount.IsVerified;
var 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.
- C#
var request = new UsBankAccountVerificationConfirmRequest {
DepositAmounts = new int[] { 17, 29 }
};
Result<usbankaccountverification> result = gateway.UsBankAccountVerification.ConfirmMicroTransferAmounts(verificationIdFromPaymentMethod, request);
if (result.IsSuccess()) {
// confirmation successful
} else {
// confirmation failed
}
Looking up individual verification status
Note
This step is required when using the micro-transfers method.
- C#
var status = gateway.UsBankAccountVerification.Find(verificationIdFromPaymentMethod).Status;
if (status == Braintree::UsBankAccountVerificationStatus::VERIFIED) {
// ready for transacting
} else if (status == Braintree::UsBankAccountVerificationStatus::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.
- C#
var request = new TransactionRequest {
Amount = 10.00M,
PaymentMethodToken = tokenFromVault,
DeviceData = deviceDataFromTheClient,
Options = new TransactionOptionsRequest {
SubmitForSettlement = true
}
};
Result<transaction> result = gateway.Transaction.Sale(request);
if (result.IsSuccess()) {
// See result.Target for details
} else {
// Handle errors
}
Retrying verifications
Note
This step is applicable to the network check and micro-transfer methods.
Although micro-transfers take the longest to complete, they have the highest chance of success and work well as a backup method. If the customer is able to provide a voided check or other manual form of verification, independent check can be a quick and easy alternative, too.
You can retry verification on a previously-stored payment method any number of times, using either the same verification method or a different verification method. This example shows how to attempt a micro-transfers verification on a payment method you've already vaulted and attempted to verify before:
- C#
var request = new PaymentMethodRequest {
Options = new PaymentMethodOptionsRequest {
UsBankAccountVerificationMethod = UsBankAccountVerificationMethod.MICRO_TRANSFERS // or NETWORK_CHECK or INDEPENDENT_CHECK
}
};
Result<paymentmethod> result = gateway.PaymentMethod.Update("the_token", updateRequest);
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