This example is extended version of ACH Payment Method with Plaid
        adding support for 0Auth user verification using returnUrl parameter in our API.
    
        After successful user authorization Plaid can redirect user to the page determined by returnUrl parameter.
        Example of this return page can be found at this localization.
    
Details of 0Auth and when redirect will happen can be found in official Plaid Link 0Auth guide
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).0210000211111222233331111
        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).0210000211111222233330000Prior 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-0auth")
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))
                .set("flow", Map.of(
                        "returnUrl", getSiteUrl() + "/examples/ach-payment-method-with-plaid-0auth/return"
                ));
            // 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;
    }
    ...
}