gringotts v0.0.2 Gringotts.Gateways.Paymill
An Api Client for the PAYMILL gateway.
For refernce see PAYMILL’s API (v2.1) documentation
The following features of PAYMILL are implemented:
Action | Method |
---|---|
Authorize | authorize/3 |
Capture | capture/3 |
Purchase | purchase/3 |
Void | void/2 |
Following fields are required for config
Config Parameter | PAYMILL secret |
private_key | your_private_key |
public_key | your_public_key |
Your application config must include ‘private_key’, ‘public_key’
config :gringotts, Gringotts.Gateways.Paymill,
adapter: Gringotts.Gateways.Paymill,
private_key: "your_privat_key",
public_key: "your_public_key"
Link to this section Summary
Functions
Authorize a card with particular amount and return a token in response
Capture a particular amount with authorization token
Purchase with a card
Validates the config dynamically depending on what is the value of required_config
Voids a particular authorized amount
Link to this section Functions
authorize(number(), String.t() | Gringotts.CreditCard, Keyword) :: {:ok | :error, Gringotts.Response}
Authorize a card with particular amount and return a token in response
Example
amount = 100
card = %CreditCard{
first_name: "Sagar",
last_name: "Karwande",
number: "4111111111111111",
month: 12,
year: 2018,
verification_code: 123
}
options = []
iex> Gringotts.authorize(:payment_worker, Gringotts.Gateways.Paymill, amount, card, options)
capture(String.t(), number(), Keyword) :: {:ok | :error, Gringotts.Response}
Capture a particular amount with authorization token
Example
amount = 100
token = "preauth_14c7c5268eb155a599f0"
options = []
iex> Gringotts.capture(:payment_worker, Gringotts.Gateways.Paymill, token, amount, options)
purchase(number(), Gringotts.CreditCard, Keyword) :: {:ok | :error, Gringotts.Response}
Purchase with a card
Example
amount = 100
card = %CreditCard{
first_name: "Sagar",
last_name: "Karwande",
number: "4111111111111111",
month: 12,
year: 2018,
verification_code: 123
}
options = []
iex> Gringotts.purchase(:payment_worker, Gringotts.Gateways.Paymill, amount, card, options)
Validates the config dynamically depending on what is the value of required_config
void(String.t(), Keyword) :: {:ok | :error, Gringotts.Response}
Voids a particular authorized amount
Example
token = "preauth_14c7c5268eb155a599f0"
options = []
iex> Gringotts.void(:payment_worker, Gringotts.Gateways.Paymill, token, options)