gringotts v0.0.2 Gringotts.Gateways.WireCard

WireCard System Plugins

Link to this section Summary

Functions

Authorization - the second parameter may be a CreditCard or a String which represents a GuWID reference to an earlier transaction. If a GuWID is given, rather than a CreditCard, then then the :recurring option will be forced to “Repeated” =========================================================== TODO: Mandatorily check for :login,:password, :signature in options Note: payment_menthod for now is only credit_card and TODO: change it so it can also have GuWID ================================================ E.g: => creditcard = %CreditCard{

number: "4200000000000000",
month: 12,
year: 2018,
first_name: "Longbob",
last_name: "Longsen",
verification_code: "123",
brand: "visa"

} address = %{

name:     "Jim Smith",
address1: "456 My Street",
address2: "Apt 1",
company:  "Widgets Inc",
city:     "Ottawa",
state:    "ON",
zip:      "K1C2N6",
country:  "CA",
phone:    "(555)555-5555",
fax:      "(555)555-6666"

} options = [

config: %{
  login: "00000031629CA9FA", 
  password: "TestXAPTER",
  signature: "00000031629CAFD5",
},   
order_id: 1,
billing_address: address,
description: 'Wirecard remote test purchase',
email: "soleone@example.com",
ip: "127.0.0.1",
test: true

]

Capture - the first paramter here should be a GuWid/authorization. Authorization is obtained by authorizing the creditcard

Purchase - the second parameter may be a CreditCard or a String which represents a GuWID reference to an earlier transaction. If a GuWID is given, rather than a CreditCard, then then the :recurring option will be forced to “Repeated”

Store card - Wirecard supports the notion of “Recurring Transactions” by allowing the merchant to provide a reference to an earlier transaction (the GuWID) rather than a credit card. A reusable reference (GuWID) can be obtained by sending a purchase or authorization transaction with the element “RECURRING_TRANSACTION/Type” set to “Initial”. Subsequent transactions can then use the GuWID in place of a credit card by setting “RECURRING_TRANSACTION/Type” to “Repeated”

Validates the config dynamically depending on what is the value of required_config

Void - A credit card purchase that a seller cancels after it has

  been authorized but before it has been settled. 
  A void transaction does not appear on the customer's 
  credit card statement, though it might appear in a list
  of pending transactions when the customer checks their 
  account online.

==== Parameters ====== identification - The authorization string returned from the

              initial authorization or purchase

Link to this section Functions

Link to this function add_action_data(action, money, options)
Link to this function add_invoice(money, options)
Link to this function authorize(money, payment_method, options)
authorize(Integer | Float, Gringotts.CreditCard | String.t(), Keyword) :: {:ok, Map}

Authorization - the second parameter may be a CreditCard or a String which represents a GuWID reference to an earlier transaction. If a GuWID is given, rather than a CreditCard, then then the :recurring option will be forced to “Repeated” =========================================================== TODO: Mandatorily check for :login,:password, :signature in options Note: payment_menthod for now is only credit_card and TODO: change it so it can also have GuWID ================================================ E.g: => creditcard = %CreditCard{

number: "4200000000000000",
month: 12,
year: 2018,
first_name: "Longbob",
last_name: "Longsen",
verification_code: "123",
brand: "visa"

} address = %{

name:     "Jim Smith",
address1: "456 My Street",
address2: "Apt 1",
company:  "Widgets Inc",
city:     "Ottawa",
state:    "ON",
zip:      "K1C2N6",
country:  "CA",
phone:    "(555)555-5555",
fax:      "(555)555-6666"

} options = [

config: %{
  login: "00000031629CA9FA", 
  password: "TestXAPTER",
  signature: "00000031629CAFD5",
},   
order_id: 1,
billing_address: address,
description: 'Wirecard remote test purchase',
email: "soleone@example.com",
ip: "127.0.0.1",
test: true

]

Link to this function capture(authorization, money, options)
capture(String.t(), Float, Keyword) :: {:ok, Map}

Capture - the first paramter here should be a GuWid/authorization. Authorization is obtained by authorizing the creditcard.

Link to this function purchase(money, payment_method, options)
purchase(Float | Integer, Gringotts.CreditCard | String.t(), Keyword) :: {:ok, Map}

Purchase - the second parameter may be a CreditCard or a String which represents a GuWID reference to an earlier transaction. If a GuWID is given, rather than a CreditCard, then then the :recurring option will be forced to “Repeated”

Link to this function refund(money, identification, options)
refund(Float, String.t(), Keyword) :: {:ok, Map}

Performs a credit.

This transaction indicates that money should flow from the merchant to the customer. ==== Parameters ==== money — The amount to be credited to the customer

                as an Integer value in cents.

identification — GuWID

Link to this function store(creditcard, options)
store(Gringotts.CreditCard, Keyword) :: {:ok, Map}

Store card - Wirecard supports the notion of “Recurring Transactions” by allowing the merchant to provide a reference to an earlier transaction (the GuWID) rather than a credit card. A reusable reference (GuWID) can be obtained by sending a purchase or authorization transaction with the element “RECURRING_TRANSACTION/Type” set to “Initial”. Subsequent transactions can then use the GuWID in place of a credit card by setting “RECURRING_TRANSACTION/Type” to “Repeated”.

This implementation of card store utilizes a Wirecard “Authorization Check” (a Preauthorization that is automatically reversed). It defaults to a check amount of “100” (i.e. $1.00) but this can be overriden (see below).

IMPORTANT: In order to reuse the stored reference, the +authorization+ from the response should be saved by your application code.

==== Options specific to +store+

  • :amount — The amount, in cents, that should be “validated” by the Authorization Check. This amount will be reserved and then reversed. Default is 100.

    Note: This is not the only way to achieve a card store operation at Wirecard. Any +purchase+ or +authorize+ can be sent with +options[:recurring] = ‘Initial’+ to make the returned authorization/GuWID usable in later transactions with +options[:recurring] = ‘Repeated’+.

Link to this function validate_config(config)

Validates the config dynamically depending on what is the value of required_config

Link to this function void(identification, options)
void(String.t(), Keyword) :: {:ok, Map}

Void - A credit card purchase that a seller cancels after it has

  been authorized but before it has been settled. 
  A void transaction does not appear on the customer's 
  credit card statement, though it might appear in a list
  of pending transactions when the customer checks their 
  account online.

==== Parameters ====== identification - The authorization string returned from the

              initial authorization or purchase.