payjp v0.1.3 Payjp.Tokens

API for working with Tokens at Payjp. Through this API you can: -create -retrieve tokens for credit card allowing you to use instead of a credit card number in various operations.

(API ref https://pay.jp/docs/api/#token-トークン)

Summary

Functions

Creates a token. ##Example

   # payload for credit card token
    params = [
          card: [
              number: "4242424242424242",
              exp_month: 8,
              exp_year: 2016,
              cvc: "314"
          ]
    ]

Creates a token using given api key. ##Example

...
{:ok, token} = Payjp.Tokens.create params, key
...

Retrieve a token by its id. Returns 404 if not found.

Example

Retrieve a token by its id using given api key.

Example

Functions

create(params)

Creates a token. ##Example

   # payload for credit card token
    params = [
          card: [
              number: "4242424242424242",
              exp_month: 8,
              exp_year: 2016,
              cvc: "314"
          ]
    ]

   {:ok, token} = Payjp.Tokens.create params
   IO.puts token.id
create(params, key)

Creates a token using given api key. ##Example

...
{:ok, token} = Payjp.Tokens.create params, key
...
get(id)

Retrieve a token by its id. Returns 404 if not found.

Example

{:ok, token} = Payjp.Tokens.get "token_id"
get(id, key)

Retrieve a token by its id using given api key.

Example

{:ok, token} = Payjp.Tokens.get "token_id", key