activemerchant 1.79.2 → 1.80.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +33 -0
  3. data/README.md +10 -2
  4. data/lib/active_merchant.rb +1 -1
  5. data/lib/active_merchant/billing/check.rb +4 -4
  6. data/lib/active_merchant/billing/compatibility.rb +1 -1
  7. data/lib/active_merchant/billing/credit_card.rb +21 -21
  8. data/lib/active_merchant/billing/credit_card_formatting.rb +2 -2
  9. data/lib/active_merchant/billing/credit_card_methods.rb +2 -2
  10. data/lib/active_merchant/billing/gateway.rb +13 -13
  11. data/lib/active_merchant/billing/gateways/adyen.rb +31 -15
  12. data/lib/active_merchant/billing/gateways/allied_wallet.rb +22 -22
  13. data/lib/active_merchant/billing/gateways/authorize_net.rb +72 -72
  14. data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +3 -3
  15. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +3 -3
  16. data/lib/active_merchant/billing/gateways/axcessms.rb +51 -51
  17. data/lib/active_merchant/billing/gateways/balanced.rb +29 -29
  18. data/lib/active_merchant/billing/gateways/bank_frick.rb +3 -3
  19. data/lib/active_merchant/billing/gateways/banwire.rb +8 -8
  20. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +5 -5
  21. data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +6 -6
  22. data/lib/active_merchant/billing/gateways/be2bill.rb +2 -2
  23. data/lib/active_merchant/billing/gateways/beanstream.rb +1 -1
  24. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +69 -69
  25. data/lib/active_merchant/billing/gateways/blue_pay.rb +19 -19
  26. data/lib/active_merchant/billing/gateways/blue_snap.rb +42 -42
  27. data/lib/active_merchant/billing/gateways/bogus.rb +10 -10
  28. data/lib/active_merchant/billing/gateways/borgun.rb +10 -10
  29. data/lib/active_merchant/billing/gateways/bpoint.rb +1 -1
  30. data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +2 -2
  31. data/lib/active_merchant/billing/gateways/braintree_blue.rb +94 -94
  32. data/lib/active_merchant/billing/gateways/braintree_orange.rb +1 -1
  33. data/lib/active_merchant/billing/gateways/bridge_pay.rb +39 -39
  34. data/lib/active_merchant/billing/gateways/cams.rb +12 -12
  35. data/lib/active_merchant/billing/gateways/card_connect.rb +38 -13
  36. data/lib/active_merchant/billing/gateways/card_stream.rb +116 -116
  37. data/lib/active_merchant/billing/gateways/cardknox.rb +7 -7
  38. data/lib/active_merchant/billing/gateways/cardprocess.rb +1 -1
  39. data/lib/active_merchant/billing/gateways/cashnet.rb +10 -10
  40. data/lib/active_merchant/billing/gateways/cc5.rb +3 -5
  41. data/lib/active_merchant/billing/gateways/cecabank.rb +6 -6
  42. data/lib/active_merchant/billing/gateways/cenpos.rb +36 -36
  43. data/lib/active_merchant/billing/gateways/checkout.rb +5 -5
  44. data/lib/active_merchant/billing/gateways/checkout_v2.rb +31 -31
  45. data/lib/active_merchant/billing/gateways/clearhaus.rb +5 -5
  46. data/lib/active_merchant/billing/gateways/commercegate.rb +6 -6
  47. data/lib/active_merchant/billing/gateways/conekta.rb +24 -19
  48. data/lib/active_merchant/billing/gateways/creditcall.rb +41 -41
  49. data/lib/active_merchant/billing/gateways/credorax.rb +104 -103
  50. data/lib/active_merchant/billing/gateways/culqi.rb +25 -25
  51. data/lib/active_merchant/billing/gateways/cyber_source.rb +65 -65
  52. data/lib/active_merchant/billing/gateways/data_cash.rb +4 -4
  53. data/lib/active_merchant/billing/gateways/dibs.rb +24 -24
  54. data/lib/active_merchant/billing/gateways/digitzs.rb +35 -35
  55. data/lib/active_merchant/billing/gateways/ebanx.rb +26 -26
  56. data/lib/active_merchant/billing/gateways/efsnet.rb +10 -10
  57. data/lib/active_merchant/billing/gateways/elavon.rb +5 -5
  58. data/lib/active_merchant/billing/gateways/element.rb +35 -35
  59. data/lib/active_merchant/billing/gateways/epay.rb +4 -4
  60. data/lib/active_merchant/billing/gateways/evo_ca.rb +1 -1
  61. data/lib/active_merchant/billing/gateways/eway.rb +65 -65
  62. data/lib/active_merchant/billing/gateways/eway_managed.rb +11 -11
  63. data/lib/active_merchant/billing/gateways/eway_rapid.rb +31 -31
  64. data/lib/active_merchant/billing/gateways/exact.rb +12 -12
  65. data/lib/active_merchant/billing/gateways/ezic.rb +13 -13
  66. data/lib/active_merchant/billing/gateways/fat_zebra.rb +24 -24
  67. data/lib/active_merchant/billing/gateways/federated_canada.rb +3 -3
  68. data/lib/active_merchant/billing/gateways/first_giving.rb +16 -16
  69. data/lib/active_merchant/billing/gateways/first_pay.rb +7 -4
  70. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +71 -71
  71. data/lib/active_merchant/billing/gateways/flo2cash.rb +12 -12
  72. data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +1 -1
  73. data/lib/active_merchant/billing/gateways/forte.rb +26 -16
  74. data/lib/active_merchant/billing/gateways/garanti.rb +10 -12
  75. data/lib/active_merchant/billing/gateways/global_collect.rb +88 -88
  76. data/lib/active_merchant/billing/gateways/global_transport.rb +4 -4
  77. data/lib/active_merchant/billing/gateways/hdfc.rb +33 -33
  78. data/lib/active_merchant/billing/gateways/hps.rb +28 -28
  79. data/lib/active_merchant/billing/gateways/iats_payments.rb +26 -26
  80. data/lib/active_merchant/billing/gateways/inspire.rb +15 -15
  81. data/lib/active_merchant/billing/gateways/instapay.rb +4 -4
  82. data/lib/active_merchant/billing/gateways/ipp.rb +17 -17
  83. data/lib/active_merchant/billing/gateways/iridium.rb +207 -207
  84. data/lib/active_merchant/billing/gateways/iveri.rb +8 -8
  85. data/lib/active_merchant/billing/gateways/jetpay.rb +134 -134
  86. data/lib/active_merchant/billing/gateways/jetpay_v2.rb +141 -141
  87. data/lib/active_merchant/billing/gateways/komoju.rb +15 -15
  88. data/lib/active_merchant/billing/gateways/kushki.rb +31 -37
  89. data/lib/active_merchant/billing/gateways/latitude19.rb +64 -64
  90. data/lib/active_merchant/billing/gateways/linkpoint.rb +22 -22
  91. data/lib/active_merchant/billing/gateways/litle.rb +4 -4
  92. data/lib/active_merchant/billing/gateways/mastercard.rb +3 -3
  93. data/lib/active_merchant/billing/gateways/maxipago.rb +2 -2
  94. data/lib/active_merchant/billing/gateways/mercado_pago.rb +28 -28
  95. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +9 -9
  96. data/lib/active_merchant/billing/gateways/merchant_one.rb +6 -6
  97. data/lib/active_merchant/billing/gateways/merchant_partners.rb +24 -24
  98. data/lib/active_merchant/billing/gateways/merchant_ware.rb +49 -49
  99. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +36 -36
  100. data/lib/active_merchant/billing/gateways/merchant_warrior.rb +4 -4
  101. data/lib/active_merchant/billing/gateways/mercury.rb +28 -28
  102. data/lib/active_merchant/billing/gateways/metrics_global.rb +7 -7
  103. data/lib/active_merchant/billing/gateways/micropayment.rb +31 -31
  104. data/lib/active_merchant/billing/gateways/migs.rb +11 -9
  105. data/lib/active_merchant/billing/gateways/modern_payments.rb +1 -1
  106. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +16 -16
  107. data/lib/active_merchant/billing/gateways/monei.rb +5 -5
  108. data/lib/active_merchant/billing/gateways/moneris.rb +26 -26
  109. data/lib/active_merchant/billing/gateways/moneris_us.rb +81 -37
  110. data/lib/active_merchant/billing/gateways/money_movers.rb +3 -3
  111. data/lib/active_merchant/billing/gateways/mundipagg.rb +1 -1
  112. data/lib/active_merchant/billing/gateways/nab_transact.rb +6 -6
  113. data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +3 -3
  114. data/lib/active_merchant/billing/gateways/netaxept.rb +15 -15
  115. data/lib/active_merchant/billing/gateways/netbanx.rb +2 -2
  116. data/lib/active_merchant/billing/gateways/netbilling.rb +1 -1
  117. data/lib/active_merchant/billing/gateways/netpay.rb +5 -5
  118. data/lib/active_merchant/billing/gateways/nmi.rb +18 -18
  119. data/lib/active_merchant/billing/gateways/ogone.rb +22 -22
  120. data/lib/active_merchant/billing/gateways/omise.rb +3 -3
  121. data/lib/active_merchant/billing/gateways/openpay.rb +6 -4
  122. data/lib/active_merchant/billing/gateways/opp.rb +4 -4
  123. data/lib/active_merchant/billing/gateways/optimal_payment.rb +2 -2
  124. data/lib/active_merchant/billing/gateways/orbital.rb +61 -61
  125. data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +4 -4
  126. data/lib/active_merchant/billing/gateways/pac_net_raven.rb +5 -5
  127. data/lib/active_merchant/billing/gateways/pagarme.rb +27 -27
  128. data/lib/active_merchant/billing/gateways/pago_facil.rb +8 -8
  129. data/lib/active_merchant/billing/gateways/pay_conex.rb +25 -25
  130. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +32 -32
  131. data/lib/active_merchant/billing/gateways/pay_hub.rb +29 -29
  132. data/lib/active_merchant/billing/gateways/pay_junction.rb +7 -7
  133. data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +30 -30
  134. data/lib/active_merchant/billing/gateways/pay_secure.rb +4 -4
  135. data/lib/active_merchant/billing/gateways/paybox_direct.rb +15 -15
  136. data/lib/active_merchant/billing/gateways/payeezy.rb +5 -5
  137. data/lib/active_merchant/billing/gateways/payex.rb +4 -4
  138. data/lib/active_merchant/billing/gateways/payflow.rb +7 -7
  139. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +23 -22
  140. data/lib/active_merchant/billing/gateways/payflow_express.rb +2 -2
  141. data/lib/active_merchant/billing/gateways/payment_express.rb +40 -37
  142. data/lib/active_merchant/billing/gateways/paymentez.rb +11 -3
  143. data/lib/active_merchant/billing/gateways/paymill.rb +115 -115
  144. data/lib/active_merchant/billing/gateways/paypal.rb +1 -1
  145. data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +1 -1
  146. data/lib/active_merchant/billing/gateways/payscout.rb +1 -1
  147. data/lib/active_merchant/billing/gateways/paystation.rb +14 -14
  148. data/lib/active_merchant/billing/gateways/payu_in.rb +43 -43
  149. data/lib/active_merchant/billing/gateways/payu_latam.rb +41 -41
  150. data/lib/active_merchant/billing/gateways/payway.rb +6 -6
  151. data/lib/active_merchant/billing/gateways/pin.rb +7 -7
  152. data/lib/active_merchant/billing/gateways/plugnpay.rb +62 -62
  153. data/lib/active_merchant/billing/gateways/pro_pay.rb +123 -123
  154. data/lib/active_merchant/billing/gateways/psigate.rb +16 -16
  155. data/lib/active_merchant/billing/gateways/psl_card.rb +13 -13
  156. data/lib/active_merchant/billing/gateways/qbms.rb +52 -52
  157. data/lib/active_merchant/billing/gateways/quantum.rb +5 -5
  158. data/lib/active_merchant/billing/gateways/quickbooks.rb +10 -10
  159. data/lib/active_merchant/billing/gateways/quickpay.rb +1 -1
  160. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +11 -11
  161. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +3 -3
  162. data/lib/active_merchant/billing/gateways/qvalent.rb +55 -55
  163. data/lib/active_merchant/billing/gateways/realex.rb +16 -15
  164. data/lib/active_merchant/billing/gateways/redsys.rb +128 -121
  165. data/lib/active_merchant/billing/gateways/s5.rb +5 -5
  166. data/lib/active_merchant/billing/gateways/safe_charge.rb +16 -16
  167. data/lib/active_merchant/billing/gateways/sage.rb +20 -20
  168. data/lib/active_merchant/billing/gateways/sage_pay.rb +32 -32
  169. data/lib/active_merchant/billing/gateways/sallie_mae.rb +11 -11
  170. data/lib/active_merchant/billing/gateways/secure_net.rb +19 -19
  171. data/lib/active_merchant/billing/gateways/secure_pay.rb +5 -5
  172. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +7 -7
  173. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +9 -9
  174. data/lib/active_merchant/billing/gateways/securion_pay.rb +12 -12
  175. data/lib/active_merchant/billing/gateways/skip_jack.rb +28 -28
  176. data/lib/active_merchant/billing/gateways/smart_ps.rb +31 -31
  177. data/lib/active_merchant/billing/gateways/so_easy_pay.rb +3 -3
  178. data/lib/active_merchant/billing/gateways/spreedly_core.rb +1 -1
  179. data/lib/active_merchant/billing/gateways/stripe.rb +63 -63
  180. data/lib/active_merchant/billing/gateways/swipe_checkout.rb +5 -5
  181. data/lib/active_merchant/billing/gateways/telr.rb +26 -26
  182. data/lib/active_merchant/billing/gateways/trans_first.rb +28 -28
  183. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +224 -224
  184. data/lib/active_merchant/billing/gateways/transact_pro.rb +7 -7
  185. data/lib/active_merchant/billing/gateways/transnational.rb +1 -1
  186. data/lib/active_merchant/billing/gateways/trexle.rb +5 -5
  187. data/lib/active_merchant/billing/gateways/trust_commerce.rb +38 -38
  188. data/lib/active_merchant/billing/gateways/usa_epay.rb +3 -3
  189. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +37 -37
  190. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +3 -3
  191. data/lib/active_merchant/billing/gateways/vanco.rb +25 -25
  192. data/lib/active_merchant/billing/gateways/verifi.rb +40 -40
  193. data/lib/active_merchant/billing/gateways/viaklix.rb +5 -5
  194. data/lib/active_merchant/billing/gateways/visanet_peru.rb +64 -36
  195. data/lib/active_merchant/billing/gateways/webpay.rb +8 -8
  196. data/lib/active_merchant/billing/gateways/wepay.rb +25 -25
  197. data/lib/active_merchant/billing/gateways/wirecard.rb +26 -26
  198. data/lib/active_merchant/billing/gateways/worldpay.rb +15 -15
  199. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +42 -42
  200. data/lib/active_merchant/billing/gateways/worldpay_us.rb +17 -17
  201. data/lib/active_merchant/billing/model.rb +2 -2
  202. data/lib/active_merchant/billing/network_tokenization_credit_card.rb +1 -1
  203. data/lib/active_merchant/billing/rails.rb +1 -1
  204. data/lib/active_merchant/connection.rb +10 -8
  205. data/lib/active_merchant/country.rb +1 -1
  206. data/lib/active_merchant/net_http_ssl_connection.rb +1 -0
  207. data/lib/active_merchant/network_connection_retries.rb +12 -12
  208. data/lib/active_merchant/post_data.rb +1 -1
  209. data/lib/active_merchant/posts_data.rb +1 -1
  210. data/lib/active_merchant/version.rb +1 -1
  211. data/lib/certs/cacert.pem +37 -0
  212. data/lib/support/gateway_support.rb +2 -2
  213. data/lib/support/ssl_verify.rb +5 -5
  214. data/lib/support/ssl_version.rb +7 -7
  215. metadata +3 -7
  216. data/lib/active_merchant/billing/gateways/ideal/ideal_base.rb +0 -246
  217. data/lib/active_merchant/billing/gateways/ideal/ideal_rabobank.pem +0 -13
  218. data/lib/active_merchant/billing/gateways/ideal/ideal_response.rb +0 -29
  219. data/lib/active_merchant/billing/gateways/ideal_rabobank.rb +0 -66
@@ -20,8 +20,8 @@ module ActiveMerchant #:nodoc:
20
20
 
21
21
  class_attribute :test_url, :live_url
22
22
 
23
- self.test_url = "https://secure.metricsglobalgateway.com/gateway/transact.dll?testing=true"
24
- self.live_url = "https://secure.metricsglobalgateway.com/gateway/transact.dll"
23
+ self.test_url = 'https://secure.metricsglobalgateway.com/gateway/transact.dll?testing=true'
24
+ self.live_url = 'https://secure.metricsglobalgateway.com/gateway/transact.dll'
25
25
 
26
26
  class_attribute :duplicate_window
27
27
 
@@ -213,14 +213,14 @@ module ActiveMerchant #:nodoc:
213
213
  post[:version] = API_VERSION
214
214
  post[:login] = @options[:login]
215
215
  post[:tran_key] = @options[:password]
216
- post[:relay_response] = "FALSE"
216
+ post[:relay_response] = 'FALSE'
217
217
  post[:type] = action
218
- post[:delim_data] = "TRUE"
219
- post[:delim_char] = ","
220
- post[:encap_char] = "$"
218
+ post[:delim_data] = 'TRUE'
219
+ post[:delim_char] = ','
220
+ post[:encap_char] = '$'
221
221
  post[:solution_ID] = application_id if application_id
222
222
 
223
- request = post.merge(parameters).collect { |key, value| "x_#{key}=#{CGI.escape(value.to_s)}" }.join("&")
223
+ request = post.merge(parameters).collect { |key, value| "x_#{key}=#{CGI.escape(value.to_s)}" }.join('&')
224
224
  request
225
225
  end
226
226
 
@@ -2,13 +2,13 @@ module ActiveMerchant #:nodoc:
2
2
  module Billing #:nodoc:
3
3
  class MicropaymentGateway < Gateway
4
4
 
5
- self.display_name = "micropayment"
6
- self.homepage_url = "https://www.micropayment.de/"
5
+ self.display_name = 'micropayment'
6
+ self.homepage_url = 'https://www.micropayment.de/'
7
7
 
8
- self.test_url = self.live_url = "https://sipg.micropayment.de/public/creditcardpsp/v1/nvp/"
8
+ self.test_url = self.live_url = 'https://sipg.micropayment.de/public/creditcardpsp/v1/nvp/'
9
9
 
10
10
  self.supported_countries = %w(DE)
11
- self.default_currency = "EUR"
11
+ self.default_currency = 'EUR'
12
12
  self.money_format = :cents
13
13
  self.supported_cardtypes = [:visa, :master, :american_express]
14
14
 
@@ -24,7 +24,7 @@ module ActiveMerchant #:nodoc:
24
24
  add_payment_method(post, payment_method, options)
25
25
  add_customer_data(post, options)
26
26
  add_address(post, options)
27
- commit("purchase", post)
27
+ commit('purchase', post)
28
28
  end
29
29
 
30
30
  def authorize(amount, payment_method, options={})
@@ -33,27 +33,27 @@ module ActiveMerchant #:nodoc:
33
33
  add_payment_method(post, payment_method, options)
34
34
  add_customer_data(post, options)
35
35
  add_address(post, options)
36
- commit("authorize", post)
36
+ commit('authorize', post)
37
37
  end
38
38
 
39
39
  def capture(amount, authorization, options={})
40
40
  post = {}
41
41
  add_reference(post, authorization)
42
42
  add_invoice(post, amount, options)
43
- commit("capture", post)
43
+ commit('capture', post)
44
44
  end
45
45
 
46
46
  def void(authorization, options={})
47
47
  post = {}
48
48
  add_reference(post, authorization)
49
- commit("void", post)
49
+ commit('void', post)
50
50
  end
51
51
 
52
52
  def refund(amount, authorization, options={})
53
53
  post = {}
54
54
  add_reference(post, authorization)
55
55
  add_invoice(post, amount, options)
56
- commit("refund", post)
56
+ commit('refund', post)
57
57
  end
58
58
 
59
59
  def verify(credit_card, options={})
@@ -83,7 +83,7 @@ module ActiveMerchant #:nodoc:
83
83
  post[:currency] = options[:currency] || currency(money)
84
84
  end
85
85
  post[:project] = options[:project] if options[:project]
86
- post["params[title]"] = options[:description] if options[:description]
86
+ post['params[title]'] = options[:description] if options[:description]
87
87
  end
88
88
 
89
89
  def add_payment_method(post, payment_method, options={})
@@ -93,24 +93,24 @@ module ActiveMerchant #:nodoc:
93
93
  post[:expiryYear] = format(payment_method.year, :four_digits)
94
94
  post[:expiryMonth] = format(payment_method.month, :two_digits)
95
95
 
96
- post["params[firstname]"] = payment_method.first_name
97
- post["params[surname]"] = payment_method.last_name
96
+ post['params[firstname]'] = payment_method.first_name
97
+ post['params[surname]'] = payment_method.last_name
98
98
  end
99
99
 
100
100
  def add_customer_data(post, options)
101
- post["params[email]"] = options[:email] if options[:email]
102
- post["params[ip]"] = options[:ip] || "1.1.1.1"
103
- post["params[sendMail]"] = options[:send_mail] || 'false'
101
+ post['params[email]'] = options[:email] if options[:email]
102
+ post['params[ip]'] = options[:ip] || '1.1.1.1'
103
+ post['params[sendMail]'] = options[:send_mail] || 'false'
104
104
  end
105
105
 
106
106
  def add_address(post, options)
107
107
  address = options[:billing_address]
108
108
  return unless address
109
109
 
110
- post["params[address]"] = address[:address1] if address[:address1]
111
- post["params[zipcode]"] = address[:zip] if address[:zip]
112
- post["params[town]"] = address[:city] if address[:city]
113
- post["params[country]"] = address[:country] if address[:country]
110
+ post['params[address]'] = address[:address1] if address[:address1]
111
+ post['params[zipcode]'] = address[:zip] if address[:zip]
112
+ post['params[town]'] = address[:city] if address[:city]
113
+ post['params[country]'] = address[:country] if address[:country]
114
114
  end
115
115
 
116
116
  def add_reference(post, authorization)
@@ -122,7 +122,7 @@ module ActiveMerchant #:nodoc:
122
122
  def commit(action, params)
123
123
  params[:testMode] = 1 if test?
124
124
  params[:accessKey] = @options[:access_key]
125
- params[:apiKey] = @options[:api_key] || "af1fd841af792f4c50131414ff76e004"
125
+ params[:apiKey] = @options[:api_key] || 'af1fd841af792f4c50131414ff76e004'
126
126
 
127
127
  response = parse(ssl_post(url(action), post_data(action, params), headers))
128
128
 
@@ -131,14 +131,14 @@ module ActiveMerchant #:nodoc:
131
131
  message_from(succeeded, response),
132
132
  response,
133
133
  authorization: authorization_from(response, params),
134
- avs_result: AVSResult.new(code: response["some_avs_result_key"]),
135
- cvv_result: CVVResult.new(response["some_cvv_result_key"]),
134
+ avs_result: AVSResult.new(code: response['some_avs_result_key']),
135
+ cvv_result: CVVResult.new(response['some_cvv_result_key']),
136
136
  test: test?
137
137
  )
138
138
  end
139
139
 
140
140
  def headers
141
- { "Content-Type" => "application/x-www-form-urlencoded;charset=UTF-8" }
141
+ { 'Content-Type' => 'application/x-www-form-urlencoded;charset=UTF-8' }
142
142
  end
143
143
 
144
144
  def post_data(action, params)
@@ -152,32 +152,32 @@ module ActiveMerchant #:nodoc:
152
152
 
153
153
  def parse(body)
154
154
  body.split(/\r?\n/).inject({}) do |acc, pair|
155
- key, value = pair.split("=")
155
+ key, value = pair.split('=')
156
156
  acc[key] = CGI.unescape(value)
157
157
  acc
158
158
  end
159
159
  end
160
160
 
161
161
  def success_from(response)
162
- response["error"] == "0" &&
163
- response["transactionResultCode"] == "00" &&
164
- response["transactionStatus"] == "SUCCESS"
162
+ response['error'] == '0' &&
163
+ response['transactionResultCode'] == '00' &&
164
+ response['transactionStatus'] == 'SUCCESS'
165
165
  end
166
166
 
167
167
  def message_from(succeeded, response)
168
168
  if succeeded
169
- "Succeeded"
169
+ 'Succeeded'
170
170
  else
171
- response["errorMessage"] || response["transactionResultMessage"]
171
+ response['errorMessage'] || response['transactionResultMessage']
172
172
  end
173
173
  end
174
174
 
175
175
  def split_authorization(authorization)
176
- authorization.split("|")
176
+ authorization.split('|')
177
177
  end
178
178
 
179
179
  def authorization_from(response, request_params)
180
- session_id = response["sessionId"] ? response["sessionId"] : request_params[:sessionId]
180
+ session_id = response['sessionId'] || request_params[:sessionId]
181
181
  "#{session_id}|#{response["transactionId"]}"
182
182
  end
183
183
  end
@@ -194,7 +194,7 @@ module ActiveMerchant #:nodoc:
194
194
 
195
195
  expected_secure_hash = calculate_secure_hash(response_hash, @options[:secure_hash])
196
196
  unless response_hash[:SecureHash] == expected_secure_hash
197
- raise SecurityError, "Secure Hash mismatch, response may be tampered with"
197
+ raise SecurityError, 'Secure Hash mismatch, response may be tampered with'
198
198
  end
199
199
 
200
200
  response_object(response_hash)
@@ -213,7 +213,9 @@ module ActiveMerchant #:nodoc:
213
213
  gsub(%r((&?CardNum=)\d*(&?)), '\1[FILTERED]\2').
214
214
  gsub(%r((&?CardSecurityCode=)\d*(&?)), '\1[FILTERED]\2').
215
215
  gsub(%r((&?AccessCode=)[^&]*(&?)), '\1[FILTERED]\2').
216
- gsub(%r((&?Password=)[^&]*(&?)), '\1[FILTERED]\2')
216
+ gsub(%r((&?Password=)[^&]*(&?)), '\1[FILTERED]\2').
217
+ gsub(%r((&?3DSXID=)[^&]*(&?)), '\1[FILTERED]\2').
218
+ gsub(%r((&?VerToken=)[^&]*(&?)), '\1[FILTERED]\2')
217
219
  end
218
220
 
219
221
  private
@@ -235,10 +237,10 @@ module ActiveMerchant #:nodoc:
235
237
  def add_3ds(post, options)
236
238
  post[:VerType] = options[:ver_type] if options[:ver_type]
237
239
  post[:VerToken] = options[:ver_token] if options[:ver_token]
238
- post["3DSXID"] = options[:three_ds_xid] if options[:three_ds_xid]
239
- post["3DSECI"] = options[:three_ds_eci] if options[:three_ds_eci]
240
- post["3DSenrolled"] = options[:three_ds_enrolled] if options[:three_ds_enrolled]
241
- post["3DSstatus"] = options[:three_ds_status] if options[:three_ds_status]
240
+ post['3DSXID'] = options[:three_ds_xid] if options[:three_ds_xid]
241
+ post['3DSECI'] = options[:three_ds_eci] if options[:three_ds_eci]
242
+ post['3DSenrolled'] = options[:three_ds_enrolled] if options[:three_ds_enrolled]
243
+ post['3DSstatus'] = options[:three_ds_status] if options[:three_ds_status]
242
244
  end
243
245
 
244
246
  def add_creditcard(post, creditcard)
@@ -270,10 +272,10 @@ module ActiveMerchant #:nodoc:
270
272
 
271
273
  def response_object(response)
272
274
  avs_response_code = response[:AVSResultCode]
273
- avs_response_code = 'S' if avs_response_code == "Unsupported"
275
+ avs_response_code = 'S' if avs_response_code == 'Unsupported'
274
276
 
275
277
  cvv_result_code = response[:CSCResultCode]
276
- cvv_result_code = 'P' if cvv_result_code == "Unsupported"
278
+ cvv_result_code = 'P' if cvv_result_code == 'Unsupported'
277
279
 
278
280
  Response.new(success?(response), response[:Message], response,
279
281
  :test => test?,
@@ -303,7 +305,7 @@ module ActiveMerchant #:nodoc:
303
305
  end
304
306
 
305
307
  def post_data(post)
306
- post.collect { |key, value| "vpc_#{key}=#{CGI.escape(value.to_s)}" }.join("&")
308
+ post.collect { |key, value| "vpc_#{key}=#{CGI.escape(value.to_s)}" }.join('&')
307
309
  end
308
310
 
309
311
  def add_secure_hash(post)
@@ -19,7 +19,7 @@ module ActiveMerchant #:nodoc:
19
19
  customer_response = cim.create_customer(options)
20
20
  return customer_response unless customer_response.success?
21
21
 
22
- customer_id = customer_response.params["create_customer_result"]
22
+ customer_id = customer_response.params['create_customer_result']
23
23
 
24
24
  card_response = cim.modify_customer_credit_card(customer_id, credit_card)
25
25
  return card_response unless card_response.success?
@@ -1,20 +1,20 @@
1
1
  module ActiveMerchant #:nodoc:
2
2
  module Billing #:nodoc:
3
3
  class ModernPaymentsCimGateway < Gateway #:nodoc:
4
- self.test_url = "https://secure.modpay.com/netservices/test/ModpayTest.asmx"
4
+ self.test_url = 'https://secure.modpay.com/netservices/test/ModpayTest.asmx'
5
5
  self.live_url = 'https://secure.modpay.com/ws/modpay.asmx'
6
6
 
7
- LIVE_XMLNS = "https://secure.modpay.com/ws/"
8
- TEST_XMLNS = "https://secure.modpay.com/netservices/test/"
7
+ LIVE_XMLNS = 'https://secure.modpay.com/ws/'
8
+ TEST_XMLNS = 'https://secure.modpay.com/netservices/test/'
9
9
 
10
10
  self.supported_countries = ['US']
11
11
  self.supported_cardtypes = [:visa, :master, :american_express, :discover]
12
12
  self.homepage_url = 'http://www.modpay.com'
13
13
  self.display_name = 'Modern Payments'
14
14
 
15
- SUCCESS_MESSAGE = "Transaction accepted"
16
- FAILURE_MESSAGE = "Transaction failed"
17
- ERROR_MESSAGE = "Transaction error"
15
+ SUCCESS_MESSAGE = 'Transaction accepted'
16
+ FAILURE_MESSAGE = 'Transaction failed'
17
+ ERROR_MESSAGE = 'Transaction error'
18
18
 
19
19
  PAYMENT_METHOD = {
20
20
  :check => 1,
@@ -35,7 +35,7 @@ module ActiveMerchant #:nodoc:
35
35
  end
36
36
 
37
37
  def modify_customer_credit_card(customer_id, credit_card)
38
- raise ArgumentError, "The customer_id cannot be blank" if customer_id.blank?
38
+ raise ArgumentError, 'The customer_id cannot be blank' if customer_id.blank?
39
39
 
40
40
  post = {}
41
41
  add_customer_id(post, customer_id)
@@ -45,7 +45,7 @@ module ActiveMerchant #:nodoc:
45
45
  end
46
46
 
47
47
  def authorize_credit_card_payment(customer_id, amount)
48
- raise ArgumentError, "The customer_id cannot be blank" if customer_id.blank?
48
+ raise ArgumentError, 'The customer_id cannot be blank' if customer_id.blank?
49
49
 
50
50
  post = {}
51
51
  add_customer_id(post, customer_id)
@@ -55,7 +55,7 @@ module ActiveMerchant #:nodoc:
55
55
  end
56
56
 
57
57
  def create_payment(customer_id, amount, options = {})
58
- raise ArgumentError, "The customer_id cannot be blank" if customer_id.blank?
58
+ raise ArgumentError, 'The customer_id cannot be blank' if customer_id.blank?
59
59
 
60
60
  post = {}
61
61
  add_customer_id(post, customer_id)
@@ -67,7 +67,7 @@ module ActiveMerchant #:nodoc:
67
67
 
68
68
  private
69
69
  def add_payment_details(post, options)
70
- post[:pmtDate] = (options[:payment_date] || Time.now.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
70
+ post[:pmtDate] = (options[:payment_date] || Time.now.utc).strftime('%Y-%m-%dT%H:%M:%SZ')
71
71
  post[:pmtType] = PAYMENT_METHOD[options[:payment_method] || :credit_card]
72
72
  end
73
73
 
@@ -118,9 +118,9 @@ module ActiveMerchant #:nodoc:
118
118
  'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance' } do
119
119
 
120
120
  xml.tag! 'env:Body' do
121
- xml.tag! action, { "xmlns" => xmlns(action) } do
122
- xml.tag! "clientId", @options[:login]
123
- xml.tag! "clientCode", @options[:password]
121
+ xml.tag! action, { 'xmlns' => xmlns(action) } do
122
+ xml.tag! 'clientId', @options[:login]
123
+ xml.tag! 'clientCode', @options[:password]
124
124
  params.each {|key, value| xml.tag! key, value }
125
125
  end
126
126
  end
@@ -163,14 +163,14 @@ module ActiveMerchant #:nodoc:
163
163
  end
164
164
 
165
165
  def authorization_key(action)
166
- action == "AuthorizeCreditCardPayment" ? :trans_id : "#{action.underscore}_result".to_sym
166
+ action == 'AuthorizeCreditCardPayment' ? :trans_id : "#{action.underscore}_result".to_sym
167
167
  end
168
168
 
169
169
  def successful?(action, response)
170
170
  key = authorization_key(action)
171
171
 
172
172
  if key == :trans_id
173
- response[:approved] == "true"
173
+ response[:approved] == 'true'
174
174
  else
175
175
  response[key].to_i > 0
176
176
  end
@@ -195,7 +195,7 @@ module ActiveMerchant #:nodoc:
195
195
  root.elements.to_a.each do |node|
196
196
  parse_element(response, node)
197
197
  end
198
- elsif root = REXML::XPath.first(xml, "//soap:Fault")
198
+ elsif root = REXML::XPath.first(xml, '//soap:Fault')
199
199
  root.elements.to_a.each do |node|
200
200
  response[node.name.underscore.to_sym] = node.text
201
201
  end
@@ -151,7 +151,7 @@ module ActiveMerchant #:nodoc:
151
151
  # Private: Build XML wrapping code yielding to code to fill the transaction information
152
152
  def build_request
153
153
  builder = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') do |xml|
154
- xml.Request(:version => "1.0") do
154
+ xml.Request(:version => '1.0') do
155
155
  xml.Header { xml.Security(:sender => @options[:sender_id]) }
156
156
  xml.Transaction(:mode => test? ? 'CONNECTOR_TEST' : 'LIVE', :response => 'SYNC', :channel => @options[:channel_id]) do
157
157
  xml.User(:login => @options[:login], :pwd => @options[:pwd])
@@ -229,10 +229,10 @@ module ActiveMerchant #:nodoc:
229
229
  def parse(body)
230
230
  xml = Nokogiri::XML(body)
231
231
  {
232
- :unique_id => xml.xpath("//Response/Transaction/Identification/UniqueID").text,
233
- :status => translate_status_code(xml.xpath("//Response/Transaction/Processing/Status/@code").text),
234
- :reason => translate_status_code(xml.xpath("//Response/Transaction/Processing/Reason/@code").text),
235
- :message => xml.xpath("//Response/Transaction/Processing/Return").text
232
+ :unique_id => xml.xpath('//Response/Transaction/Identification/UniqueID').text,
233
+ :status => translate_status_code(xml.xpath('//Response/Transaction/Processing/Status/@code').text),
234
+ :reason => translate_status_code(xml.xpath('//Response/Transaction/Processing/Reason/@code').text),
235
+ :message => xml.xpath('//Response/Transaction/Processing/Return').text
236
236
  }
237
237
  end
238
238
 
@@ -178,7 +178,7 @@ module ActiveMerchant #:nodoc:
178
178
  private # :nodoc: all
179
179
 
180
180
  def expdate(creditcard)
181
- sprintf("%.4i", creditcard.year)[-2..-1] + sprintf("%.2i", creditcard.month)
181
+ sprintf('%.4i', creditcard.year)[-2..-1] + sprintf('%.2i', creditcard.month)
182
182
  end
183
183
 
184
184
  def add_payment_source(post, payment_method, options)
@@ -249,7 +249,7 @@ module ActiveMerchant #:nodoc:
249
249
  end
250
250
 
251
251
  def parse(xml)
252
- response = { :message => "Global Error Receipt", :complete => false }
252
+ response = { :message => 'Global Error Receipt', :complete => false }
253
253
  hashify_xml!(xml, response)
254
254
  response
255
255
  end
@@ -264,9 +264,9 @@ module ActiveMerchant #:nodoc:
264
264
 
265
265
  def post_data(action, parameters = {})
266
266
  xml = REXML::Document.new
267
- root = xml.add_element("request")
268
- root.add_element("store_id").text = options[:login]
269
- root.add_element("api_token").text = options[:password]
267
+ root = xml.add_element('request')
268
+ root.add_element('store_id').text = options[:login]
269
+ root.add_element('api_token').text = options[:password]
270
270
  root.add_element(transaction_element(action, parameters))
271
271
 
272
272
  xml.to_s
@@ -304,10 +304,10 @@ module ActiveMerchant #:nodoc:
304
304
  def cvd_element(cvd_value)
305
305
  element = REXML::Element.new('cvd_info')
306
306
  if cvd_value
307
- element.add_element('cvd_indicator').text = "1"
307
+ element.add_element('cvd_indicator').text = '1'
308
308
  element.add_element('cvd_value').text = cvd_value
309
309
  else
310
- element.add_element('cvd_indicator').text = "0"
310
+ element.add_element('cvd_indicator').text = '0'
311
311
  end
312
312
  element
313
313
  end
@@ -320,29 +320,29 @@ module ActiveMerchant #:nodoc:
320
320
 
321
321
  def message_from(message)
322
322
  return 'Unspecified error' if message.blank?
323
- message.gsub(/[^\w]/, ' ').split.join(" ").capitalize
323
+ message.gsub(/[^\w]/, ' ').split.join(' ').capitalize
324
324
  end
325
325
 
326
326
  def actions
327
327
  {
328
- "purchase" => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type, :avs_info, :cvd_info, :track2, :pos_code],
329
- "preauth" => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type, :avs_info, :cvd_info, :track2, :pos_code],
330
- "command" => [:order_id],
331
- "refund" => [:order_id, :amount, :txn_number, :crypt_type],
332
- "indrefund" => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type],
333
- "completion" => [:order_id, :comp_amount, :txn_number, :crypt_type],
334
- "purchasecorrection" => [:order_id, :txn_number, :crypt_type],
335
- "cavv_preauth" => [:order_id, :cust_id, :amount, :pan, :expdate, :cavv, :crypt_type, :wallet_indicator],
336
- "cavv_purchase" => [:order_id, :cust_id, :amount, :pan, :expdate, :cavv, :crypt_type, :wallet_indicator],
337
- "transact" => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type],
338
- "Batchcloseall" => [],
339
- "opentotals" => [:ecr_number],
340
- "batchclose" => [:ecr_number],
341
- "res_add_cc" => [:pan, :expdate, :crypt_type],
342
- "res_delete" => [:data_key],
343
- "res_update_cc" => [:data_key, :pan, :expdate, :crypt_type],
344
- "res_purchase_cc" => [:data_key, :order_id, :cust_id, :amount, :crypt_type],
345
- "res_preauth_cc" => [:data_key, :order_id, :cust_id, :amount, :crypt_type]
328
+ 'purchase' => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type, :avs_info, :cvd_info, :track2, :pos_code],
329
+ 'preauth' => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type, :avs_info, :cvd_info, :track2, :pos_code],
330
+ 'command' => [:order_id],
331
+ 'refund' => [:order_id, :amount, :txn_number, :crypt_type],
332
+ 'indrefund' => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type],
333
+ 'completion' => [:order_id, :comp_amount, :txn_number, :crypt_type],
334
+ 'purchasecorrection' => [:order_id, :txn_number, :crypt_type],
335
+ 'cavv_preauth' => [:order_id, :cust_id, :amount, :pan, :expdate, :cavv, :crypt_type, :wallet_indicator],
336
+ 'cavv_purchase' => [:order_id, :cust_id, :amount, :pan, :expdate, :cavv, :crypt_type, :wallet_indicator],
337
+ 'transact' => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type],
338
+ 'Batchcloseall' => [],
339
+ 'opentotals' => [:ecr_number],
340
+ 'batchclose' => [:ecr_number],
341
+ 'res_add_cc' => [:pan, :expdate, :crypt_type],
342
+ 'res_delete' => [:data_key],
343
+ 'res_update_cc' => [:data_key, :pan, :expdate, :crypt_type],
344
+ 'res_purchase_cc' => [:data_key, :order_id, :cust_id, :amount, :crypt_type],
345
+ 'res_preauth_cc' => [:data_key, :order_id, :cust_id, :amount, :crypt_type]
346
346
  }
347
347
  end
348
348
  end