TreasuryPrime.DigitalWalletToken (TreasuryPrime v1.0.0)

Copy Markdown View Source

Represents a card provisioned into a mobile digital wallet (Apple Pay / Google Pay) — called a "Token" in the Treasury Prime API reference, and reachable at the digital_wallet_token path.

Tokens aren't created directly; they're the result of walking a customer through Apple's/Google's in-wallet provisioning flow, which involves your client app, Apple's/Google's servers, and Treasury Prime. See provision_with_apple_pay/3 and provision_with_google_pay/3 for the Treasury Prime side of that handshake — you forward their response to the respective wallet's SDK as-is.

See also the Digital Wallet Notifications guide for proactively alerting cardholders when a card is added to a wallet (a common fraud signal).

Summary

Functions

Fetches a single digital wallet token by id.

Lists digital wallet tokens.

Performs the Treasury Prime side of Apple Pay in-app provisioning for card_id. params should include the encrypted certificates/nonce data Apple's PKAddPaymentPassRequest flow gave your client app. Forward the response verbatim to that flow.

Performs the Treasury Prime side of Google Pay in-app provisioning for card_id. params should include the data Google's push-provisioning API gave your client app. Forward the response verbatim to that flow.

Updates a digital wallet token (e.g. to "suspended" or "deactivated").

Types

t()

@type t() :: %TreasuryPrime.DigitalWalletToken{
  card_id: String.t() | nil,
  created_at: String.t() | nil,
  device_type: String.t() | nil,
  id: String.t() | nil,
  status: String.t() | nil,
  updated_at: String.t() | nil,
  wallet_provider: String.t() | nil
}

Functions

get(client, id)

@spec get(TreasuryPrime.Client.t(), String.t()) ::
  {:ok, t()} | {:error, TreasuryPrime.Error.t()}

Fetches a single digital wallet token by id.

get!(client, id)

@spec get!(TreasuryPrime.Client.t(), String.t()) :: t()

list(client, params \\ %{})

@spec list(TreasuryPrime.Client.t(), map()) ::
  {:ok, TreasuryPrime.Page.t()} | {:error, TreasuryPrime.Error.t()}

Lists digital wallet tokens.

Filterable params

card_id, status.

list!(client, params \\ %{})

provision_with_apple_pay(client, card_id, params)

@spec provision_with_apple_pay(TreasuryPrime.Client.t(), String.t(), map()) ::
  {:ok, map()} | {:error, TreasuryPrime.Error.t()}

Performs the Treasury Prime side of Apple Pay in-app provisioning for card_id. params should include the encrypted certificates/nonce data Apple's PKAddPaymentPassRequest flow gave your client app. Forward the response verbatim to that flow.

provision_with_google_pay(client, card_id, params)

@spec provision_with_google_pay(TreasuryPrime.Client.t(), String.t(), map()) ::
  {:ok, map()} | {:error, TreasuryPrime.Error.t()}

Performs the Treasury Prime side of Google Pay in-app provisioning for card_id. params should include the data Google's push-provisioning API gave your client app. Forward the response verbatim to that flow.

update(client, id, params)

@spec update(TreasuryPrime.Client.t(), String.t(), map()) ::
  {:ok, t()} | {:error, TreasuryPrime.Error.t()}

Updates a digital wallet token (e.g. to "suspended" or "deactivated").

update!(client, id, params)

@spec update!(TreasuryPrime.Client.t(), String.t(), map()) :: t()