Class: Payline::Client
- Inherits:
-
Object
- Object
- Payline::Client
- Defined in:
- lib/payline/client.rb
Instance Method Summary collapse
- #capture(reserve_response, amount) ⇒ Object
- #debit(guid, amount, credit_card) ⇒ Object
-
#initialize(config) ⇒ Client
constructor
A new instance of Client.
- #reserve(guid, amount, credit_card) ⇒ Object
- #reverse(reserve_response, amount) ⇒ Object
Constructor Details
permalink #initialize(config) ⇒ Client
Returns a new instance of Client.
4 5 6 7 |
# File 'lib/payline/client.rb', line 4 def initialize(config) @config = config @response_handler = Payline::ResponseHandler.new end |
Instance Method Details
permalink #capture(reserve_response, amount) ⇒ Object
[View source]
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/payline/client.rb', line 17 def capture(reserve_response, amount) params = { 'PRESENTATION.CURRENCY' => @config.currency, 'PAYMENT.CODE' => "CC.CP", 'PRESENTATION.AMOUNT' => amount, 'IDENTIFICATION.TRANSACTIONID'=>reserve_response.merchant_reference, 'IDENTIFICATION.REFERENCEID'=> reserve_response.transaction_id } do_request(params) end |
permalink #debit(guid, amount, credit_card) ⇒ Object
[View source]
9 10 11 |
# File 'lib/payline/client.rb', line 9 def debit(guid, amount, credit_card) proccess("CC.DB", guid, amount, credit_card) end |
permalink #reserve(guid, amount, credit_card) ⇒ Object
[View source]
13 14 15 |
# File 'lib/payline/client.rb', line 13 def reserve(guid, amount, credit_card) proccess("CC.PA", guid, amount, credit_card) end |
permalink #reverse(reserve_response, amount) ⇒ Object
[View source]
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/payline/client.rb', line 29 def reverse(reserve_response, amount) params = { 'PRESENTATION.CURRENCY' => @config.currency, 'PAYMENT.CODE' => "CC.RV", 'PRESENTATION.AMOUNT' => amount, 'IDENTIFICATION.TRANSACTIONID'=> reserve_response.merchant_reference, 'IDENTIFICATION.REFERENCEID'=> reserve_response.transaction_id } do_request(params) end |