> ## Documentation Index
> Fetch the complete documentation index at: https://integration.wpay.com.au/llms.txt
> Use this file to discover all available pages before exploring further.

# Adyen - ACH Direct Debit

> Configure ACH Direct Debit via Adyen as a payment method in Gr4vy.

**Adyen**

Adyen is a global payment technology company founded in 2006 in Amsterdam, Netherlands. The company provides a single platform for accepting payments across online, mobile, and in-store channels for major enterprises worldwide including Uber, Spotify, and Microsoft.

ACH Direct Debit is a bank payment method in the United States. The buyer enters their bank account and routing numbers on the Adyen Drop-in component, and the funds are debited from their account. Adyen verifies and processes the debit, and the payment method can be stored for recurring debits.

This connector renders the Adyen Drop-in for ACH Direct Debit.

> [!NOTE]
>
> **Four Adyen connectors debit a buyer's bank account.** Pick the one that matches who collects the account:
>
> * [ACH Direct Debit](https://integration.wpay.com.au/connections/payments/adyen-ach) (redirect): the buyer enters their account and routing numbers on Adyen's page, and Adyen keeps them.
> * [SEPA](https://integration.wpay.com.au/connections/payments/adyen-sepa) (redirect): the buyer enters their IBAN on Adyen's page, and Adyen keeps it.
> * [Pay by Bank (redirect)](https://integration.wpay.com.au/connections/payments/adyen-paybybank): Adyen sends the buyer to Plaid to choose their bank. US only.
> * [Bank account (ACH, SEPA, BACS)](https://integration.wpay.com.au/connections/payments/adyen-bank) (stored in Gr4vy): you send the bank account details or a Plaid-linked account, and Gr4vy stores the account. Use this connector to charge bank accounts that you [import](https://integration.wpay.com.au/guides/features/token-import/overview.md) into Gr4vy.

## Setup

Please follow the [common Adyen instructions](./adyen) to get set up with ACH Direct Debit.

Next, make sure to enable ACH Direct Debit as a payment method on your configured account.

## Supported countries

## Supported currencies

## Capabilities

This list is for guidance only. It doesn't guarantee availability or
create any rights, and the provider may need to enable some features for
your account.

## Integration

For ACH Direct Debit, the default integration for Adyen is through a redirect to a hosted payments page that renders the Adyen Drop-in in a popup. The buyer enters their bank account and routing numbers on the Drop-in to authorize the debit.

### Redirect integration

Start by creating a new transaction with the following required fields.

```csharp C# theme={"system"}
var transaction = await client.Transactions.CreateAsync(
    transactionCreate: new TransactionCreate()
    {
        Amount = 1299,
        Currency = "USD",
        Country = "US",
        Intent = "capture",
        PaymentMethod =
            TransactionCreatePaymentMethod.CreateRedirectPaymentMethodCreate(
                new RedirectPaymentMethodCreate()
                {
                    Method = "ach",
                    Country = "US",
                    Currency = "USD",
                    RedirectUrl = "https://example.com/callback",
                }
            ),
    }
);
```

```go Go theme={"system"}
amount := int64(1299)
currency := "USD"
country := "US"
method := components.RedirectPaymentMethodCreateMethodAch
redirectUrl := "https://example.com/callback"

redirectPaymentMethodCreate := components.RedirectPaymentMethodCreate{
    Method: method,
    Country: country,
    Currency: currency,
    RedirectURL: redirectUrl,
}
paymentMethod := components.CreateTransactionCreatePaymentMethodRedirectPaymentMethodCreate(redirectPaymentMethodCreate)

transactionCreate := components.TransactionCreate{
    Amount:        amount,
    Currency:      currency,
    Country:       &country,
    Intent:       gr4vy.Pointer(components.TransactionIntentCapture),
    PaymentMethod: &paymentMethod,
}

transaction, err := client.Transactions.Create(ctx, transactionCreate, nil, nil, nil)
```

```java Java theme={"system"}
CreateTransactionResponse transactionResponse = gr4vyClient.transactions().create()
    .transactionCreate(TransactionCreate.builder()
        .amount(1299L)
        .currency("USD")
        .country("US")
        .intent(TransactionIntent.CAPTURE)
        .paymentMethod(TransactionCreatePaymentMethod.of(RedirectPaymentMethodCreate.builder()
            .method(RedirectPaymentMethodCreateMethod.ACH)
            .country("US")
            .currency("USD")
            .redirectUrl("https://example.com/callback")
            .build()))
        .build())
    .call();

Transaction transaction = transactionResponse.transaction().orElse(null);
```

```php PHP theme={"system"}
$transactionCreate = new TransactionCreate(
    amount: 1299,
    currency: 'USD',
    country: 'US',
    intent: 'capture',
    paymentMethod: new RedirectPaymentMethodCreate(
        method: 'ach',
        country: 'US',
        currency: 'USD',
        redirectUrl: 'https://example.com/callback'
    )
);
$response = self::$sdk->transactions->create($transactionCreate);
$transaction = $response->transaction;
```

```python Python theme={"system"}
transaction: models.Transaction = client.transactions.create(
    amount=1299,
    currency="USD",
    country="US",
    intent="capture",
    payment_method={
        "method": "ach",
        "country": "US",
        "currency": "USD",
        "redirect_url": "https://example.com/callback",
    }
)
```

```ts TypeScript theme={"system"}
const transaction = await gr4vy.transactions.create({
    amount: 1299,
    currency: "USD",
    country: "US",
    intent: "capture",
    paymentMethod: {
        method: "ach",
        country: "US",
        currency: "USD",
        redirectUrl: "https://example.com/callback"
    }
})
```

After the transaction is created, the API response includes `payment_method.approval_url` and the `buyer_approval_pending` status.

```json theme={"system"}
{
  "type": "transaction",
  "id": "ea1efdd0-20f9-44d9-9b0b-0a3d71e9b625",
  "payment_method": {
    "type": "payment-method",
    "approval_url": "https://cdn.sandbox.spider.gr4vy.app/connectors/adyen/apm.html?token=..."
  },
  "method": "ach"
}
```

Open the `approval_url` in a popup so the buyer can enter their bank account and routing numbers on the Adyen Drop-in and authorize the debit. After the buyer completes the form they are redirected to the `redirect_url` you provided when creating the transaction. Do not rely solely on the redirect - either poll the transaction or (recommended) rely on webhooks to detect the final status (for example `capture_succeeded` or failure states).

### Direct integration

Adyen provides [web](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow?platform=Web\&integration=Components\&version=6.23.0), [Android](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow?platform=Android\&integration=Components\&version=5.15.0) and [iOS](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow?platform=iOS\&integration=Components\&version=5.21.1) SDKs for a direct integration. For these flows you should indicate the platform by setting an appropriate `integration_client` when creating the transaction, and then build a client-side integration that uses the [`POST /transactions/:transaction_id/session`](https://integration.wpay.com.au/reference/transactions/get-transaction-session) API to initialize the Adyen SDK.

To start, create a new transaction with the appropriate `integration_client`.

```csharp C# theme={"system"}
var transaction = await client.Transactions.CreateAsync(
  transactionCreate: new TransactionCreate()
  {
    Amount = 1299,
    Currency = "USD",
    Country = "US",
    Intent = "capture",
    IntegrationClient = "ios",
    PaymentMethod =
      TransactionCreatePaymentMethod.CreateRedirectPaymentMethodCreate(
        new RedirectPaymentMethodCreate()
        {
          Method = "ach",
          Country = "US",
          Currency = "USD",
          RedirectUrl = "https://example.com/callback",
        }
      ),
  }
);
```

```go Go theme={"system"}
amount := int64(1299)
currency := "USD"
country := "US"
integrationClient := "ios"
method := components.RedirectPaymentMethodCreateMethodAch
redirectUrl := "https://example.com/callback"

redirectPaymentMethodCreate := components.RedirectPaymentMethodCreate{
  Method: method,
  Country: country,
  Currency: currency,
  RedirectURL: redirectUrl,
}
paymentMethod := components.CreateTransactionCreatePaymentMethodRedirectPaymentMethodCreate(redirectPaymentMethodCreate)

transactionCreate := components.TransactionCreate{
  Amount:            amount,
  Currency:          currency,
  Country:           &country,
  Intent:           gr4vy.Pointer(components.TransactionIntentCapture),
  IntegrationClient: &integrationClient,
  PaymentMethod:     &paymentMethod,
}

transaction, err := client.Transactions.Create(ctx, transactionCreate, nil, nil, nil)
```

```java Java theme={"system"}
CreateTransactionResponse transactionResponse = gr4vyClient.transactions().create()
  .transactionCreate(TransactionCreate.builder()
    .amount(1299L)
    .currency("USD")
    .country("US")
    .intent(TransactionIntent.CAPTURE)
    .integrationClient("ios")
    .paymentMethod(TransactionCreatePaymentMethod.of(RedirectPaymentMethodCreate.builder()
      .method(RedirectPaymentMethodCreateMethod.ACH)
      .country("US")
      .currency("USD")
      .redirectUrl("https://example.com/callback")
      .build()))
    .build())
  .call();

Transaction transaction = transactionResponse.transaction().orElse(null);
```

```php PHP theme={"system"}
$transactionCreate = new TransactionCreate(
  amount: 1299,
  currency: 'USD',
  country: 'US',
  intent: 'capture',
  integrationClient: 'ios',
  paymentMethod: new RedirectPaymentMethodCreate(
    method: 'ach',
    country: 'US',
    currency: 'USD',
    redirectUrl: 'myapp://callback'
  )
);
$response = self::$sdk->transactions->create($transactionCreate);
$transaction = $response->transaction;
```

```python Python theme={"system"}
transaction: models.Transaction = client.transactions.create(
  amount=1299,
  currency="USD",
  country="US",
  intent="capture",
  integration_client="ios",
  payment_method={
    "method": "ach",
    "country": "US",
    "currency": "USD",
    "redirect_url": "https://example.com/callback",
  }
)
```

```ts TypeScript theme={"system"}
const transaction = await gr4vy.transactions.create({
  amount: 1299,
  currency: "USD",
  country: "US",
  intent: "capture",
  integrationClient: "ios",
  paymentMethod: {
    method: "ach",
    country: "US",
    currency: "USD",
    redirectUrl: "https://example.com/callback"
  }
})
```

For mobile, set `integration_client` to `ios` or `android` and use your app deep link for `redirect_url` (for example, `yourapp://`).

After the transaction is created, the API response includes a `session_token` which can be used to get the [session data](https://integration.wpay.com.au/reference/transactions/get-transaction-session.md) for that transaction.

```sh theme={"system"}
POST /transactions/:transaction_id/session?token=:session_token
```

This session data provides the `sessionId` and `sessionData` required to load the Adyen SDK. Refer to the [common Adyen integration guidance](./adyen-sofort#direct-integration) for a worked example of initializing the Adyen SDK with this session data.

## Recurring payments

ACH Direct Debit via Adyen supports storing the bank account for later reuse. When you store the payment method, Gr4vy registers a recurring contract with Adyen so the stored bank account can be debited for subsequent transactions. See [Recurring payments](https://integration.wpay.com.au/guides/features/recurring-payments/overview.md) for an overview of storing and reusing payment methods.

## Testing

Adyen has [instructions](https://docs.adyen.com/payment-methods/ach-direct-debit/web-drop-in/#test-and-go-live) on how to test ACH Direct Debit.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.