Braintree v0.7.0 Braintree.PaymentMethodNonce

Create a payment method nonce from an existing payment method token

Summary

Functions

Convert a response into one or more typed structs

Create a payment method nonce from token

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

Types

t :: %Braintree.PaymentMethodNonce{consumed: boolean, default: String.t, description: String.t, details: Map.t, is_locked: boolean, nonce: String.t, security_questions: [], three_d_secure_info: String.t, type: String.t}

Functions

construct(params)

Specs

construct(Map.t | [Map.t]) :: t | [t]

Convert a response into one or more typed structs.

create(payment_method_token)

Specs

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

Create a payment method nonce from token

Example

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

payment_method_nonce.nonce
find(nonce)

Specs

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

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