Braintree.PaymentMethodNonce (Braintree v0.13.0)

Create a payment method nonce from an existing payment method token

Link to this section Summary

Functions

Create a payment method nonce from token

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

Link to this section Types

@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()
}

Link to this section Functions

Link to this function

create(payment_method_token, opts \\ [])

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

Create a payment method nonce from token

example

Example

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

payment_method_nonce.nonce
Link to this function

find(nonce, opts \\ [])

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

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

example

Example

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

payment_method.type #CreditCard