Module ActiveMerchant::Billing::Integrations::Gestpay::Common
In: lib/active_merchant/billing/integrations/gestpay/common.rb

Methods

Constants

VERSION = "2.0"
ENCRYPTION_PATH = "/CryptHTTPS/Encrypt.asp"
DECRYPTION_PATH = "/CryptHTTPS/Decrypt.asp"
DELIMITER = '*P1*'
CURRENCY_MAPPING = { 'EUR' => '242', 'ITL' => '18', 'BRL' => '234', 'USD' => '1', 'JPY' => '71', 'HKD' => '103'

Public Instance methods

[Source]

    # File lib/active_merchant/billing/integrations/gestpay/common.rb, line 20
20:           def parse_response(response)
21:             case response
22:             when /#cryptstring#(.*)#\/cryptstring#/, /#decryptstring#(.*)#\/decryptstring#/
23:               $1
24:             when /#error#(.*)#\/error#/
25:               raise StandardError, "An error occurred retrieving the encrypted string from GestPay: #{$1}"
26:             else
27:               raise StandardError, "No response was received by GestPay"
28:             end
29:           end

[Source]

    # File lib/active_merchant/billing/integrations/gestpay/common.rb, line 31
31:           def ssl_get(url, path)
32:             uri = URI.parse(url)
33:             site = Net::HTTP.new(uri.host, uri.port)
34:             site.use_ssl = true
35:             site.verify_mode    = OpenSSL::SSL::VERIFY_NONE
36:             site.get(path).body
37:           end

[Validate]