GoCardlessClient.Resources.Refunds (GoCardlessClient v2.0.0)

Copy Markdown View Source

GoCardlessClient Refunds API.

Refunds return collected funds to a customer's bank account.

Example

{:ok, refund} = GoCardlessClient.Resources.Refunds.create(client, %{
  amount: 500,
  reference: "REFUND-001",
  metadata: %{reason: "customer_request"},
  links: %{payment: "PM123"}
}, idempotency_key: GoCardlessClient.new_idempotency_key())

Summary

Functions

Eagerly collects all refunds into a list.

Creates a refund against a payment. Pass an idempotency key for safe retries.

Retrieves a single refund by ID.

Returns a page of refunds with optional filters.

Returns a lazy Stream over all pages of refunds.

Updates a refund's metadata.

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 refunds into a list.

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

Creates a refund against a payment. Pass an idempotency key for safe retries.

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

Retrieves a single refund 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 refunds with optional filters.

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

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

Returns a lazy Stream over all pages of refunds.

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

Updates a refund's metadata.