gringotts v1.0.1 Gringotts.Gateways.Cams
An API client for the CAMS gateway. For referance you can test gateway operations [CAMS API SANDBOX] (https://secure.centralams.com).
Test it using test crediantials username:testintegrationc, password:password9
The following features of CAMS are implemented:
Purchase In
purchase/3Authorize In
authorize/3Capture In
capture/3Refund In
refund/3Void In
void/2
Link to this section Summary
Functions
Use this method for authorizing the credit card for particular transaction
Use this method for capture the amount of the authorized transaction which is previously authorized by authorize/3 method
Use this method for performing purchase(sale) operation
Use this method for refund the amount for particular transaction
Validates the config dynamically depending on what is the value of required_config
Use this method for cancel the transaction
Link to this section Functions
authorize(number(), Gringotts.CreditCard, Keyword) :: Gringotts.Response
Use this method for authorizing the credit card for particular transaction.
authorize/3 method only authorize the transaction,it does not transfer the funds.
After authorized a transaction, we need to call capture/3 method to complete the transaction.
After successful authorization it returns response containing transactionid.
We required transactionid and money for capturing transaction later on.
It perform operation by taking money, payment (credit card details) & options as parameters.
Here money is required field which contains amount to be deducted.
Required fields in credit card are Credit Card Number & Expiration Date.
Whereas options contains other information like billing address,order information etc.
Examples
payment = %{
number: "4111111111111111", month: 11, year: 2018,
first_name: "Longbob", last_name: "Longsen",
verification_code: "123", brand: "visa"
}
options = [currency: "USD"]
money = 100
iex> Gringotts.authorize(:payment_worker, Gringotts.Gateways.Cams, money, payment, options)
capture(number(), String.t(), Keyword) :: Gringotts.Response
Use this method for capture the amount of the authorized transaction which is previously authorized by authorize/3 method.
It takes money, authorization and options as parameters.
Where money is a amount to be captured and authorization is a response returned by authorize/3 method.
From response it takes transactionid for further processing.
Both money and authorization are required fields, whereas options are as same as authorize/3 and purchase/3 methods.
Examples
authorization = "3904093075"
options = [currency: "USD"]
money = 100
iex> Gringotts.capture(:payment_worker, Gringotts.Gateways.Cams, money, authorization, options)
purchase(number(), Gringotts.CreditCard, Keyword) :: Gringotts.Response
Use this method for performing purchase(sale) operation.
It perform operation by taking money, payment(credit card details) & options as parameters.
Here money is required field which contains amount to be deducted.
Required fields in credit card are Credit Card Number & Expiration Date.
Whereas options contains other information like billing address,order information etc.
After successful transaction it returns response containing transactionid.
Examples
payment = %{
number: "4111111111111111", month: 11, year: 2018,
first_name: "Longbob", last_name: "Longsen",
verification_code: "123", brand: "visa"
}
options = [currency: "USD"]
money = 100
iex> Gringotts.purchase(:payment_worker, Gringotts.Gateways.Cams, money, payment, options)
refund(number(), String.t(), Keyword) :: Gringotts.Response
Use this method for refund the amount for particular transaction.
Successful transaction can be refunded after settlement or any time.
It requires transactionid for refund the specified amount back to authorized payment source.
Only purchased(sale) transactions can be refund based on thier transactionid.
It takes money, authorization and options as parameters.
Where money is a amount to be refund and authorization is a response returned by purchase/3 method.
From response it takes transactionid for further processing.
Both money and authorization are required fields, whereas options are as same as authorize/3, purchase/3 and capture/3 methods.
Examples
authorization = "3904093078"
options = [currency: "USD"]
money = 100
iex> Gringotts.refund(:payment_worker, Gringotts.Gateways.Cams, money, authorization, options)
Validates the config dynamically depending on what is the value of required_config
Use this method for cancel the transaction.
It is use to cancel the purchase(sale) transaction before settlement.
Authorised transaction can be canceled, but once it captured, it can not be canceled.
It requires transactionid to cancle transaction.Amount is returned to the authorized payment source.
Examples
authorization = "3904093075"
options = []
iex> Gringotts.void(:payment_worker, Gringotts.Gateways.Cams, authorization, options)