ACH Bank Transfer

Take a bank account payment via ACH Bank Transfer

Usage

index.html
HTML

<!-- Renders the "Connect Bank Account" button -->

<form>

  <button id="ach-button" type="button">Pay with Bank Account</button>

</form>

<!-- Configure the Web Payments SDK and the ACH payment method -->

<script type="text/javascript">

  async function main() {

    const payments = Square.payments(APPLICATION_ID, LOCATION_ID);

    const ach = await payments.ach();



    async function eventHandler(event) {

      event.preventDefault();



      try {

        const result = await ach.tokenize({

          accountHolderName: 'John Doe',

        });



        if (result.status === 'OK') {

          console.log(`Payment token is ${result.token}`);

        }

      } catch (e) {

        console.error(e);

      }

    };



    const achButton = document.getElementById('ach-button');

    achButton.addEventListener('click', eventHandler);

  }



  main();

</script>

Payments

Returned by Square.payments(appId, locationId).

Use this object to instantiate Payment methods. Learn more on the Payments page.

Methods

JS
JavaScript

const payments = Square.payments(appId, locationId);

ACH

The ACH Payment Method

Initiate ACH transfers by allowing the buyer to choose their bank and enter their bank credentials in a Plaid form.

Methods

JS
JavaScript

const ach = await payments.ach()



const achButton = document.getElementById('ach-button')

const buyerNameField = document.getElementById('buyer-name-field');

achButton.onclick = () => {

  try {

    const result = ach.tokenize({ accountHolderName: buyerNameField.value });

    // Process payment with result.token

  }

  catch (e) {

  }

}