GoCardlessClient.Resources.PayerAuthorisations (GoCardlessClient v2.0.0)

Copy Markdown View Source

GoCardless Payer Authorisations API (Legacy).

This is a legacy API. New integrations should use GoCardlessClient.Resources.BillingRequests instead, which supports Open Banking, fallback flows, and custom UIs.

Payer Authorisations collect mandate authorisation in a single object. They do not support Open Banking.

States

createdsubmittedcompleted / failed

Example

{:ok, pa} = GoCardlessClient.Resources.PayerAuthorisations.create(client, %{
  payer: %{email: "alice@example.com"},
  bank_account: %{
    account_holder_name: "Alice Smith",
    account_number: "55779911",
    branch_code: "200000",
    country_code: "GB"
  },
  mandate: %{scheme: "bacs"}
})

{:ok, _} = GoCardlessClient.Resources.PayerAuthorisations.submit(client, pa["id"])
{:ok, _} = GoCardlessClient.Resources.PayerAuthorisations.confirm(client, pa["id"])

Summary

Functions

Eagerly collects all Payer Authorisations into a list.

Confirms a Payer Authorisation after the customer has approved.

Creates a Payer Authorisation with customer, bank account, and mandate details.

Retrieves a single Payer Authorisation by ID.

Returns a page of Payer Authorisations with optional filters.

Returns a lazy Stream over all pages of Payer Authorisations.

Submits a Payer Authorisation for customer approval.

Updates a Payer Authorisation with revised customer, bank account, or mandate details.

Functions

collect_all(client, params \\ %{}, opts \\ [])

@spec collect_all(GoCardlessClient.Client.t(), map(), keyword()) ::
  {:ok, [map()]}
  | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}

Eagerly collects all Payer Authorisations into a list.

confirm(client, id, params \\ %{}, opts \\ [])

Confirms a Payer Authorisation after the customer has approved.

create(client, params, opts \\ [])

Creates a Payer Authorisation with customer, bank account, and mandate details.

get(client, id, opts \\ [])

Retrieves a single Payer Authorisation by ID.

list(client, params \\ %{}, opts \\ [])

@spec list(GoCardlessClient.Client.t(), map(), keyword()) ::
  {:ok, %{items: [map()], meta: map()}}
  | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}

Returns a page of Payer Authorisations with optional filters.

stream(client, params \\ %{}, opts \\ [])

@spec stream(GoCardlessClient.Client.t(), map(), keyword()) :: Enumerable.t()

Returns a lazy Stream over all pages of Payer Authorisations.

submit(client, id, params \\ %{}, opts \\ [])

Submits a Payer Authorisation for customer approval.

update(client, id, params, opts \\ [])

Updates a Payer Authorisation with revised customer, bank account, or mandate details.