Class: SolidusSixSaferpay::TransactionGateway
- Defined in:
- lib/solidus_six_saferpay/transaction_gateway.rb
Instance Method Summary collapse
-
#authorize(_amount, saferpay_payment, options = {}) ⇒ Object
NOTE: Saferpay does not allow authorization for partial amounts.
- #inquire(saferpay_payment, options = {}) ⇒ Object
Methods inherited from Gateway
#capture, #credit, #initialize, #initialize_payment, #purchase, #refund, #try_void, #void
Constructor Details
This class inherits a constructor from SolidusSixSaferpay::Gateway
Instance Method Details
#authorize(_amount, saferpay_payment, options = {}) ⇒ Object
NOTE: Saferpay does not allow authorization for partial amounts. Therefore, the given amount is ignored
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/solidus_six_saferpay/transaction_gateway.rb', line 19 def (_amount, saferpay_payment, = {}) = SixSaferpay::SixTransaction::Authorize.new(token: saferpay_payment.token) = SixSaferpay::Client.post() response( true, "Saferpay Transaction authorize response: #{.to_h}", ) rescue SixSaferpay::Error => e handle_error(e, ) end |
#inquire(saferpay_payment, options = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/solidus_six_saferpay/transaction_gateway.rb', line 4 def inquire(saferpay_payment, = {}) transaction_inquire = SixSaferpay::SixTransaction::Inquire.new(transaction_reference: saferpay_payment.transaction_id) inquire_response = SixSaferpay::Client.post(transaction_inquire) response( true, "Saferpay Transaction inquire response: #{inquire_response.to_h}", inquire_response ) rescue SixSaferpay::Error => e handle_error(e, inquire_response) end |