Paidy.Token (paidy v0.2.2)
API for working with Token at Paidy. Through this API you can:
- suspend a token
- resume a token
- delete a token
- get a token
- get all tokens
tokens for credit card allowing you to use instead of a credit card number in various operations.
Link to this section Summary
Functions
Retrieve all tokens..
Retrieve all tokens using given api key.
Delete a token. You can set a delete reason code from the following.
Delete a token by its id using given api key.
Retrieve a token by its id. Returns 404 if not found.
Retrieve a token by its id using given api key.
Resume a token. You can set a resume reason code from the following.
Resume a token by its id using given api key.
Suspend a token. You can set a suspend reason code from the following.
Suspend a token by its id using given api key.
Link to this section Functions
all()
Retrieve all tokens..
Example
{:ok, tokens} = Paidy.Token.all
all(key)
Retrieve all tokens using given api key.
Example
{:ok, tokens} = Paidy.Token.all, key
delete(id, params)
Delete a token. You can set a delete reason code from the following.
consumer.requested
subscription.expired
merchant.requested
fraud.detected
general
Example
params = %{
reason: %{
code: "consumer.requested",
description: "Token was deleted because consumer canceled the subscription"
}
}
{:ok, token} = Paidy.Token.delete "token_id", params
delete(id, params, key)
Delete a token by its id using given api key.
Example
params = %{
reason: %{
code: "consumer.requested",
description: "Token was deleted because consumer canceled the subscription"
}
}
{:ok, token} = Paidy.Token.delete "token_id", params, key
get(id)
Retrieve a token by its id. Returns 404 if not found.
Example
{:ok, token} = Paidy.Token.get "token_id"
get(id, key)
Retrieve a token by its id using given api key.
Example
{:ok, token} = Paidy.Token.get "token_id", key
resume(id, params)
Resume a token. You can set a resume reason code from the following.
consumer.requested
merchant.requested
general
Example
params = %{
reason: %{
code: "merchant.requested",
description: "Token is being resumed because the subscription item is back in stock"
}
}
{:ok, token} = Paidy.Token.resume "token_id", params
resume(id, params, key)
Resume a token by its id using given api key.
Example
params = %{
reason: {
code: "merchant.requested",
description: "Token is being resumed because the subscription item is back in stock"
}
}
{:ok, token} = Paidy.Token.resume "token_id", params, key
suspend(id, params)
Suspend a token. You can set a suspend reason code from the following.
consumer.requested
merchant.requested
fraud.suspected
general
Example
params = %{
reason: %{
code: "fraud.suspected",
description: "Token suspended because fraud suspected."
}
}
{:ok, token} = Paidy.Token.suspend "token_id", params
suspend(id, params, key)
Suspend a token by its id using given api key.
Example
params = %{
reason: %{
code: "fraud.suspected",
description: "Token suspended because fraud suspected."
}
}
{:ok, token} = Paidy.Token.suspend "token_id", params, key