This example shows how easily you can setup your site to collect ACH account details using Plaid integration. Possible verification scenarios in Plaid can be divided into two groups: instant and asynchronous.
Instant verification happens when PaymentMethod is ready to be Charged immediately after customer has finished Plaid setup process. The event "payment_method_update" would be created and PaymentMethod would have status "chargeable" .
To finish test Payment Method verified instantly setup you can use following steps during Plaid configuration:
Houndstooth Bank
in Link.user_good
and pass_good
in the Credential pane.Plaid Savings (****1111)
.021000021
1111222233331111
Asynchronous verification happens when PaymentMethod is not yet ready to be Charged after customer has finished Plaid setup process.
An event fo type payment_method_update
would be created and PaymentMethod would have status pending
.
This verification process of such account can take up to a week.
After it is finished an event payment_method_update
would be created and PaymentMethod would get status chargeable
or failed
.
In Test mode PaymentMethod will became chargeable in few seconds to simplify testing.
To finish test Payment Method verified asynchronously you can use following steps during Plaid configuration:
Houndstooth Bank
in Link.user_good
and microdeposits_good
in the Credential pane.Plaid Checking (****0000)
.021000021
1111222233330000
Prior to processing an ACH payment, you must first get permission from the customer by presenting a mandate. This mandate only needs to be displayed the first time you collect the ACH payment details and must be presented as part of the payment flow on your website. Final language should be reviewed and approved by your legal council review before adding it to your payments checkout page.
Example mandate is present in the example view for reference.
One can also use our ACH without Plaid, receiving account details directly from customer. See our ACH Payment Method with bank account details for more details.
@AjaxController
@RequestMapping("/ajax/examples/ach-payment-method-with-plaid")
class ExamplesAjaxAchWithPlaidController {
@PostMapping("/payment-method")
Map createPaymentMethod(@RequestBody ExampleRequest initRequest) throws IOException {
try (Shift4Gateway shift4Gateway = createShift4Gateway()) {
// create payment method
PaymentMethodRequest paymentMethodRequest = new PaymentMethodRequest()
.set("type", "ach")
.set("ach", Map.of(
"verificationProvider", "plaid"))
.billing(new BillingRequest()
.name(initRequest.billingName));
// pass clientObjectId of payment method to frontend to finish setup there
return singletonMap("clientObjectId", paymentMethod.getClientObjectId());
} catch (Shift4Exception e) {
throw new BadRequestException(e.getMessage());
}
}
private static class ExampleRequest {
String billingName;
}
...
}