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
@@ -2,7 +2,7 @@ module ActiveMerchant #:nodoc:
2
2
  module Billing #:nodoc:
3
3
  class PaystationGateway < Gateway
4
4
 
5
- URL = "https://www.paystation.co.nz/direct/paystation.dll"
5
+ self.live_url = self.test_url = "https://www.paystation.co.nz/direct/paystation.dll"
6
6
 
7
7
  # an "error code" of "0" means "No error - transaction successful"
8
8
  SUCCESSFUL_RESPONSE_CODE = '0'
@@ -165,7 +165,7 @@ module ActiveMerchant #:nodoc:
165
165
  pstn_prefix_params = post.collect { |key, value| "pstn_#{key}=#{CGI.escape(value.to_s)}" }.join("&")
166
166
 
167
167
  # need include paystation param as "initiator flag for payment engine"
168
- data = ssl_post(URL, "#{pstn_prefix_params}&paystation=_empty")
168
+ data = ssl_post(self.live_url, "#{pstn_prefix_params}&paystation=_empty")
169
169
  response = parse(data)
170
170
  message = message_from(response)
171
171
 
@@ -1,7 +1,7 @@
1
1
  module ActiveMerchant
2
2
  module Billing
3
3
  class PaywayGateway < Gateway
4
- URL = 'https://ccapi.client.qvalent.com/payway/ccapi'
4
+ self.live_url = self.test_url = 'https://ccapi.client.qvalent.com/payway/ccapi'
5
5
 
6
6
  self.supported_countries = [ 'AU' ]
7
7
  self.supported_cardtypes = [ :visa, :master, :diners_club, :american_express, :bankcard ]
@@ -136,6 +136,7 @@ module ActiveMerchant
136
136
 
137
137
  post = {}
138
138
  add_payment_method(post, credit_card)
139
+ add_payment_method(post, options[:billing_id])
139
140
  commit(:store, post)
140
141
  end
141
142
 
@@ -182,7 +183,7 @@ module ActiveMerchant
182
183
  post.merge!('order.type' => TRANSACTIONS[action])
183
184
 
184
185
  request = post.map { |k, v| "#{k}=#{CGI.escape(v.to_s)}" }.join("&")
185
- response = ssl_post(URL, request)
186
+ response = ssl_post(self.live_url, request)
186
187
 
187
188
  params = {}
188
189
  CGI.parse(response).each_pair do |key, value|
@@ -1,15 +1,13 @@
1
1
  module ActiveMerchant
2
2
  module Billing
3
-
4
3
  class PlugnpayGateway < Gateway
5
4
  class PlugnpayPostData < PostData
6
5
  # Fields that will be sent even if they are blank
7
- self.required_fields = [ :publisher_name, :publisher_password,
6
+ self.required_fields = [ :publisher_name, :publisher_password,
8
7
  :card_amount, :card_name, :card_number, :card_exp, :orderID ]
9
- end
10
-
11
- URL = 'https://pay1.plugnpay.com/payment/pnpremote.cgi'
12
-
8
+ end
9
+ self.live_url = self.test_url = 'https://pay1.plugnpay.com/payment/pnpremote.cgi'
10
+
13
11
  CARD_CODE_MESSAGES = {
14
12
  "M" => "Card verification number matched",
15
13
  "N" => "Card verification number didn't match",
@@ -19,7 +17,7 @@ module ActiveMerchant
19
17
  }
20
18
 
21
19
  CARD_CODE_ERRORS = %w( N S )
22
-
20
+
23
21
  AVS_MESSAGES = {
24
22
  "A" => "Street address matches billing information, zip/postal code does not",
25
23
  "B" => "Address information not provided for address verification check",
@@ -35,9 +33,9 @@ module ActiveMerchant
35
33
  "Y" => "Street address and 5-digit zip/postal code matches billing information",
36
34
  "Z" => "5-digit zip/postal code matches billing information, street address does not",
37
35
  }
38
-
36
+
39
37
  AVS_ERRORS = %w( A E N R W Z )
40
-
38
+
41
39
  PAYMENT_GATEWAY_RESPONSES = {
42
40
  "P01" => "AVS Mismatch Failure",
43
41
  "P02" => "CVV2 Mismatch Failure",
@@ -80,7 +78,7 @@ module ActiveMerchant
80
78
  "P98" => "Missing merchant/publisher name",
81
79
  "P99" => "Currently Blank"
82
80
  }
83
-
81
+
84
82
  TRANSACTIONS = {
85
83
  :authorization => 'auth',
86
84
  :purchase => 'auth',
@@ -89,10 +87,10 @@ module ActiveMerchant
89
87
  :refund => 'return',
90
88
  :credit => 'newreturn'
91
89
  }
92
-
90
+
93
91
  SUCCESS_CODES = [ 'pending', 'success' ]
94
92
  FAILURE_CODES = [ 'badcard', 'fraud' ]
95
-
93
+
96
94
  self.default_currency = 'USD'
97
95
  self.supported_countries = ['US']
98
96
  self.supported_cardtypes = [:visa, :master, :american_express, :discover]
@@ -104,65 +102,65 @@ module ActiveMerchant
104
102
  @options = options
105
103
  super
106
104
  end
107
-
105
+
108
106
  def purchase(money, creditcard, options = {})
109
107
  post = PlugnpayPostData.new
110
-
108
+
111
109
  add_amount(post, money, options)
112
110
  add_creditcard(post, creditcard)
113
111
  add_addresses(post, options)
114
112
  add_invoice_data(post, options)
115
113
  add_customer_data(post, options)
116
-
114
+
117
115
  post[:authtype] = 'authpostauth'
118
116
  commit(:authorization, post)
119
- end
120
-
117
+ end
118
+
121
119
  def authorize(money, creditcard, options = {})
122
120
  post = PlugnpayPostData.new
123
-
121
+
124
122
  add_amount(post, money, options)
125
- add_creditcard(post, creditcard)
123
+ add_creditcard(post, creditcard)
126
124
  add_addresses(post, options)
127
- add_invoice_data(post, options)
125
+ add_invoice_data(post, options)
128
126
  add_customer_data(post, options)
129
-
127
+
130
128
  post[:authtype] = 'authonly'
131
129
  commit(:authorization, post)
132
- end
130
+ end
133
131
 
134
132
  def capture(money, authorization, options = {})
135
133
  post = PlugnpayPostData.new
136
-
134
+
137
135
  post[:orderID] = authorization
138
-
136
+
139
137
  add_amount(post, money, options)
140
138
  add_customer_data(post, options)
141
-
139
+
142
140
  commit(:capture, post)
143
141
  end
144
-
142
+
145
143
  def void(authorization, options = {})
146
144
  post = PlugnpayPostData.new
147
-
145
+
148
146
  post[:orderID] = authorization
149
147
  post[:txn_type] = 'auth'
150
-
148
+
151
149
  commit(:void, post)
152
150
  end
153
-
151
+
154
152
  def credit(money, identification_or_creditcard, options = {})
155
153
  post = PlugnpayPostData.new
156
154
  add_amount(post, money, options)
157
-
155
+
158
156
  if identification_or_creditcard.is_a?(String)
159
157
  deprecated CREDIT_DEPRECATION_MESSAGE
160
158
  refund(money, identification_or_creditcard, options)
161
159
  else
162
- add_creditcard(post, identification_or_creditcard)
163
- add_addresses(post, options)
164
- add_customer_data(post, options)
165
-
160
+ add_creditcard(post, identification_or_creditcard)
161
+ add_addresses(post, options)
162
+ add_customer_data(post, options)
163
+
166
164
  commit(:credit, post)
167
165
  end
168
166
  end
@@ -173,35 +171,34 @@ module ActiveMerchant
173
171
  post[:orderID] = reference
174
172
  commit(:refund, post)
175
173
  end
176
-
177
- private
174
+
175
+ private
178
176
  def commit(action, post)
179
- response = parse( ssl_post(URL, post_data(action, post)) )
180
-
177
+ response = parse( ssl_post(self.live_url, post_data(action, post)) )
181
178
  success = SUCCESS_CODES.include?(response[:finalstatus])
182
179
  message = success ? 'Success' : message_from(response)
183
-
184
- Response.new(success, message, response,
185
- :test => test?,
180
+
181
+ Response.new(success, message, response,
182
+ :test => test?,
186
183
  :authorization => response[:orderid],
187
184
  :avs_result => { :code => response[:avs_code] },
188
185
  :cvv_result => response[:cvvresp]
189
186
  )
190
187
  end
191
-
188
+
192
189
  def parse(body)
193
190
  body = CGI.unescape(body)
194
191
  results = {}
195
192
  body.split('&').collect { |e| e.split('=') }.each do |key,value|
196
193
  results[key.downcase.to_sym] = normalize(value.to_s.strip)
197
194
  end
198
-
195
+
199
196
  results.delete(:publisher_password)
200
197
  results[:avs_message] = AVS_MESSAGES[results[:avs_code]] if results[:avs_code]
201
198
  results[:card_code_message] = CARD_CODE_MESSAGES[results[:cvvresp]] if results[:cvvresp]
202
-
199
+
203
200
  results
204
- end
201
+ end
205
202
 
206
203
  def post_data(action, post)
207
204
  post[:mode] = TRANSACTIONS[action]
@@ -209,33 +206,33 @@ module ActiveMerchant
209
206
  post[:app_level] = 0
210
207
  post[:publisher_name] = @options[:login]
211
208
  post[:publisher_password] = @options[:password]
212
-
209
+
213
210
  post.to_s
214
211
  end
215
-
216
- def add_creditcard(post, creditcard)
212
+
213
+ def add_creditcard(post, creditcard)
217
214
  post[:card_number] = creditcard.number
218
215
  post[:card_cvv] = creditcard.verification_value
219
216
  post[:card_exp] = expdate(creditcard)
220
217
  post[:card_name] = creditcard.name.slice(0..38)
221
218
  end
222
-
219
+
223
220
  def add_customer_data(post, options)
224
221
  post[:email] = options[:email]
225
222
  post[:dontsndmail] = 'yes' unless options[:send_email_confirmation]
226
223
  post[:ipaddress] = options[:ip]
227
224
  end
228
-
225
+
229
226
  def add_invoice_data(post, options)
230
227
  post[:shipping] = amount(options[:shipping]) unless options[:shipping].blank?
231
- post[:tax] = amount(options[:tax]) unless options[:tax].blank?
228
+ post[:tax] = amount(options[:tax]) unless options[:tax].blank?
232
229
  end
233
230
 
234
- def add_addresses(post, options)
231
+ def add_addresses(post, options)
235
232
  if address = options[:billing_address] || options[:address]
236
233
  post[:card_address1] = address[:address1]
237
- post[:card_zip] = address[:zip]
238
- post[:card_city] = address[:city]
234
+ post[:card_zip] = address[:zip]
235
+ post[:card_city] = address[:city]
239
236
  post[:card_country] = address[:country]
240
237
  post[:phone] = address[:phone]
241
238
 
@@ -243,35 +240,35 @@ module ActiveMerchant
243
240
  when 'US', 'CA'
244
241
  post[:card_state] = address[:state]
245
242
  else
246
- post[:card_state] = 'ZZ'
243
+ post[:card_state] = 'ZZ'
247
244
  post[:card_prov] = address[:state]
248
245
  end
249
246
  end
250
-
247
+
251
248
  if shipping_address = options[:shipping_address] || address
252
249
  post[:shipname] = shipping_address[:name]
253
250
  post[:address1] = shipping_address[:address1]
254
251
  post[:address2] = shipping_address[:address2]
255
252
  post[:city] = shipping_address[:city]
256
-
253
+
257
254
  case shipping_address[:country]
258
255
  when 'US', 'CA'
259
256
  post[:state] = shipping_address[:state]
260
257
  else
261
- post[:state] = 'ZZ'
258
+ post[:state] = 'ZZ'
262
259
  post[:province] = shipping_address[:state]
263
260
  end
264
-
261
+
265
262
  post[:country] = shipping_address[:country]
266
263
  post[:zip] = shipping_address[:zip]
267
- end
264
+ end
268
265
  end
269
-
266
+
270
267
  def add_amount(post, money, options)
271
268
  post[:card_amount] = amount(money)
272
269
  post[:currency] = options[:currency] || currency(money)
273
270
  end
274
-
271
+
275
272
  # Make a ruby type out of the response string
276
273
  def normalize(field)
277
274
  case field
@@ -280,13 +277,13 @@ module ActiveMerchant
280
277
  when "" then nil
281
278
  when "null" then nil
282
279
  else field
283
- end
284
- end
285
-
280
+ end
281
+ end
282
+
286
283
  def message_from(results)
287
284
  PAYMENT_GATEWAY_RESPONSES[results[:resp_code]]
288
285
  end
289
-
286
+
290
287
  def expdate(creditcard)
291
288
  year = sprintf("%.4i", creditcard.year)
292
289
  month = sprintf("%.2i", creditcard.month)
@@ -39,8 +39,8 @@ module ActiveMerchant #:nodoc:
39
39
  module Billing #:nodoc:
40
40
 
41
41
  class PsigateGateway < Gateway
42
- TEST_URL = 'https://dev.psigate.com:7989/Messenger/XMLMessenger'
43
- LIVE_URL = 'https://secure.psigate.com:7934/Messenger/XMLMessenger'
42
+ self.test_url = 'https://dev.psigate.com:7989/Messenger/XMLMessenger'
43
+ self.live_url = 'https://secure.psigate.com:7934/Messenger/XMLMessenger'
44
44
 
45
45
  self.supported_cardtypes = [:visa, :master, :american_express]
46
46
  self.supported_countries = ['CA']
@@ -91,7 +91,7 @@ module ActiveMerchant #:nodoc:
91
91
  private
92
92
 
93
93
  def commit(money, creditcard, options = {})
94
- response = parse(ssl_post(test? ? TEST_URL : LIVE_URL, post_data(money, creditcard, options)))
94
+ response = parse(ssl_post(test? ? self.test_url : self.live_url, post_data(money, creditcard, options)))
95
95
 
96
96
  Response.new(successful?(response), message_from(response), response,
97
97
  :test => test?,
@@ -29,9 +29,9 @@ module ActiveMerchant
29
29
  cattr_accessor :location
30
30
  self.location = 826
31
31
 
32
- # PslCard server URL - The url is the same whether testing or live - use
32
+ # PslCard server self.live_url - The url is the same whether testing or live - use
33
33
  # the test account when testing...
34
- URL = 'https://pslcard3.paymentsolutionsltd.com/secure/transact.asp?'
34
+ self.live_url = self.test_url = 'https://pslcard3.paymentsolutionsltd.com/secure/transact.asp?'
35
35
 
36
36
  # eCommerce sale transaction, details keyed by merchant or cardholder
37
37
  MESSAGE_TYPE = 'ESALE_KEYED'
@@ -265,7 +265,7 @@ module ActiveMerchant
265
265
  # - ActiveMerchant::Billing::Response object
266
266
  #
267
267
  def commit(request)
268
- response = parse( ssl_post(URL, post_data(request)) )
268
+ response = parse( ssl_post(self.live_url, post_data(request)) )
269
269
 
270
270
  Response.new(response[:ResponseCode] == APPROVED, response[:Message], response,
271
271
  :test => test?,
@@ -10,7 +10,7 @@ module ActiveMerchant #:nodoc:
10
10
  # * You can exclude CVV with :ignore_cvv => true
11
11
  # * All transactions use dollar values.
12
12
  class QuantumGateway < Gateway
13
- LIVE_URL = 'https://secure.quantumgateway.com/cgi/xml_requester.php'
13
+ self.live_url = self.test_url = 'https://secure.quantumgateway.com/cgi/xml_requester.php'
14
14
 
15
15
  # visa, master, american_express, discover
16
16
  self.supported_cardtypes = [:visa, :master, :american_express, :discover]
@@ -210,7 +210,7 @@ module ActiveMerchant #:nodoc:
210
210
  # Contact CyberSource, make the SOAP request, and parse the reply into a Response object
211
211
  def commit(request, options)
212
212
  headers = { 'Content-Type' => 'text/xml' }
213
- response = parse(ssl_post(LIVE_URL, build_request(request, options), headers))
213
+ response = parse(ssl_post(self.live_url, build_request(request, options), headers))
214
214
 
215
215
  success = response[:request_status] == "Success"
216
216
  message = response[:request_message]
@@ -4,7 +4,7 @@ require 'digest/md5'
4
4
  module ActiveMerchant #:nodoc:
5
5
  module Billing #:nodoc:
6
6
  class QuickpayGateway < Gateway
7
- URL = 'https://secure.quickpay.dk/api'
7
+ self.live_url = self.test_url = 'https://secure.quickpay.dk/api'
8
8
 
9
9
  self.default_currency = 'DKK'
10
10
  self.money_format = :cents
@@ -232,7 +232,7 @@ module ActiveMerchant #:nodoc:
232
232
  end
233
233
 
234
234
  def commit(action, params)
235
- response = parse(ssl_post(URL, post_data(action, params)))
235
+ response = parse(ssl_post(self.live_url, post_data(action, params)))
236
236
 
237
237
  Response.new(successful?(response), message_from(response), response,
238
238
  :test => test?,
@@ -19,8 +19,8 @@ module ActiveMerchant
19
19
  # so if validation fails you can not correct and resend using the
20
20
  # same order id
21
21
  class RealexGateway < Gateway
22
- URL = 'https://epage.payandshop.com/epage-remote.cgi'
23
-
22
+ self.live_url = self.test_url = 'https://epage.payandshop.com/epage-remote.cgi'
23
+
24
24
  CARD_MAPPING = {
25
25
  'master' => 'MC',
26
26
  'visa' => 'VISA',
@@ -81,11 +81,11 @@ module ActiveMerchant
81
81
  def void(authorization, options = {})
82
82
  request = build_void_request(authorization, options)
83
83
  commit(request)
84
- end
85
-
86
- private
87
- def commit(request)
88
- response = parse(ssl_post(URL, request))
84
+ end
85
+
86
+ private
87
+ def commit(request)
88
+ response = parse(ssl_post(self.live_url, request))
89
89
 
90
90
  Response.new(response[:result] == "00", message_from(response), response,
91
91
  :test => response[:message] =~ /\[ test system \]/,