Payment-method icon

Pay by Bank (US) for API only

Add Pay by Bank (US) to an existing API-only integration.

Accept Pay by Bank (US) payments using our APIs, and build your own payment form to have full control over the look and feel of your checkout page.

Requirements

Requirement Description
Integration type Make sure that you have built your API-only integration.
Setup steps Before you begin, contact our Support Team to add Pay by Bank (US) in your Customer Area.

Build your payment form

  1. In your POST /paymentMethods request, use:

    • currency: USD
    • countryCode: US
  2. When you receive the /paymentMethods response, note the object for Pay by Bank (US):

    • name: Pay by Bank. Use this to show the payment method in your payment form.
    • type: paybybank_AIS_DD. Use this in your payment request as the paymentMethod.type.

    There is no list of issuing banks that you can show in your payment form.

  3. Make sure that when shoppers select Pay by Bank, you obtain their authorization to debit their bank account. ACH rules require that. We recommend showing the following text:

    By connecting your bank account you are authorizing debits to your account for any amount owed for the use of our services and/or purchase of our products, until you revoke this authorization.

Make a payment

  1. Make a /payments request, specifying:

    Parameter Required Description
    paymentMethod.type -white_check_mark- paybybank_AIS_DD
    returnUrl -white_check_mark- URL to where the shopper should be redirected back to after they complete the payment. This URL can have a maximum of 1024 characters.
    countryCode The shopper's country/region.
    Format: the two-letter ISO-3166-1 alpha-2 country code. Exception: QZ (Kosovo). This determines the banks that our partner shows to the shopper. Currently, only US is supported. This is also the default if you do not include this parameter.
    The countryCode is not required, but we recommend implementing it because of future enhancements that will allow Pay by Bank (US) payments through non-US banks.
  2. The /payments response includes the action object with information that you must use to redirect the shopper.

Handle the redirect

  1. To complete the payment, redirect the shopper to the action.url returned in the /payments response, taking into account the following recommendations:

    • When using the HTTP GET method:
      For security reasons, when showing the redirect in the app, we recommend that you use SFSafariViewController for iOS or Chrome Custom Tabs for Android, instead of WebView objects. Also refer to the security best practices for WebView.

    • Redirection for mobile integrations:
      For mobile integrations, we strongly recommended that you redirect the shopper to the default browser of their device. Redirecting to the default browser ensures the best compatibility, handling of multi-factor authentication, app-to-app redirection, and error handling.

  2. After the shopper is redirected back to your website, check the payment result by making a POST /payments/details request, specifying:

    • details: object that contains the URL-decoded redirectResult returned when the shopper was redirected back to your site.
  3. In the response note the following:

    • resultCode: use this to present the result to your shopper.
    • pspReference: our unique identifier for the transaction.

Present the payment result

Use the  resultCode that you received in the /payments/details response to present the payment result to your shopper.

The resultCode values you can receive for Pay by Bank (US) are:

resultCode Description Action to take
Authorised The payment was successful. Inform the shopper that the payment has been successful.
You will receive the funds in 2-3 days.
Cancelled The shopper cancelled the payment while on their bank's website. Ask the shopper whether they want to continue with the order, or ask them to select a different payment method.
Error There was an error while the payment was processed. Inform the shopper that there was an error processing their payment. The response contains a refusalReason, indicating the cause of the error.
Pending or
Received
The shopper has completed the payment but the final result is not yet known. It may take minutes or hours to confirm this. Inform the shopper that you received their order, and are waiting for the payment to be completed.
You will receive the final result of the payment in an AUTHORISATION webhook. If the transaction is not authorised within 30 minutes, the offer will close. Optionally, you can be informed of this through an OFFER_CLOSED webhook.
Refused The payment was refused by the shopper's bank. Ask the shopper to try the payment again using a different payment method.

If the shopper closed the browser and failed to return to your website, wait for webhooks to know the outcome of the payment:

eventCode success field Description Action to take
AUTHORISATION false The payment failed. Cancel the order and inform the shopper that the payment failed.
AUTHORISATION true The shopper successfully completed the payment. Inform the shopper that the payment has been successful and proceed with the order.

Capture

We strongly recommend capturing Pay by Bank (US) payments immediately, to reduce the risk of insufficient funds at the time of capture.

Through our partner Plaid, Adyen completes the checks on the shopper's bank account, including a balance check and risk checks, at the time of authorization. However, the issuing bank does not hold the authorized funds and thus it is possible that the account balance is no longer sufficient by the time you capture the payment. For that reason, you should capture Pay by Bank (US) payments as soon as possible.

However, even with immediate capture there is still a risk of insufficient funds at the time of capture, because capturing is an asynchronous process on the ACH Direct Debit network.

Recurring payments

Pay by Bank (US) supports tokenization for recurring transactions.

We strongly recommend that you ask explicit permission from the shopper if you intend to make future recurring payments. Being transparent about the payment schedule and the charged amount reduces the risk of chargebacks.

To make recurring payments:

  1. Create a token through the initial Pay by Bank (US) transaction for the shopper, specifying:

  2. Get the shopper's token from the payment response or the RECURRING_CONTRACT webhook.
    For example: additionalData.recurring.recurringDetailReference: M5N7TQ4TG5PFWR50.

  3. Use the token in later Pay by Bank (US) payments for the shopper, specifying:

Test and go live

You can test the payment flow as well as the chargeback flow.

To go live, you need to await registration with our partner Plaid.

Test the payment flow

In the test environment, the redirect flow mimics the live flow, but not all refusal reasons can be simulated.

  1. Make a test Pay by Bank (US) payment using an amount from the following table for the payment scenario you want to test. Note that other amounts lead to random results.

    Scenario Amount
    Approved USD 3.53
    Approved with the paybybank_plaid.customerInitiatedReturnRisk and paybybank_plaid.bankInitiatedReturnRisk risk scores both at 60 (out of a maximum of 99). USD 12.17
    Refused with refusal reason Not enough balance USD 27.53

    You are redirected to First Platypus Bank.

  2. You do not need to enter any bank credentials, but if you want to try different bank accounts, enter one of the following usernames:

    • custom_chase
    • custom_boa
    • custom_citi
    • custom_wellsfargo

    Tests without one of these usernames all use the same bank account from CITIZENS BANK.

  3. Leave the password blank and select Continue.

  4. Check the status of test payments in your test Customer Area > Transactions > Payments.

Test the chargeback flow

The chargeback mechanism for Pay by Bank (US) chargebacks relies on the ACH Direct Debit network. You can simulate a Pay by Bank (US) chargeback by providing a username that indicates the chargeback scenario you want to test. In the test environment, the flow goes directly to the Chargeback stage.

  1. Send a test Pay by Bank (US) payment request.

  2. When redirected to First Platypus Bank, specify the following username:

    • custom_chargeback_rXX where XX is the dispute reason code without the leading R.
      You can use any of the ACH Direct Debit reason codes.

      Example: the username custom_chargeback_r01 triggers a chargeback with reason code R01 for Insufficient Funds.

  3. Leave the password blank and select Continue.

  4. Note that the request succeeds with resultCode: Authorised.
    The chargeback flow starts after the test payment is captured and settled.

  5. Wait for the CHARGEBACK webhook and check your test Customer Area > Revenue & risk > Disputes.
    The webhook and your Customer Area show a chargeback with the return reason code that you specified in the test payment request.

Go live

To go live, you need to add Pay by Bank (US) in your live Customer Area. Our partner Plaid then registers your merchant account with participating banks, including some of the largest banks in the US. The registration takes up to one business week from the moment Plaid has started the process. During this time, your shoppers cannot connect their bank account to Plaid. For this reason, you cannot accept live Pay by Bank (US) payments until the registration process is completed.

We send you a paymentMethod.created webhook when you can start accepting live Pay by Bank (US) payments.

See also

OSZAR »