ex_openpay v0.1.2 ExOpenpay.Tokens

Functions for working with tokens at Openpay. Through this API you can:

  • create a token,
  • get a token,

Openpay API reference: https://www.openpay.mx/docs/api/?shell#tokens

Link to this section Summary

Functions

Create a token. Creates a token for ID using params.

  • object,
  • number,
  • cvv2,
  • expiration_month,
  • expiration_year. Returns a {:ok, token} tuple.

Examples

params = [
  token_number: "4111111111111111",
  holder_name: "Juan Perez Ramirez",
  expiration_year: "20",
  expiration_month: "12",
  cvv2: "110"
  # device_session_id: "",
]
{:ok, token} = ExOpenpay.Cards.create(:customer, customer_id, params)

Create a token. Accepts ExOpenpay API key. Creates a token for given owner using params.

  • object,
  • number,
  • cvv2,
  • expiration_month,
  • expiration_year. Returns a {:ok, token} tuple.

Examples

{:ok, token} = ExOpenpay.Cards.create(:customer, customer_id, params, key)

Get a token. Gets a token for given owner using token ID. Returns a {:ok, token} tuple.

Examples

{:ok, token} = ExOpenpay.Cards.get(:customer, customer_id, token_id)

Get a token. Accepts ExOpenpay API key. Gets a token for given owner using token ID. Returns a {:ok, token} tuple.

Examples

{:ok, token} = ExOpenpay.Cards.get(:customer, customer_id, token_id, key)

Link to this section Functions

Create a token. Creates a token for ID using params.

  • object,
  • number,
  • cvv2,
  • expiration_month,
  • expiration_year. Returns a {:ok, token} tuple.

Examples

params = [
  token_number: "4111111111111111",
  holder_name: "Juan Perez Ramirez",
  expiration_year: "20",
  expiration_month: "12",
  cvv2: "110"
  # device_session_id: "",
]
{:ok, token} = ExOpenpay.Cards.create(:customer, customer_id, params)
Link to this function create(params, key)

Create a token. Accepts ExOpenpay API key. Creates a token for given owner using params.

  • object,
  • number,
  • cvv2,
  • expiration_month,
  • expiration_year. Returns a {:ok, token} tuple.

Examples

{:ok, token} = ExOpenpay.Cards.create(:customer, customer_id, params, key)

Get a token. Gets a token for given owner using token ID. Returns a {:ok, token} tuple.

Examples

{:ok, token} = ExOpenpay.Cards.get(:customer, customer_id, token_id)

Get a token. Accepts ExOpenpay API key. Gets a token for given owner using token ID. Returns a {:ok, token} tuple.

Examples

{:ok, token} = ExOpenpay.Cards.get(:customer, customer_id, token_id, key)