Class: GpWebpay::Configuration

Inherits:
Object
  • Object
show all
Includes:
ActiveSupport::Configurable
Defined in:
lib/gp_webpay/config.rb

Overview

need a Class for 3.0

Instance Method Summary collapse

Instance Method Details

#gpe_pem_pathObject



50
51
52
53
54
55
56
57
58
59
# File 'lib/gp_webpay/config.rb', line 50

def gpe_pem_path
  env = production? ? 'prod' : 'test'

  file_name = case config.provider
              when :csob      then "mips_#{env}.csob.cz.pem"
              when :gp_webpay then "muzo.signing_#{env}.pem"
              end

  File.expand_path("../../../certs/#{file_name}", __FILE__)
end

#param_nameObject



29
30
31
# File 'lib/gp_webpay/config.rb', line 29

def param_name
  config.param_name.respond_to?(:call) ? config.param_name.call : config.param_name
end

#pay_urlObject



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/gp_webpay/config.rb', line 33

def pay_url
  case config.provider
  when :csob
    if production?
      'https://platebnibrana.csob.cz/pay/entry/merchant'
    else
      'https://iplatebnibrana.csob.cz/pay/entry/merchant'
    end
  when :gp_webpay
    if production?
      "https://3dsecure.gpwebpay.com/#{config.gp_webpay_bank}/order.do"
    else
      "https://test.3dsecure.gpwebpay.com/#{config.gp_webpay_bank}/order.do"
    end
  end
end

#production?Boolean

Returns:

  • (Boolean)


61
62
63
# File 'lib/gp_webpay/config.rb', line 61

def production?
  config.environment == 'production'
end