Inttegro.PaymentMethods (inttegro v0.2.0)

Copy Markdown View Source

Saves and manages customer-owned payment methods.

A payment method always belongs to its attached customer. Tokenization may start a verification flow; inspect the returned verification state before attempting a charge. The API returns masked or provider-safe details and never returns raw reusable credentials.

Summary

Functions

Mark an inactive payment method as active so it can be reused in new payment flows.

Archive a payment method. Archived payment methods become inactive immediately and reject further updates until they are unarchived.

Mark an active payment method as inactive so it cannot be reused in new payment flows until reactivated.

Retrieve details for a specific payment method by ID. Returns the full payment method object including verification status, creation timestamp, masked account details, and owner details when captured.

Retrieve a paginated list of payment methods for the authenticated application. If customer_id is supplied, the page is scoped to payment methods that belong to that customer. The supplied customer must belong to your authenticated application.

Retrieve payment method acceptance settings for your application. Returns configuration for all supported payment types (mobile money, bank accounts, cards, Motito) including whether each type is enabled and requires customer confirmation. Use this to: - Show only enabled payment methods in checkout - Require explicit consent when confirms_use is true - Display acceptance preferences to merchants

Save a mobile-money payment method for an existing customer without charging it. Direct tokenization currently supports mobile_money; send the wallet details and owner identity described by the request schema. The returned payment method can be reused only while it is active, unarchived, and non-ephemeral. This operation supports idempotency.

Unarchive an archived payment method so it can be updated again. Unarchiving does not automatically reactivate the payment method.

Update mutable payment method metadata for the authenticated application. Supported updates: - custom_data merges into existing metadata - owner applies patch semantics and updates only the provided owner fields - active toggles whether the payment method can be reused - archived archives or unarchives the payment method Custom Data Merge Semantics: - New keys are added to existing custom_data - Existing keys are updated with new values - JSON null explicitly deletes the key - Keys not present in the update are preserved When adding a new owner address to a payment method that does not already have one, owner.address.country is required. Archived payment methods reject all updates except a pure unarchive request. Unarchiving leaves the payment method inactive until you activate it again.

Functions

activate(client, request, options \\ [])

Mark an inactive payment method as active so it can be reused in new payment flows.

Parameters

Returns

Returns {:ok, Inttegro.PaymentMethods.PaymentMethod.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

request = Inttegro.PaymentMethods.ActivateRequest.new!(request_attributes)

case Inttegro.PaymentMethods.activate(client, request) do
  {:ok, result} -> result
  {:error, error} -> {:error, error}
end

archive(client, request, options \\ [])

Archive a payment method. Archived payment methods become inactive immediately and reject further updates until they are unarchived.

Parameters

Returns

Returns {:ok, Inttegro.PaymentMethods.PaymentMethod.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

request = Inttegro.PaymentMethods.ArchiveRequest.new!(request_attributes)

case Inttegro.PaymentMethods.archive(client, request) do
  {:ok, result} -> result
  {:error, error} -> {:error, error}
end

deactivate(client, request, options \\ [])

Mark an active payment method as inactive so it cannot be reused in new payment flows until reactivated.

Parameters

Returns

Returns {:ok, Inttegro.PaymentMethods.PaymentMethod.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

request = Inttegro.PaymentMethods.DisactivateRequest.new!(request_attributes)

case Inttegro.PaymentMethods.deactivate(client, request) do
  {:ok, result} -> result
  {:error, error} -> {:error, error}
end

lookup(client, request, options \\ [])

Retrieve details for a specific payment method by ID. Returns the full payment method object including verification status, creation timestamp, masked account details, and owner details when captured.

Parameters

Returns

Returns {:ok, Inttegro.PaymentMethods.PaymentMethod.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

request = Inttegro.PaymentMethods.LookupRequest.new!(request_attributes)

case Inttegro.PaymentMethods.lookup(client, request) do
  {:ok, result} -> result
  {:error, error} -> {:error, error}
end

page(client, request, options \\ [])

Retrieve a paginated list of payment methods for the authenticated application. If customer_id is supplied, the page is scoped to payment methods that belong to that customer. The supplied customer must belong to your authenticated application.

Parameters

Returns

Returns {:ok, Inttegro.PaymentMethods.Page.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

request = Inttegro.PaymentMethods.PageRequest.new!(request_attributes)

case Inttegro.PaymentMethods.page(client, request) do
  {:ok, result} -> result
  {:error, error} -> {:error, error}
end

settings(client, options \\ [])

@spec settings(Inttegro.Client.t(), keyword()) ::
  {:ok, Inttegro.PaymentMethods.Settings.t()} | {:error, Exception.t()}

Retrieve payment method acceptance settings for your application. Returns configuration for all supported payment types (mobile money, bank accounts, cards, Motito) including whether each type is enabled and requires customer confirmation. Use this to: - Show only enabled payment methods in checkout - Require explicit consent when confirms_use is true - Display acceptance preferences to merchants

Parameters

  • client — an authenticated Inttegro.Client.
  • options — request options such as :idempotency_key and additional :headers.

Returns

Returns {:ok, Inttegro.PaymentMethods.Settings.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

Inttegro.PaymentMethods.settings(client)

tokenize(client, request, options \\ [])

Save a mobile-money payment method for an existing customer without charging it. Direct tokenization currently supports mobile_money; send the wallet details and owner identity described by the request schema. The returned payment method can be reused only while it is active, unarchived, and non-ephemeral. This operation supports idempotency.

Parameters

Returns

Returns {:ok, Inttegro.PaymentMethods.PaymentMethod.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

request = Inttegro.PaymentMethods.TokenizeMobileMoneyRequest.new!(request_attributes)

case Inttegro.PaymentMethods.tokenize(client, request) do
  {:ok, result} -> result
  {:error, error} -> {:error, error}
end

unarchive(client, request, options \\ [])

Unarchive an archived payment method so it can be updated again. Unarchiving does not automatically reactivate the payment method.

Parameters

Returns

Returns {:ok, Inttegro.PaymentMethods.PaymentMethod.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

request = Inttegro.PaymentMethods.UnarchiveRequest.new!(request_attributes)

case Inttegro.PaymentMethods.unarchive(client, request) do
  {:ok, result} -> result
  {:error, error} -> {:error, error}
end

update(client, request, options \\ [])

Update mutable payment method metadata for the authenticated application. Supported updates: - custom_data merges into existing metadata - owner applies patch semantics and updates only the provided owner fields - active toggles whether the payment method can be reused - archived archives or unarchives the payment method Custom Data Merge Semantics: - New keys are added to existing custom_data - Existing keys are updated with new values - JSON null explicitly deletes the key - Keys not present in the update are preserved When adding a new owner address to a payment method that does not already have one, owner.address.country is required. Archived payment methods reject all updates except a pure unarchive request. Unarchiving leaves the payment method inactive until you activate it again.

Parameters

Returns

Returns {:ok, Inttegro.PaymentMethods.PaymentMethod.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

request = Inttegro.PaymentMethods.UpdateRequest.new!(request_attributes)

case Inttegro.PaymentMethods.update(client, request) do
  {:ok, result} -> result
  {:error, error} -> {:error, error}
end