# `Worldpay.APMs`
[🔗](https://github.com/iamkanishka/worldpay/blob/v1.0.0/lib/worldpay/access/apms.ex#L1)

Worldpay **APMs API** — Alternative Payment Methods.

Supports 28 APMs across eWallets, bank transfers, direct debits, BNPL,
and local card schemes.

## Supported APMs

ACH · Alipay China · Alipay HK · Alipay+ · BANCOMAT Pay · Bancontact ·
Bizum · BLIK · Canadian EFT · Euteller · iDEAL · Klarna · Konbini ·
Multibanco · MyBank · Open Banking · PayPal · PaysafeCard · Pix ·
Przelewy24 · SafetyPay · SEPA Direct Debit · Swish · Toss Pay ·
Trustly · WeChat Pay · China UnionPay

## Lifecycle actions

Follow `_actions` links from responses, or use the convenience functions:

    {:ok, _} = Worldpay.APMs.settle(payment_id, config)
    {:ok, _} = Worldpay.APMs.reverse(payment_id, config)
    {:ok, _} = Worldpay.APMs.partial_reverse(payment_id, 500, "EUR", config)

# `ach`

```elixir
@spec ach(String.t(), String.t(), String.t()) :: %{required(String.t()) =&gt; String.t()}
```

Build an ACH / eCheck payment instrument.

# `action`

```elixir
@spec action(String.t(), map(), Worldpay.Config.t()) ::
  {:ok, map()} | {:error, Worldpay.Error.t()}
```

POST to an `_actions` link returned in a previous APM response.

# `alipay`

```elixir
@spec alipay(String.t()) :: %{required(String.t()) =&gt; String.t()}
```

Build an Alipay instrument.

# `bancontact`

```elixir
@spec bancontact(keyword()) :: %{required(String.t()) =&gt; String.t()}
```

Build a Bancontact instrument.

# `blik`

```elixir
@spec blik(String.t()) :: %{required(String.t()) =&gt; String.t()}
```

Build a BLIK instrument.

# `canadian_eft`

```elixir
@spec canadian_eft(String.t(), String.t(), String.t()) :: %{
  required(String.t()) =&gt; String.t()
}
```

Build a Canadian EFT instrument.

# `get`

```elixir
@spec get(String.t(), Worldpay.Config.t()) ::
  {:ok, map()} | {:error, Worldpay.Error.t()}
```

Get APM payment status.

# `ideal`

```elixir
@spec ideal(keyword()) :: %{required(String.t()) =&gt; String.t()}
```

Build an iDEAL payment instrument.

# `klarna`

```elixir
@spec klarna(
  String.t(),
  keyword()
) :: %{required(String.t()) =&gt; term()}
```

Build a Klarna payment instrument.

# `my_bank`

```elixir
@spec my_bank(keyword()) :: %{required(String.t()) =&gt; String.t()}
```

Build a MyBank instrument.

# `open_banking`

```elixir
@spec open_banking(keyword()) :: %{required(String.t()) =&gt; String.t()}
```

Build an Open Banking instrument.

# `partial_reverse`

```elixir
@spec partial_reverse(
  String.t(),
  non_neg_integer(),
  String.t(),
  Worldpay.Config.t(),
  keyword()
) ::
  {:ok, map()} | {:error, Worldpay.Error.t()}
```

Partial reverse an APM payment.

# `partial_settle`

```elixir
@spec partial_settle(
  String.t(),
  non_neg_integer(),
  String.t(),
  Worldpay.Config.t(),
  keyword()
) ::
  {:ok, map()} | {:error, Worldpay.Error.t()}
```

Partial settle an APM payment.

# `pay`

```elixir
@spec pay(map(), Worldpay.Config.t(), keyword()) ::
  {:ok, map()} | {:error, Worldpay.Error.t()}
```

Initiate an APM payment.

# `paypal`

```elixir
@spec paypal(keyword()) :: %{required(String.t()) =&gt; String.t()}
```

Build a PayPal payment instrument.

# `pix`

```elixir
@spec pix(
  String.t(),
  keyword()
) :: %{required(String.t()) =&gt; term()}
```

Build a Pix instrument (requires Brazilian CPF document).

# `przelewy24`

```elixir
@spec przelewy24(keyword()) :: %{required(String.t()) =&gt; String.t()}
```

Build a Przelewy24 instrument.

# `reverse`

```elixir
@spec reverse(String.t(), Worldpay.Config.t(), keyword()) ::
  {:ok, map()} | {:error, Worldpay.Error.t()}
```

Reverse (cancel) an APM payment.

# `sepa`

```elixir
@spec sepa(String.t(), String.t()) :: %{required(String.t()) =&gt; String.t()}
```

Build a SEPA Direct Debit instrument.

# `settle`

```elixir
@spec settle(String.t(), Worldpay.Config.t(), keyword()) ::
  {:ok, map()} | {:error, Worldpay.Error.t()}
```

Settle an APM payment.

# `swish`

```elixir
@spec swish(String.t()) :: %{required(String.t()) =&gt; String.t()}
```

Build a Swish instrument.

# `wechat_pay`

```elixir
@spec wechat_pay() :: %{required(String.t()) =&gt; String.t()}
```

Build a WeChat Pay instrument.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
