Braintree.PaymentMethodNonce (Braintree v0.16.0)

Create a payment method nonce from an existing payment method token

Summary

Functions

Create a payment method nonce from token

Find a payment method nonce, or return an error response if token invalid

Types

t()

@type t() :: %Braintree.PaymentMethodNonce{
  consumed: boolean(),
  default: String.t(),
  description: String.t(),
  details: map(),
  is_locked: boolean(),
  nonce: String.t(),
  security_questions: [any()],
  three_d_secure_info: String.t(),
  type: String.t()
}

Functions

create(payment_method_token, opts \\ [])

@spec create(String.t(), Keyword.t()) :: {:ok, t()} | Braintree.HTTP.error()

Create a payment method nonce from token

Example

{:ok, payment_method_nonce} = Braintree.PaymentMethodNonce.create(token)

payment_method_nonce.nonce

find(nonce, opts \\ [])

@spec find(String.t(), Keyword.t()) :: {:ok, t()} | Braintree.HTTP.error()

Find a payment method nonce, or return an error response if token invalid

Example

{:ok, payment_method} = Braintree.PaymentMethodNonce.find(token)

payment_method.type #CreditCard