activemerchant 1.26.0 → 1.27.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. data/CHANGELOG +17 -0
  2. data/CONTRIBUTORS +20 -0
  3. data/README.md +5 -0
  4. data/lib/active_merchant/billing/base.rb +2 -2
  5. data/lib/active_merchant/billing/gateway.rb +6 -0
  6. data/lib/active_merchant/billing/gateways/authorize_net.rb +1 -1
  7. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +0 -3
  8. data/lib/active_merchant/billing/gateways/balanced.rb +462 -0
  9. data/lib/active_merchant/billing/gateways/barclays_epdq.rb +3 -3
  10. data/lib/active_merchant/billing/gateways/beanstream.rb +1 -1
  11. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +3 -2
  12. data/lib/active_merchant/billing/gateways/beanstream_interac.rb +1 -1
  13. data/lib/active_merchant/billing/gateways/braintree.rb +2 -0
  14. data/lib/active_merchant/billing/gateways/braintree_blue.rb +11 -1
  15. data/lib/active_merchant/billing/gateways/braintree_orange.rb +2 -4
  16. data/lib/active_merchant/billing/gateways/card_stream.rb +2 -2
  17. data/lib/active_merchant/billing/gateways/certo_direct.rb +2 -3
  18. data/lib/active_merchant/billing/gateways/cyber_source.rb +3 -3
  19. data/lib/active_merchant/billing/gateways/data_cash.rb +3 -3
  20. data/lib/active_merchant/billing/gateways/efsnet.rb +3 -3
  21. data/lib/active_merchant/billing/gateways/epay.rb +3 -3
  22. data/lib/active_merchant/billing/gateways/eway.rb +8 -7
  23. data/lib/active_merchant/billing/gateways/eway_managed.rb +3 -3
  24. data/lib/active_merchant/billing/gateways/exact.rb +2 -2
  25. data/lib/active_merchant/billing/gateways/fat_zebra.rb +4 -4
  26. data/lib/active_merchant/billing/gateways/federated_canada.rb +2 -2
  27. data/lib/active_merchant/billing/gateways/first_pay.rb +3 -3
  28. data/lib/active_merchant/billing/gateways/garanti.rb +2 -2
  29. data/lib/active_merchant/billing/gateways/ideal/ideal_base.rb +3 -1
  30. data/lib/active_merchant/billing/gateways/inspire.rb +2 -2
  31. data/lib/active_merchant/billing/gateways/instapay.rb +2 -2
  32. data/lib/active_merchant/billing/gateways/iridium.rb +4 -5
  33. data/lib/active_merchant/billing/gateways/itransact.rb +2 -2
  34. data/lib/active_merchant/billing/gateways/jetpay.rb +3 -3
  35. data/lib/active_merchant/billing/gateways/linkpoint.rb +3 -6
  36. data/lib/active_merchant/billing/gateways/litle.rb +50 -34
  37. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +3 -3
  38. data/lib/active_merchant/billing/gateways/merchant_ware.rb +2 -2
  39. data/lib/active_merchant/billing/gateways/migs.rb +8 -4
  40. data/lib/active_merchant/billing/gateways/modern_payments.rb +2 -0
  41. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +4 -4
  42. data/lib/active_merchant/billing/gateways/moneris.rb +3 -3
  43. data/lib/active_merchant/billing/gateways/moneris_us.rb +3 -3
  44. data/lib/active_merchant/billing/gateways/nab_transact.rb +8 -6
  45. data/lib/active_merchant/billing/gateways/net_registry.rb +2 -2
  46. data/lib/active_merchant/billing/gateways/netaxept.rb +4 -4
  47. data/lib/active_merchant/billing/gateways/netbilling.rb +2 -2
  48. data/lib/active_merchant/billing/gateways/ogone.rb +10 -5
  49. data/lib/active_merchant/billing/gateways/optimal_payment.rb +3 -3
  50. data/lib/active_merchant/billing/gateways/orbital.rb +4 -4
  51. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +2 -2
  52. data/lib/active_merchant/billing/gateways/pay_secure.rb +2 -2
  53. data/lib/active_merchant/billing/gateways/paybox_direct.rb +7 -5
  54. data/lib/active_merchant/billing/gateways/payflow.rb +39 -37
  55. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +4 -3
  56. data/lib/active_merchant/billing/gateways/payment_express.rb +2 -2
  57. data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +98 -85
  58. data/lib/active_merchant/billing/gateways/paystation.rb +2 -2
  59. data/lib/active_merchant/billing/gateways/payway.rb +3 -2
  60. data/lib/active_merchant/billing/gateways/plugnpay.rb +63 -66
  61. data/lib/active_merchant/billing/gateways/psigate.rb +3 -3
  62. data/lib/active_merchant/billing/gateways/psl_card.rb +3 -3
  63. data/lib/active_merchant/billing/gateways/quantum.rb +2 -2
  64. data/lib/active_merchant/billing/gateways/quickpay.rb +2 -2
  65. data/lib/active_merchant/billing/gateways/realex.rb +7 -7
  66. data/lib/active_merchant/billing/gateways/sage.rb +2 -0
  67. data/lib/active_merchant/billing/gateways/sage/sage_bankcard.rb +1 -1
  68. data/lib/active_merchant/billing/gateways/sage/sage_core.rb +2 -3
  69. data/lib/active_merchant/billing/gateways/sage/sage_virtual_check.rb +1 -1
  70. data/lib/active_merchant/billing/gateways/sage_pay.rb +8 -6
  71. data/lib/active_merchant/billing/gateways/sallie_mae.rb +2 -2
  72. data/lib/active_merchant/billing/gateways/secure_net.rb +4 -4
  73. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +9 -6
  74. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +2 -2
  75. data/lib/active_merchant/billing/gateways/skip_jack.rb +3 -3
  76. data/lib/active_merchant/billing/gateways/smart_ps.rb +3 -1
  77. data/lib/active_merchant/billing/gateways/stripe.rb +2 -2
  78. data/lib/active_merchant/billing/gateways/trans_first.rb +2 -2
  79. data/lib/active_merchant/billing/gateways/transax.rb +1 -3
  80. data/lib/active_merchant/billing/gateways/trust_commerce.rb +3 -3
  81. data/lib/active_merchant/billing/gateways/usa_epay.rb +2 -0
  82. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +3 -2
  83. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +6 -6
  84. data/lib/active_merchant/billing/gateways/verifi.rb +2 -2
  85. data/lib/active_merchant/billing/gateways/wirecard.rb +4 -4
  86. data/lib/active_merchant/billing/gateways/worldpay.rb +37 -18
  87. data/lib/active_merchant/billing/integrations/action_view_helper.rb +6 -5
  88. data/lib/active_merchant/billing/integrations/first_data.rb +38 -0
  89. data/lib/active_merchant/billing/integrations/first_data/helper.rb +63 -0
  90. data/lib/active_merchant/billing/integrations/first_data/notification.rb +56 -0
  91. data/lib/active_merchant/billing/integrations/helper.rb +4 -0
  92. data/lib/active_merchant/billing/integrations/maksuturva.rb +86 -0
  93. data/lib/active_merchant/billing/integrations/maksuturva/helper.rb +119 -0
  94. data/lib/active_merchant/billing/integrations/maksuturva/notification.rb +48 -0
  95. data/lib/active_merchant/billing/integrations/paxum.rb +44 -0
  96. data/lib/active_merchant/billing/integrations/paxum/common.rb +24 -0
  97. data/lib/active_merchant/billing/integrations/paxum/helper.rb +42 -0
  98. data/lib/active_merchant/billing/integrations/paxum/notification.rb +33 -0
  99. data/lib/active_merchant/billing/integrations/pxpay.rb +31 -0
  100. data/lib/active_merchant/billing/integrations/pxpay/helper.rb +110 -0
  101. data/lib/active_merchant/billing/integrations/pxpay/notification.rb +157 -0
  102. data/lib/active_merchant/billing/integrations/pxpay/return.rb +25 -0
  103. data/lib/active_merchant/billing/integrations/web_pay.rb +45 -0
  104. data/lib/active_merchant/billing/integrations/web_pay/common.rb +50 -0
  105. data/lib/active_merchant/billing/integrations/web_pay/helper.rb +68 -0
  106. data/lib/active_merchant/billing/integrations/web_pay/notification.rb +51 -0
  107. data/lib/active_merchant/version.rb +1 -1
  108. data/lib/support/gateway_support.rb +9 -2
  109. data/lib/support/ssl_verify.rb +93 -0
  110. metadata +45 -71
  111. data.tar.gz.sig +0 -3
  112. metadata.gz.sig +0 -0
@@ -7,7 +7,8 @@ module ActiveMerchant #:nodoc:
7
7
  # login to the Iridium Merchant Management System. Instead, you will
8
8
  # use the API username and password you were issued separately.
9
9
  class IridiumGateway < Gateway
10
-
10
+ self.live_url = self.test_url = 'https://gw1.iridiumcorp.net/'
11
+
11
12
  # The countries the gateway supports merchants from as 2 digit ISO country codes
12
13
  self.supported_countries = ['GB', 'ES']
13
14
  self.default_currency = 'EUR'
@@ -35,8 +36,6 @@ module ActiveMerchant #:nodoc:
35
36
  def initialize(options = {})
36
37
  requires!(options, :login, :password)
37
38
  @options = options
38
- @test_url = 'https://gw1.iridiumcorp.net/'
39
- @live_url = 'https://gw1.iridiumcorp.net/'
40
39
  super
41
40
  end
42
41
 
@@ -172,7 +171,7 @@ module ActiveMerchant #:nodoc:
172
171
 
173
172
  def commit(request, options)
174
173
  requires!(options, :action)
175
- response = parse(ssl_post(test? ? @test_url : @live_url, request,
174
+ response = parse(ssl_post(test? ? self.test_url : self.live_url, request,
176
175
  {"SOAPAction" => "https://www.thepaymentgateway.net/#{options[:action]}",
177
176
  "Content-Type" => "text/xml; charset=utf-8" }))
178
177
 
@@ -255,4 +254,4 @@ module ActiveMerchant #:nodoc:
255
254
  end
256
255
  end
257
256
  end
258
- end
257
+ end
@@ -32,7 +32,7 @@ module ActiveMerchant #:nodoc:
32
32
  # 1. TransactionStatus is not implemented
33
33
  #
34
34
  class ItransactGateway < Gateway
35
- URL = 'https://secure.paymentclearing.com/cgi-bin/rc/xmltrans2.cgi'
35
+ self.live_url = self.test_url = 'https://secure.paymentclearing.com/cgi-bin/rc/xmltrans2.cgi'
36
36
 
37
37
  # The countries the gateway supports merchants from as 2 digit ISO country codes
38
38
  self.supported_countries = ['US']
@@ -386,7 +386,7 @@ module ActiveMerchant #:nodoc:
386
386
  def commit(payload)
387
387
  # Set the Content-Type header -- otherwise the URL decoding messes up
388
388
  # the Base64 encoded payload signature!
389
- response = parse(ssl_post(URL, post_data(payload), 'Content-Type' => 'text/xml'))
389
+ response = parse(ssl_post(self.live_url, post_data(payload), 'Content-Type' => 'text/xml'))
390
390
 
391
391
  Response.new(successful?(response), response[:error_message], response,
392
392
  :test => test?,
@@ -1,8 +1,8 @@
1
1
  module ActiveMerchant #:nodoc:
2
2
  module Billing #:nodoc:
3
3
  class JetpayGateway < Gateway
4
- TEST_URL = 'https://test1.jetpay.com/jetpay'
5
- LIVE_URL = 'https://gateway17.jetpay.com/jetpay'
4
+ self.test_url = 'https://test1.jetpay.com/jetpay'
5
+ self.live_url = 'https://gateway17.jetpay.com/jetpay'
6
6
 
7
7
  # The countries the gateway supports merchants from as 2 digit ISO country codes
8
8
  self.supported_countries = ['US']
@@ -167,7 +167,7 @@ module ActiveMerchant #:nodoc:
167
167
  end
168
168
 
169
169
  def commit(money, request)
170
- response = parse(ssl_post(test? ? TEST_URL : LIVE_URL, request))
170
+ response = parse(ssl_post(test? ? self.test_url : self.live_url, request))
171
171
 
172
172
  success = success?(response)
173
173
  Response.new(success,
@@ -127,11 +127,8 @@ module ActiveMerchant #:nodoc:
127
127
  #
128
128
  cattr_accessor :pem_file
129
129
 
130
- TEST_URL = 'https://staging.linkpt.net:1129/'
131
- LIVE_URL = 'https://secure.linkpt.net:1129/'
132
-
133
- # We don't have the certificate to verify LinkPoint
134
- self.ssl_strict = false
130
+ self.test_url = 'https://staging.linkpt.net:1129/'
131
+ self.live_url = 'https://secure.linkpt.net:1129/'
135
132
 
136
133
  self.supported_countries = ['US']
137
134
  self.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :diners_club]
@@ -253,7 +250,7 @@ module ActiveMerchant #:nodoc:
253
250
  private
254
251
  # Commit the transaction by posting the XML file to the LinkPoint server
255
252
  def commit(money, creditcard, options = {})
256
- response = parse(ssl_post(test? ? TEST_URL : LIVE_URL, post_data(money, creditcard, options)))
253
+ response = parse(ssl_post(test? ? self.test_url : self.live_url, post_data(money, creditcard, options)))
257
254
 
258
255
  Response.new(successful?(response), response[:message], response,
259
256
  :test => test?,
@@ -1,5 +1,3 @@
1
- require 'LitleOnline'
2
-
3
1
  module ActiveMerchant #:nodoc:
4
2
  module Billing #:nodoc:
5
3
  class LitleGateway < Gateway
@@ -36,8 +34,10 @@ module ActiveMerchant #:nodoc:
36
34
  # * <tt>:zip</tt> - The zip or postal code of the customer.
37
35
  # * <tt>:phone</tt> - The phone number of the customer.
38
36
 
39
- TEST_URL = 'https://www.testlitle.com/sandbox/communicator/online'
40
- LIVE_URL = 'https://payments.litle.com/vap/communicator/online'
37
+ self.test_url = 'https://www.testlitle.com/sandbox/communicator/online'
38
+ self.live_url = 'https://payments.litle.com/vap/communicator/online'
39
+
40
+ LITLE_SCHEMA_VERSION = '8.10'
41
41
 
42
42
  # The countries the gateway supports merchants from as 2 digit ISO country codes
43
43
  self.supported_countries = ['US']
@@ -54,8 +54,20 @@ module ActiveMerchant #:nodoc:
54
54
  self.default_currency = 'USD'
55
55
 
56
56
  def initialize(options = {})
57
+ begin
58
+ require 'LitleOnline'
59
+ rescue LoadError
60
+ raise "Could not load the LitleOnline gem (>= 08.13.2). Use `gem install LitleOnline` to install it."
61
+ end
62
+
57
63
  @litle = LitleOnline::LitleOnlineRequest.new
58
- requires!(options, :merchant_id, :user, :password, :version, :url)
64
+
65
+ options[:version] ||= LITLE_SCHEMA_VERSION
66
+ options[:merchant] ||= 'Default Report Group'
67
+ options[:user] ||= options[:login]
68
+
69
+ requires!(options, :merchant_id, :user, :password, :merchant, :version)
70
+
59
71
  @options = options
60
72
  end
61
73
 
@@ -118,19 +130,28 @@ module ActiveMerchant #:nodoc:
118
130
  '40' => 'E'
119
131
  }
120
132
 
133
+ def url
134
+ return @options[:url] if @options[:url].present?
135
+
136
+ test? ? self.test_url : self.live_url
137
+ end
138
+
121
139
  def build_response(kind, litle_response, valid_responses=%w(000))
122
- if litle_response.response == "0"
123
- detail = litle_response.send("#{kind}Response")
140
+ response = Hash.from_xml(litle_response.raw_xml.to_s)['litleOnlineResponse']
141
+
142
+ if response['response'] == "0"
143
+ detail = response["#{kind}Response"]
144
+ fraud = fraud_result(detail)
124
145
  Response.new(
125
- (valid_responses.include?(detail.response)),
126
- detail.message,
127
- {:litleOnlineResponse => litle_response},
128
- :authorization => detail.litleTxnId,
129
- :avs_result => {:code => fraud_result(detail)['avs']},
130
- :cvv_result => fraud_result(detail)['cvv']
146
+ valid_responses.include?(detail['response']),
147
+ detail['message'],
148
+ {:litleOnlineResponse => response},
149
+ :authorization => detail['litleTxnId'],
150
+ :avs_result => {:code => fraud['avs']},
151
+ :cvv_result => fraud['cvv']
131
152
  )
132
153
  else
133
- Response.new(false, litle_response.message, :litleOnlineResponse => litle_response)
154
+ Response.new(false, response['message'], :litleOnlineResponse => response)
134
155
  end
135
156
  end
136
157
 
@@ -232,20 +253,20 @@ module ActiveMerchant #:nodoc:
232
253
  hash = {
233
254
  'billToAddress' => bill_to_address,
234
255
  'shipToAddress' => ship_to_address,
235
- 'orderId' => (options[:order_id] or @options[:order_id]),
256
+ 'orderId' => (options[:order_id] || @options[:order_id]),
236
257
  'customerId' => options[:customer],
237
- 'reportGroup' => (options[:merchant] or @options[:merchant]),
238
- 'merchantId' => (options[:merchant_id] or @options[:merchant_id]),
258
+ 'reportGroup' => (options[:merchant] || @options[:merchant]),
259
+ 'merchantId' => (options[:merchant_id] || @options[:merchant_id]),
239
260
  'orderSource' => 'ecommerce',
240
261
  'enhancedData' => enhanced_data,
241
262
  'fraudCheckType' => fraud_check_type,
242
- 'user' => (options[:user] or @options[:user]),
243
- 'password' => (options[:password] or @options[:password]),
244
- 'version' => (options[:version] or @options[:version]),
245
- 'url' => (options[:url] or @options[:url]),
246
- 'proxy_addr' => (options[:proxy_addr] or @options[:proxy_addr]),
247
- 'proxy_port' => (options[:proxy_port] or @options[:proxy_port]),
248
- 'id' => (options[:id] or options[:order_id] or @options[:order_id])
263
+ 'user' => (options[:user] || @options[:user]),
264
+ 'password' => (options[:password] || @options[:password]),
265
+ 'version' => (options[:version] || @options[:version]),
266
+ 'url' => (options[:url] || url),
267
+ 'proxy_addr' => (options[:proxy_addr] || @options[:proxy_addr]),
268
+ 'proxy_port' => (options[:proxy_port] || @options[:proxy_port]),
269
+ 'id' => (options[:id] || options[:order_id] || @options[:order_id])
249
270
  }
250
271
 
251
272
  if( !money.nil? && money.to_s.length > 0 )
@@ -255,17 +276,12 @@ module ActiveMerchant #:nodoc:
255
276
  end
256
277
 
257
278
  def fraud_result(authorization_response)
258
- if authorization_response.respond_to?(:fraudResult)
259
- fraud_result = authorization_response.fraudResult
260
- if fraud_result.respond_to?(:cardValidationResult)
261
- cvv_to_pass = fraud_result.cardValidationResult
262
- if(cvv_to_pass == "")
263
- cvv_to_pass = "P"
264
- end
265
- end
266
- if fraud_result.respond_to?(:avsResult)
267
- avs_to_pass = AVS_RESPONSE_CODE[fraud_result.avsResult]
279
+ if result = authorization_response['fraudResult']
280
+ if result.key?('cardValidationResult')
281
+ cvv_to_pass = result['cardValidationResult'].blank? ? "P" : result['cardValidationResult']
268
282
  end
283
+
284
+ avs_to_pass = AVS_RESPONSE_CODE[result['avsResult']] unless result['avsResult'].blank?
269
285
  end
270
286
  {'cvv'=>cvv_to_pass, 'avs'=>avs_to_pass}
271
287
  end
@@ -2,8 +2,8 @@ module ActiveMerchant #:nodoc:
2
2
  module Billing #:nodoc:
3
3
  class MerchantESolutionsGateway < Gateway
4
4
 
5
- TEST_URL = 'https://cert.merchante-solutions.com/mes-api/tridentApi'
6
- LIVE_URL = 'https://api.merchante-solutions.com/mes-api/tridentApi'
5
+ self.test_url = 'https://cert.merchante-solutions.com/mes-api/tridentApi'
6
+ self.live_url = 'https://api.merchante-solutions.com/mes-api/tridentApi'
7
7
 
8
8
  # The countries the gateway supports merchants from as 2 digit ISO country codes
9
9
  self.supported_countries = ['US']
@@ -114,7 +114,7 @@ module ActiveMerchant #:nodoc:
114
114
 
115
115
  def commit(action, money, parameters)
116
116
 
117
- url = test? ? TEST_URL : LIVE_URL
117
+ url = test? ? self.test_url : self.live_url
118
118
  parameters[:transaction_amount] = amount(money) if money unless action == 'V'
119
119
 
120
120
  response = parse( ssl_post(url, post_data(action,parameters)) )
@@ -1,7 +1,7 @@
1
1
  module ActiveMerchant #:nodoc:
2
2
  module Billing #:nodoc:
3
3
  class MerchantWareGateway < Gateway
4
- URL = 'https://ps1.merchantware.net/MerchantWARE/ws/RetailTransaction/TXRetail.asmx'
4
+ self.live_url = self.test_url = 'https://ps1.merchantware.net/MerchantWARE/ws/RetailTransaction/TXRetail.asmx'
5
5
 
6
6
  self.supported_countries = ['US']
7
7
  self.supported_cardtypes = [:visa, :master, :american_express, :discover]
@@ -261,7 +261,7 @@ module ActiveMerchant #:nodoc:
261
261
 
262
262
  def commit(action, request)
263
263
  begin
264
- data = ssl_post(URL, request,
264
+ data = ssl_post(self.live_url, request,
265
265
  "Content-Type" => 'text/xml; charset=utf-8',
266
266
  "SOAPAction" => "http://merchantwarehouse.com/MerchantWARE/Client/TransactionRetail/#{ACTIONS[action]}"
267
267
  )
@@ -9,8 +9,12 @@ module ActiveMerchant #:nodoc:
9
9
 
10
10
  API_VERSION = 1
11
11
 
12
- SERVER_HOSTED_URL = 'https://migs.mastercard.com.au/vpcpay'
13
- MERCHANT_HOSTED_URL = 'https://migs.mastercard.com.au/vpcdps'
12
+ class_attribute :server_hosted_url, :merchant_hosted_url
13
+
14
+ self.server_hosted_url = 'https://migs.mastercard.com.au/vpcpay'
15
+ self.merchant_hosted_url = 'https://migs.mastercard.com.au/vpcdps'
16
+
17
+ self.live_url = self.server_hosted_url
14
18
 
15
19
  # MiGS is supported throughout Asia Pacific, Middle East and Africa
16
20
  # MiGS is used in Australia (AU) by ANZ (eGate), CBA (CommWeb) and more
@@ -154,7 +158,7 @@ module ActiveMerchant #:nodoc:
154
158
 
155
159
  add_secure_hash(post)
156
160
 
157
- SERVER_HOSTED_URL + '?' + post_data(post)
161
+ self.server_hosted_url + '?' + post_data(post)
158
162
  end
159
163
 
160
164
  # Parses a response from purchase_offsite_url once user is redirected back
@@ -208,7 +212,7 @@ module ActiveMerchant #:nodoc:
208
212
  end
209
213
 
210
214
  def commit(post)
211
- data = ssl_post MERCHANT_HOSTED_URL, post_data(post)
215
+ data = ssl_post self.merchant_hosted_url, post_data(post)
212
216
  response_hash = parse(data)
213
217
  response_object(response_hash)
214
218
  end
@@ -8,6 +8,8 @@ module ActiveMerchant #:nodoc:
8
8
  self.homepage_url = ModernPaymentsCimGateway.homepage_url
9
9
  self.display_name = ModernPaymentsCimGateway.display_name
10
10
 
11
+ self.abstract_class = true
12
+
11
13
  def initialize(options = {})
12
14
  requires!(options, :login, :password)
13
15
  @options = options
@@ -1,8 +1,8 @@
1
1
  module ActiveMerchant #:nodoc:
2
2
  module Billing #:nodoc:
3
3
  class ModernPaymentsCimGateway < Gateway #:nodoc:
4
- TEST_URL = "https://secure.modpay.com/netservices/test/ModpayTest.asmx"
5
- LIVE_URL = 'https://secure.modpay.com/ws/modpay.asmx'
4
+ self.test_url = "https://secure.modpay.com/netservices/test/ModpayTest.asmx"
5
+ self.live_url = 'https://secure.modpay.com/ws/modpay.asmx'
6
6
 
7
7
  LIVE_XMLNS = "https://secure.modpay.com/ws/"
8
8
  TEST_XMLNS = "https://secure.modpay.com/netservices/test/"
@@ -141,9 +141,9 @@ module ActiveMerchant #:nodoc:
141
141
 
142
142
  def url(action)
143
143
  if test? && action == 'AuthorizeCreditCardPayment'
144
- TEST_URL
144
+ self.test_url
145
145
  else
146
- LIVE_URL
146
+ self.live_url
147
147
  end
148
148
  end
149
149
 
@@ -10,8 +10,8 @@ module ActiveMerchant #:nodoc:
10
10
  # Response Values", available at Moneris' {eSelect Plus Documentation
11
11
  # Centre}[https://www3.moneris.com/connect/en/documents/index.html].
12
12
  class MonerisGateway < Gateway
13
- TEST_URL = 'https://esqa.moneris.com/gateway2/servlet/MpgRequest'
14
- LIVE_URL = 'https://www3.moneris.com/gateway2/servlet/MpgRequest'
13
+ self.test_url = 'https://esqa.moneris.com/gateway2/servlet/MpgRequest'
14
+ self.live_url = 'https://www3.moneris.com/gateway2/servlet/MpgRequest'
15
15
 
16
16
  self.supported_countries = ['CA']
17
17
  self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :discover]
@@ -157,7 +157,7 @@ module ActiveMerchant #:nodoc:
157
157
  end
158
158
 
159
159
  def commit(action, parameters = {})
160
- response = parse(ssl_post(test? ? TEST_URL : LIVE_URL, post_data(action, parameters)))
160
+ response = parse(ssl_post(test? ? self.test_url : self.live_url, post_data(action, parameters)))
161
161
 
162
162
  Response.new(successful?(response), message_from(response[:message]), response,
163
163
  :test => test?,
@@ -10,8 +10,8 @@ module ActiveMerchant #:nodoc:
10
10
  # Response Values", available at Moneris' {eSelect Plus Documentation
11
11
  # Centre}[https://www3.moneris.com/connect/en/documents/index.html].
12
12
  class MonerisUsGateway < Gateway
13
- TEST_URL = 'https://esplusqa.moneris.com/gateway_us/servlet/MpgRequest'
14
- LIVE_URL = 'https://esplus.moneris.com/gateway_us/servlet/MpgRequest'
13
+ self.test_url = 'https://esplusqa.moneris.com/gateway_us/servlet/MpgRequest'
14
+ self.live_url = 'https://esplus.moneris.com/gateway_us/servlet/MpgRequest'
15
15
 
16
16
  self.supported_countries = ['US']
17
17
  self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :discover]
@@ -125,7 +125,7 @@ module ActiveMerchant #:nodoc:
125
125
  end
126
126
 
127
127
  def commit(action, parameters = {})
128
- response = parse(ssl_post(test? ? TEST_URL : LIVE_URL, post_data(action, parameters)))
128
+ response = parse(ssl_post(test? ? self.test_url : self.live_url, post_data(action, parameters)))
129
129
 
130
130
  Response.new(successful?(response), message_from(response[:message]), response,
131
131
  :test => test?,
@@ -8,10 +8,12 @@ module ActiveMerchant #:nodoc:
8
8
  API_VERSION = 'xml-4.2'
9
9
  PERIODIC_API_VERSION = "spxml-4.2"
10
10
 
11
- TEST_URL = 'https://transact.nab.com.au/test/xmlapi/payment'
12
- LIVE_URL = 'https://transact.nab.com.au/live/xmlapi/payment'
13
- TEST_PERIODIC_URL = "https://transact.nab.com.au/xmlapidemo/periodic"
14
- LIVE_PERIODIC_URL = "https://transact.nab.com.au/xmlapi/periodic"
11
+ class_attribute :test_periodic_url, :live_periodic_url
12
+
13
+ self.test_url = 'https://transact.nab.com.au/test/xmlapi/payment'
14
+ self.live_url = 'https://transact.nab.com.au/live/xmlapi/payment'
15
+ self.test_periodic_url = 'https://transact.nab.com.au/xmlapidemo/periodic'
16
+ self.live_periodic_url = 'https://transact.nab.com.au/xmlapi/periodic'
15
17
 
16
18
  self.supported_countries = ['AU']
17
19
 
@@ -192,7 +194,7 @@ module ActiveMerchant #:nodoc:
192
194
  end
193
195
 
194
196
  def commit(action, request)
195
- response = parse(ssl_post(test? ? TEST_URL : LIVE_URL, build_request(action, request)))
197
+ response = parse(ssl_post(test? ? self.test_url : self.live_url, build_request(action, request)))
196
198
 
197
199
  Response.new(success?(response), message_from(response), response,
198
200
  :test => test?,
@@ -201,7 +203,7 @@ module ActiveMerchant #:nodoc:
201
203
  end
202
204
 
203
205
  def commit_periodic(request)
204
- response = parse(ssl_post(test? ? TEST_PERIODIC_URL : LIVE_PERIODIC_URL, build_periodic_request(request)))
206
+ response = parse(ssl_post(test? ? self.test_periodic_url : self.live_periodic_url, build_periodic_request(request)))
205
207
  Response.new(success?(response), message_from(response), response,
206
208
  :test => test?,
207
209
  :authorization => authorization_from(response)
@@ -22,7 +22,7 @@ module ActiveMerchant
22
22
  # response will contain a 'receipt' parameter
23
23
  # (response.params['receipt']) if a receipt was issued by the gateway.
24
24
  class NetRegistryGateway < Gateway
25
- URL = 'https://4tknox.au.com/cgi-bin/themerchant.au.com/ecom/external2.pl'
25
+ self.live_url = self.test_url = 'https://4tknox.au.com/cgi-bin/themerchant.au.com/ecom/external2.pl'
26
26
 
27
27
  FILTERED_PARAMS = [ 'card_no', 'card_expiry', 'receipt_array' ]
28
28
 
@@ -137,7 +137,7 @@ module ActiveMerchant
137
137
  # omitted if nil.
138
138
  def commit(action, params)
139
139
  # get gateway response
140
- response = parse( ssl_post(URL, post_data(action, params)) )
140
+ response = parse( ssl_post(self.live_url, post_data(action, params)) )
141
141
 
142
142
  Response.new(response['status'] == 'approved', message_from(response), response,
143
143
  :authorization => authorization_from(response, action)
@@ -3,8 +3,8 @@ require 'digest/md5'
3
3
  module ActiveMerchant #:nodoc:
4
4
  module Billing #:nodoc:
5
5
  class NetaxeptGateway < Gateway
6
- TEST_URL = 'https://epayment-test.bbs.no/'
7
- LIVE_URL = 'https://epayment.bbs.no/'
6
+ self.test_url = 'https://epayment-test.bbs.no/'
7
+ self.live_url = 'https://epayment.bbs.no/'
8
8
 
9
9
  # The countries the gateway supports merchants from as 2 digit ISO country codes
10
10
  self.supported_countries = ['NO', 'DK', 'SE', 'FI']
@@ -199,7 +199,7 @@ module ActiveMerchant #:nodoc:
199
199
  end
200
200
 
201
201
  def url
202
- (test? ? TEST_URL : LIVE_URL)
202
+ (test? ? self.test_url : self.live_url)
203
203
  end
204
204
 
205
205
  def generate_transaction_id(options)
@@ -211,7 +211,7 @@ module ActiveMerchant #:nodoc:
211
211
  end
212
212
 
213
213
  def build_url(base, parameters=nil)
214
- url = "#{test? ? TEST_URL : LIVE_URL}"
214
+ url = "#{test? ? self.test_url : self.live_url}"
215
215
  url << base
216
216
  if parameters
217
217
  url << '?'