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
@@ -1,8 +1,8 @@
1
1
  module ActiveMerchant #:nodoc:
2
2
  module Billing #:nodoc:
3
3
  class BarclaysEpdqGateway < Gateway
4
- TEST_URL = 'https://secure2.mde.epdq.co.uk:11500'
5
- LIVE_URL = 'https://secure2.epdq.co.uk:11500'
4
+ self.test_url = 'https://secure2.mde.epdq.co.uk:11500'
5
+ self.live_url = 'https://secure2.epdq.co.uk:11500'
6
6
 
7
7
  self.supported_countries = ['GB']
8
8
  self.default_currency = 'GBP'
@@ -124,7 +124,7 @@ module ActiveMerchant #:nodoc:
124
124
  end
125
125
 
126
126
  def commit(document)
127
- url = (test? ? TEST_URL : LIVE_URL)
127
+ url = (test? ? self.test_url : self.live_url)
128
128
  data = ssl_post(url, document.to_xml)
129
129
  parse(data)
130
130
  end
@@ -63,7 +63,7 @@ module ActiveMerchant #:nodoc:
63
63
  # )
64
64
  class BeanstreamGateway < Gateway
65
65
  include BeanstreamCore
66
-
66
+
67
67
  def authorize(money, source, options = {})
68
68
  post = {}
69
69
  add_amount(post, money)
@@ -1,9 +1,9 @@
1
1
  module ActiveMerchant #:nodoc:
2
2
  module Billing #:nodoc:
3
3
  module BeanstreamCore
4
- URL = 'https://www.beanstream.com/scripts/process_transaction.asp'
5
4
  RECURRING_URL = 'https://www.beanstream.com/scripts/recurring_billing.asp'
6
5
  SECURE_PROFILE_URL = 'https://www.beanstream.com/scripts/payment_profile.asp'
6
+
7
7
  SP_SERVICE_VERSION = '1.1'
8
8
 
9
9
  TRANSACTIONS = {
@@ -70,6 +70,7 @@ module ActiveMerchant #:nodoc:
70
70
 
71
71
  # The homepage URL of the gateway
72
72
  base.homepage_url = 'http://www.beanstream.com/'
73
+ base.live_url = 'https://www.beanstream.com/scripts/process_transaction.asp'
73
74
 
74
75
  # The name of the gateway
75
76
  base.display_name = 'Beanstream.com'
@@ -319,7 +320,7 @@ module ActiveMerchant #:nodoc:
319
320
  end
320
321
 
321
322
  def post(data, use_profile_api=nil)
322
- response = parse(ssl_post((use_profile_api ? SECURE_PROFILE_URL : URL), data))
323
+ response = parse(ssl_post((use_profile_api ? SECURE_PROFILE_URL : self.live_url), data))
323
324
  response[:customer_vault_id] = response[:customerCode] if response[:customerCode]
324
325
  build_response(success?(response), message_from(response), response,
325
326
  :test => test? || response[:authCode] == "TEST",
@@ -10,7 +10,7 @@ module ActiveMerchant #:nodoc:
10
10
 
11
11
  class BeanstreamInteracGateway < Gateway
12
12
  include BeanstreamCore
13
-
13
+
14
14
  # Confirm a transaction posted back from the bank to Beanstream.
15
15
  # Confirming a transaction does not require any credentials,
16
16
  # and in an application with many merchants sharing a funded
@@ -5,6 +5,8 @@ module ActiveMerchant #:nodoc:
5
5
  class BraintreeGateway < Gateway
6
6
  include BraintreeCommon
7
7
 
8
+ self.abstract_class = true
9
+
8
10
  def self.new(options={})
9
11
  if options.has_key?(:login)
10
12
  BraintreeOrangeGateway.new(options)
@@ -277,7 +277,10 @@ module ActiveMerchant #:nodoc:
277
277
  {
278
278
  "bin" => cc.bin,
279
279
  "expiration_date" => cc.expiration_date,
280
- "token" => cc.token
280
+ "token" => cc.token,
281
+ "last_4" => cc.last_4,
282
+ "card_type" => cc.card_type,
283
+ "masked_number" => cc.masked_number
281
284
  }
282
285
  end
283
286
 
@@ -327,10 +330,17 @@ module ActiveMerchant #:nodoc:
327
330
  "postal_code" => transaction.shipping_details.postal_code,
328
331
  "country_name" => transaction.shipping_details.country_name,
329
332
  }
333
+ credit_card_details = {
334
+ "masked_number" => transaction.credit_card_details.masked_number,
335
+ "bin" => transaction.credit_card_details.bin,
336
+ "last_4" => transaction.credit_card_details.last_4,
337
+ "card_type" => transaction.credit_card_details.card_type,
338
+ }
330
339
 
331
340
  {
332
341
  "order_id" => transaction.order_id,
333
342
  "status" => transaction.status,
343
+ "credit_card_details" => credit_card_details,
334
344
  "customer_details" => customer_details,
335
345
  "billing_details" => billing_details,
336
346
  "shipping_details" => shipping_details,
@@ -7,10 +7,8 @@ module ActiveMerchant #:nodoc:
7
7
  include BraintreeCommon
8
8
 
9
9
  self.display_name = 'Braintree (Orange Platform)'
10
-
11
- def api_url
12
- 'https://secure.braintreepaymentgateway.com/api/transact.php'
13
- end
10
+
11
+ self.live_url = self.test_url = 'https://secure.braintreepaymentgateway.com/api/transact.php'
14
12
 
15
13
  def add_processor(post, options)
16
14
  post[:processor_id] = options[:processor] unless options[:processor].nil?
@@ -18,7 +18,7 @@ module ActiveMerchant #:nodoc:
18
18
  # * Visa Purchasing
19
19
  #
20
20
  class CardStreamGateway < Gateway
21
- URL = 'https://gateway.cardstream.com/process.ashx'
21
+ self.live_url = self.test_url = 'https://gateway.cardstream.com/process.ashx'
22
22
 
23
23
  self.money_format = :cents
24
24
  self.default_currency = 'GBP'
@@ -158,7 +158,7 @@ module ActiveMerchant #:nodoc:
158
158
  end
159
159
 
160
160
  def commit(action, parameters)
161
- response = parse( ssl_post(URL, post_data(action, parameters)) )
161
+ response = parse( ssl_post(self.live_url, post_data(action, parameters)) )
162
162
 
163
163
  Response.new(response[:response_code] == APPROVED, message_from(response), response,
164
164
  :test => test?,
@@ -1,8 +1,7 @@
1
1
  module ActiveMerchant #:nodoc:
2
2
  module Billing #:nodoc:
3
3
  class CertoDirectGateway < Gateway
4
- class_attribute :gateway_url
5
- self.gateway_url = "https://secure.certodirect.com/gateway/process/v2"
4
+ self.live_url = self.test_url = "https://secure.certodirect.com/gateway/process/v2"
6
5
 
7
6
  self.supported_countries = [
8
7
  "BE", "BG", "CZ", "DK", "DE", "EE", "IE", "EL", "ES", "FR",
@@ -111,7 +110,7 @@ module ActiveMerchant #:nodoc:
111
110
 
112
111
  def commit(request_xml)
113
112
  begin
114
- response = Hash.from_xml(ssl_post(gateway_url, request_xml, headers))
113
+ response = Hash.from_xml(ssl_post(self.live_url, request_xml, headers))
115
114
  Response.new(success?(response),
116
115
  message(response),
117
116
  response,
@@ -24,8 +24,8 @@ module ActiveMerchant #:nodoc:
24
24
  # calculating tax/VAT.
25
25
  # * All transactions use dollar values.
26
26
  class CyberSourceGateway < Gateway
27
- TEST_URL = 'https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor'
28
- LIVE_URL = 'https://ics2ws.ic3.com/commerce/1.x/transactionProcessor'
27
+ self.test_url = 'https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor'
28
+ self.live_url = 'https://ics2ws.ic3.com/commerce/1.x/transactionProcessor'
29
29
 
30
30
  XSD_VERSION = "1.69"
31
31
 
@@ -523,7 +523,7 @@ module ActiveMerchant #:nodoc:
523
523
  # Contact CyberSource, make the SOAP request, and parse the reply into a
524
524
  # Response object
525
525
  def commit(request, options)
526
- response = parse(ssl_post(test? ? TEST_URL : LIVE_URL, build_request(request, options)))
526
+ response = parse(ssl_post(test? ? self.test_url : self.live_url, build_request(request, options)))
527
527
 
528
528
  success = response[:decision] == "ACCEPT"
529
529
  message = @@response_codes[('r' + response[:reasonCode]).to_sym] rescue response[:message]
@@ -17,8 +17,8 @@ module ActiveMerchant
17
17
  self.display_name = 'DataCash'
18
18
 
19
19
  # Datacash server URLs
20
- TEST_URL = 'https://testserver.datacash.com/Transaction'
21
- LIVE_URL = 'https://mars.transaction.datacash.com/Transaction'
20
+ self.test_url = 'https://testserver.datacash.com/Transaction'
21
+ self.live_url = 'https://mars.transaction.datacash.com/Transaction'
22
22
 
23
23
  # Different Card Transaction Types
24
24
  AUTH_TYPE = 'auth'
@@ -531,7 +531,7 @@ module ActiveMerchant
531
531
  # - ActiveMerchant::Billing::Response object
532
532
  #
533
533
  def commit(request)
534
- response = parse(ssl_post(test? ? TEST_URL : LIVE_URL, request))
534
+ response = parse(ssl_post(test? ? self.test_url : self.live_url, request))
535
535
 
536
536
  Response.new(response[:status] == DATACASH_SUCCESS, response[:reason], response,
537
537
  :test => test?,
@@ -9,8 +9,8 @@ module ActiveMerchant #:nodoc:
9
9
  self.homepage_url = 'http://www.concordefsnet.com/'
10
10
  self.display_name = 'Efsnet'
11
11
 
12
- TEST_URL = 'https://testefsnet.concordebiz.com/efsnet.dll'
13
- LIVE_URL = 'https://efsnet.concordebiz.com/efsnet.dll'
12
+ self.test_url = 'https://testefsnet.concordebiz.com/efsnet.dll'
13
+ self.live_url = 'https://efsnet.concordebiz.com/efsnet.dll'
14
14
 
15
15
  # login is your Store ID
16
16
  # password is your Store Key
@@ -150,7 +150,7 @@ module ActiveMerchant #:nodoc:
150
150
 
151
151
 
152
152
  def commit(action, parameters)
153
- response = parse(ssl_post(test? ? TEST_URL : LIVE_URL, post_data(action, parameters), 'Content-Type' => 'text/xml'))
153
+ response = parse(ssl_post(test? ? self.test_url : self.live_url, post_data(action, parameters), 'Content-Type' => 'text/xml'))
154
154
 
155
155
  Response.new(success?(response), message_from(response[:result_message]), response,
156
156
  :test => test?,
@@ -2,7 +2,7 @@ module ActiveMerchant #:nodoc:
2
2
  module Billing #:nodoc:
3
3
  class EpayGateway < Gateway
4
4
  API_HOST = 'ssl.ditonlinebetalingssystem.dk'
5
- SOAP_URL = 'https://' + API_HOST + '/remote/payment'
5
+ self.live_url = 'https://' + API_HOST + '/remote/payment'
6
6
 
7
7
  self.default_currency = 'DKK'
8
8
  self.money_format = :cents
@@ -236,7 +236,7 @@ module ActiveMerchant #:nodoc:
236
236
  'Content-Type' => 'text/xml; charset=utf-8',
237
237
  'Host' => API_HOST,
238
238
  'Content-Length' => data.size.to_s,
239
- 'SOAPAction' => SOAP_URL + '/' + soap_call
239
+ 'SOAPAction' => self.live_url + '/' + soap_call
240
240
  }
241
241
  end
242
242
 
@@ -247,7 +247,7 @@ module ActiveMerchant #:nodoc:
247
247
  'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
248
248
  'xmlns:soap' => 'http://schemas.xmlsoap.org/soap/envelope/' } do
249
249
  xml.tag! 'soap:Body' do
250
- xml.tag! soap_call, { 'xmlns' => SOAP_URL } do
250
+ xml.tag! soap_call, { 'xmlns' => self.live_url } do
251
251
  xml.tag! 'merchantnumber', @options[:login]
252
252
  xml.tag! 'transactionid', params[:transaction]
253
253
  xml.tag! 'amount', params[:amount].to_s if soap_call != 'delete'
@@ -64,11 +64,12 @@ module ActiveMerchant #:nodoc:
64
64
  # below and the rest of active_merchant's documentation.
65
65
 
66
66
  class EwayGateway < Gateway
67
- TEST_URL = 'https://www.eway.com.au/gateway/xmltest/testpage.asp'
68
- LIVE_URL = 'https://www.eway.com.au/gateway/xmlpayment.asp'
69
-
70
- TEST_CVN_URL = 'https://www.eway.com.au/gateway_cvn/xmltest/testpage.asp'
71
- LIVE_CVN_URL = 'https://www.eway.com.au/gateway_cvn/xmlpayment.asp'
67
+ self.test_url = 'https://www.eway.com.au/gateway/xmltest/testpage.asp'
68
+ self.live_url = 'https://www.eway.com.au/gateway/xmlpayment.asp'
69
+
70
+ class_attribute :test_cvn_url, :live_cvn_url
71
+ self.test_cvn_url = 'https://www.eway.com.au/gateway_cvn/xmltest/testpage.asp'
72
+ self.live_cvn_url = 'https://www.eway.com.au/gateway_cvn/xmlpayment.asp'
72
73
 
73
74
  MESSAGES = {
74
75
  "00" => "Transaction Approved",
@@ -275,9 +276,9 @@ module ActiveMerchant #:nodoc:
275
276
 
276
277
  def gateway_url(cvn, test)
277
278
  if cvn
278
- test ? TEST_CVN_URL : LIVE_CVN_URL
279
+ test ? self.test_cvn_url : self.live_cvn_url
279
280
  else
280
- test ? TEST_URL : LIVE_URL
281
+ test ? self.test_url : self.live_url
281
282
  end
282
283
  end
283
284
 
@@ -1,8 +1,8 @@
1
1
  module ActiveMerchant #:nodoc:
2
2
  module Billing #:nodoc:
3
3
  class EwayManagedGateway < Gateway
4
- TEST_URL = 'https://www.eway.com.au/gateway/ManagedPaymentService/test/managedCreditCardPayment.asmx'
5
- LIVE_URL = 'https://www.eway.com.au/gateway/ManagedPaymentService/managedCreditCardPayment.asmx'
4
+ self.test_url = 'https://www.eway.com.au/gateway/ManagedPaymentService/test/managedCreditCardPayment.asmx'
5
+ self.live_url = 'https://www.eway.com.au/gateway/ManagedPaymentService/managedCreditCardPayment.asmx'
6
6
 
7
7
  # The countries the gateway supports merchants from as 2 digit ISO country codes
8
8
  self.supported_countries = ['AU']
@@ -194,7 +194,7 @@ private
194
194
 
195
195
  def commit(action, post)
196
196
  raw = begin
197
- ssl_post(test? ? TEST_URL : LIVE_URL, soap_request(post, action), 'Content-Type' => 'application/soap+xml; charset=utf-8')
197
+ ssl_post(test? ? self.test_url : self.live_url, soap_request(post, action), 'Content-Type' => 'application/soap+xml; charset=utf-8')
198
198
  rescue ResponseError => e
199
199
  e.response.body
200
200
  end
@@ -1,7 +1,7 @@
1
1
  module ActiveMerchant #:nodoc:
2
2
  module Billing #:nodoc:
3
3
  class ExactGateway < Gateway
4
- URL = 'https://secure2.e-xact.com/vplug-in/transaction/rpc-enc/service.asmx'
4
+ self.live_url = self.test_url = 'https://secure2.e-xact.com/vplug-in/transaction/rpc-enc/service.asmx'
5
5
 
6
6
  API_VERSION = "8.5"
7
7
 
@@ -169,7 +169,7 @@ module ActiveMerchant #:nodoc:
169
169
  end
170
170
 
171
171
  def commit(action, request)
172
- response = parse(ssl_post(URL, build_request(action, request), POST_HEADERS))
172
+ response = parse(ssl_post(self.live_url, build_request(action, request), POST_HEADERS))
173
173
 
174
174
  Response.new(successful?(response), message_from(response), response,
175
175
  :test => test?,
@@ -3,8 +3,8 @@ require 'json'
3
3
  module ActiveMerchant #:nodoc:
4
4
  module Billing #:nodoc:
5
5
  class FatZebraGateway < Gateway
6
- LIVE_URL = "https://gateway.fatzebra.com.au/v1.0"
7
- SANDBOX_URL = "https://gateway.sandbox.fatzebra.com.au/v1.0"
6
+ self.live_url = "https://gateway.fatzebra.com.au/v1.0"
7
+ self.test_url = "https://gateway.sandbox.fatzebra.com.au/v1.0"
8
8
 
9
9
  self.supported_countries = ['AU']
10
10
  self.default_currency = 'AUD'
@@ -136,7 +136,7 @@ module ActiveMerchant #:nodoc:
136
136
 
137
137
  # Build the URL based on the AM mode and the URI
138
138
  def get_url(uri)
139
- base = test? ? SANDBOX_URL : LIVE_URL
139
+ base = test? ? self.test_url : self.live_url
140
140
  base + "/" + uri
141
141
  end
142
142
 
@@ -149,4 +149,4 @@ module ActiveMerchant #:nodoc:
149
149
  end
150
150
  end
151
151
  end
152
- end
152
+ end
@@ -2,7 +2,7 @@ module ActiveMerchant #:nodoc:
2
2
  module Billing #:nodoc:
3
3
  class FederatedCanadaGateway < Gateway
4
4
  # Same URL for both test and live, testing is done by using the test username (demo) and password (password).
5
- URL = 'https://secure.federatedgateway.com/api/transact.php'
5
+ self.live_url = self.test_url = 'https://secure.federatedgateway.com/api/transact.php'
6
6
 
7
7
  APPROVED, DECLINED, ERROR = 1, 2, 3
8
8
 
@@ -124,7 +124,7 @@ module ActiveMerchant #:nodoc:
124
124
 
125
125
  def commit(action, money, parameters)
126
126
  parameters[:amount] = amount(money)
127
- data = ssl_post(URL, post_data(action, parameters))
127
+ data = ssl_post(self.live_url, post_data(action, parameters))
128
128
  response = parse(data)
129
129
  message = message_from(response)
130
130
  test_mode = test?
@@ -7,8 +7,8 @@ module ActiveMerchant #:nodoc:
7
7
  end
8
8
 
9
9
  # both URLs are IP restricted
10
- TEST_URL = 'https://apgcert.first-pay.com/AcqENGIN/SecureCapture'
11
- LIVE_URL = 'https://acqengin.first-pay.com/AcqENGIN/SecureCapture'
10
+ self.test_url = 'https://apgcert.first-pay.com/AcqENGIN/SecureCapture'
11
+ self.live_url = 'https://acqengin.first-pay.com/AcqENGIN/SecureCapture'
12
12
 
13
13
  # The countries the gateway supports merchants from as 2 digit ISO country codes
14
14
  self.supported_countries = ['US']
@@ -119,7 +119,7 @@ module ActiveMerchant #:nodoc:
119
119
  end
120
120
 
121
121
  def commit(action, money, post)
122
- response = parse( ssl_post(test? ? TEST_URL : LIVE_URL, post_data(action, post, money)) )
122
+ response = parse( ssl_post(test? ? self.test_url : self.live_url, post_data(action, post, money)) )
123
123
 
124
124
  Response.new(response[:response] == 'CAPTURED', response[:message], response,
125
125
  :test => test?,
@@ -5,7 +5,7 @@ end
5
5
  module ActiveMerchant #:nodoc:
6
6
  module Billing #:nodoc:
7
7
  class GarantiGateway < Gateway
8
- URL = 'https://sanalposprov.garanti.com.tr/VPServlet'
8
+ self.live_url = self.test_url = 'https://sanalposprov.garanti.com.tr/VPServlet'
9
9
 
10
10
  # The countries the gateway supports merchants from as 2 digit ISO country codes
11
11
  self.supported_countries = ['US','TR']
@@ -222,7 +222,7 @@ module ActiveMerchant #:nodoc:
222
222
  end
223
223
 
224
224
  def commit(money,request)
225
- raw_response = ssl_post(URL, "data=" + request)
225
+ raw_response = ssl_post(self.live_url, "data=" + request)
226
226
  response = parse(raw_response)
227
227
 
228
228
  success = success?(response)
@@ -6,11 +6,13 @@ module ActiveMerchant #:nodoc:
6
6
  # - does not support multiple subID per merchant
7
7
  # - language is fixed to 'nl'
8
8
  class IdealBaseGateway < Gateway
9
- class_attribute :test_url, :live_url, :server_pem, :pem_password, :default_expiration_period
9
+ class_attribute :server_pem, :pem_password, :default_expiration_period
10
10
  self.default_expiration_period = 'PT10M'
11
11
  self.default_currency = 'EUR'
12
12
  self.pem_password = true
13
13
 
14
+ self.abstract_class = true
15
+
14
16
  # These constants will never change for most users
15
17
  AUTHENTICATION_TYPE = 'SHA1_RSA'
16
18
  LANGUAGE = 'nl'
@@ -2,7 +2,7 @@ require File.join(File.dirname(__FILE__), '..', 'check.rb')
2
2
  module ActiveMerchant #:nodoc:
3
3
  module Billing #:nodoc:
4
4
  class InspireGateway < Gateway
5
- URL = 'https://secure.inspiregateway.net/api/transact.php'
5
+ self.live_url = self.test_url = 'https://secure.inspiregateway.net/api/transact.php'
6
6
 
7
7
  self.supported_countries = ['US']
8
8
  self.supported_cardtypes = [:visa, :master, :american_express]
@@ -167,7 +167,7 @@ module ActiveMerchant #:nodoc:
167
167
  def commit(action, money, parameters)
168
168
  parameters[:amount] = amount(money) if money
169
169
 
170
- response = parse( ssl_post(URL, post_data(action,parameters)) )
170
+ response = parse( ssl_post(self.live_url, post_data(action,parameters)) )
171
171
 
172
172
  Response.new(response["response"] == "1", message_from(response), response,
173
173
  :authorization => response["transactionid"],
@@ -1,7 +1,7 @@
1
1
  module ActiveMerchant #:nodoc:
2
2
  module Billing #:nodoc:
3
3
  class InstapayGateway < Gateway
4
- GATEWAY_URL = 'https://trans.instapaygateway.com/cgi-bin/process.cgi'
4
+ self.live_url = 'https://trans.instapaygateway.com/cgi-bin/process.cgi'
5
5
 
6
6
  # The countries the gateway supports merchants from as 2 digit ISO country codes
7
7
  self.supported_countries = ['US']
@@ -138,7 +138,7 @@ module ActiveMerchant #:nodoc:
138
138
  end
139
139
 
140
140
  def commit(action, parameters)
141
- data = ssl_post GATEWAY_URL , post_data(action, parameters)
141
+ data = ssl_post self.live_url, post_data(action, parameters)
142
142
  response = parse(data)
143
143
 
144
144
  Response.new(response[:success] , response[:message], response,