Class: GpWebpay::Configuration::MerchantConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/gp_webpay/configuration.rb

Constant Summary collapse

DEFAULT_HTTP_URL =
'https://3dsecure.gpwebpay.com/pgw/order.do'.freeze
DEFAULT_HTTP_TEST_URL =
'https://test.3dsecure.gpwebpay.com/pgw/order.do'.freeze
DEFAULT_WS_URL =
'https://3dsecure.gpwebpay.com/pay-ws/v1/PaymentService'.freeze
DEFAULT_WS_TEST_URL =
'https://test.3dsecure.gpwebpay.com/pay-ws/v1/PaymentService'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(merchant_number) ⇒ MerchantConfig

Returns a new instance of MerchantConfig.



50
51
52
53
54
55
# File 'lib/gp_webpay/configuration.rb', line 50

def initialize(merchant_number)
  @merchant_number = merchant_number
  @production = false
  @wsdl_file = File.read("#{GpWebpay.root}/config/wsdl/cws_v1.wsdl")
  @enabled_methods = 'credit_card,transfer'
end

Instance Attribute Details

#enabled_methodsObject

Returns the value of attribute enabled_methods.



42
43
44
# File 'lib/gp_webpay/configuration.rb', line 42

def enabled_methods
  @enabled_methods
end

#gpe_pemObject

Returns the value of attribute gpe_pem.



42
43
44
# File 'lib/gp_webpay/configuration.rb', line 42

def gpe_pem
  @gpe_pem
end

#http_urlObject



57
58
59
60
61
62
63
# File 'lib/gp_webpay/configuration.rb', line 57

def http_url
  if @http_url.nil?
    production ? DEFAULT_HTTP_URL : DEFAULT_HTTP_TEST_URL
  else
    @http_url
  end
end

#merchant_numberObject

Returns the value of attribute merchant_number.



42
43
44
# File 'lib/gp_webpay/configuration.rb', line 42

def merchant_number
  @merchant_number
end

#merchant_passwordObject

Returns the value of attribute merchant_password.



42
43
44
# File 'lib/gp_webpay/configuration.rb', line 42

def merchant_password
  @merchant_password
end

#merchant_pemObject

Returns the value of attribute merchant_pem.



42
43
44
# File 'lib/gp_webpay/configuration.rb', line 42

def merchant_pem
  @merchant_pem
end

#productionObject

Returns the value of attribute production.



42
43
44
# File 'lib/gp_webpay/configuration.rb', line 42

def production
  @production
end

#providerObject

Returns the value of attribute provider.



42
43
44
# File 'lib/gp_webpay/configuration.rb', line 42

def provider
  @provider
end

#ws_urlObject



65
66
67
68
69
70
71
# File 'lib/gp_webpay/configuration.rb', line 65

def ws_url
  if @ws_url.nil?
    production ? DEFAULT_WS_URL : DEFAULT_WS_TEST_URL
  else
    @ws_url
  end
end

#wsdl_fileObject

Returns the value of attribute wsdl_file.



42
43
44
# File 'lib/gp_webpay/configuration.rb', line 42

def wsdl_file
  @wsdl_file
end