Sha256: 9c4c9904038dfa1cb075b421b3582009c1224e41a6fd09e9064fa6c8210e6d25

Contents?: true

Size: 1.24 KB

Versions: 184

Compression:

Stored size: 1.24 KB

Contents

module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    module Integrations #:nodoc:
      module Gestpay
        module Common
          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'
          }
          
          def parse_response(response)
            case response
            when /#cryptstring#(.*)#\/cryptstring#/, /#decryptstring#(.*)#\/decryptstring#/
              $1
            when /#error#(.*)#\/error#/
              raise StandardError, "An error occurred retrieving the encrypted string from GestPay: #{$1}"
            else
              raise StandardError, "No response was received by GestPay"
            end
          end
          
          def ssl_get(url, path)
            uri = URI.parse(url)
            site = Net::HTTP.new(uri.host, uri.port)
            site.use_ssl = true
            site.verify_mode    = OpenSSL::SSL::VERIFY_NONE
            site.get(path).body
          end
        end
      end
    end
  end
end

Version data entries

184 entries across 184 versions & 35 rubygems

Version Path
tanga_activemerchant-1.38.0.5 lib/active_merchant/billing/integrations/gestpay/common.rb
tanga_activemerchant-1.38.0.4 lib/active_merchant/billing/integrations/gestpay/common.rb
tanga_activemerchant-1.38.0.3 lib/active_merchant/billing/integrations/gestpay/common.rb
tanga_activemerchant-1.38.0.2 lib/active_merchant/billing/integrations/gestpay/common.rb
tanga_activemerchant-1.38.0.1 lib/active_merchant/billing/integrations/gestpay/common.rb
tanga_activemerchant-1.38.0 lib/active_merchant/billing/integrations/gestpay/common.rb
tanga_activemerchant-1.37.0 lib/active_merchant/billing/integrations/gestpay/common.rb
johnideal-activemerchant-1.4.10 lib/active_merchant/billing/integrations/gestpay/common.rb
johnideal-activemerchant-1.4.11 lib/active_merchant/billing/integrations/gestpay/common.rb
johnideal-activemerchant-1.4.4 lib/active_merchant/billing/integrations/gestpay/common.rb
johnideal-activemerchant-1.4.5 lib/active_merchant/billing/integrations/gestpay/common.rb
johnideal-activemerchant-1.4.6 lib/active_merchant/billing/integrations/gestpay/common.rb
johnideal-activemerchant-1.4.7 lib/active_merchant/billing/integrations/gestpay/common.rb
johnideal-activemerchant-1.4.8 lib/active_merchant/billing/integrations/gestpay/common.rb
martinstannard-activemerchant-0.1.0 lib/active_merchant/billing/integrations/gestpay/common.rb
mattbauer-activemerchant-1.4.2 lib/active_merchant/billing/integrations/gestpay/common.rb
seamusabshere-active_merchant-1.4.2.1 lib/active_merchant/billing/integrations/gestpay/common.rb
seamusabshere-active_merchant-1.4.2.3 lib/active_merchant/billing/integrations/gestpay/common.rb
tomriley-active_merchant-1.4.2.3 lib/active_merchant/billing/integrations/gestpay/common.rb
tomriley-active_merchant-1.4.2.4 lib/active_merchant/billing/integrations/gestpay/common.rb