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
@@ -120,8 +120,8 @@ module ActiveMerchant #:nodoc:
120
120
  end
121
121
 
122
122
  ext_data = Nokogiri::HTML.parse(response[:extdata])
123
- response[:approved_amount] = ext_data.xpath("//approvedamount").text
124
- response[:balance_due] = ext_data.xpath("//balancedue").text
123
+ response[:approved_amount] = ext_data.xpath('//approvedamount').text
124
+ response[:balance_due] = ext_data.xpath('//balancedue').text
125
125
 
126
126
  response
127
127
  end
@@ -146,7 +146,7 @@ module ActiveMerchant #:nodoc:
146
146
  post[:TransType] = action
147
147
  post[:ExtData] = "<TermType>#{@options[:term_type]}</TermType>"
148
148
 
149
- post.merge(params).map { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join("&")
149
+ post.merge(params).map { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join('&')
150
150
  end
151
151
 
152
152
  def url
@@ -154,7 +154,7 @@ module ActiveMerchant #:nodoc:
154
154
  end
155
155
 
156
156
  def success_from(response)
157
- response[:result] == "0" || response[:result] == "200"
157
+ response[:result] == '0' || response[:result] == '200'
158
158
  end
159
159
 
160
160
  def message_from(response)
@@ -1,16 +1,16 @@
1
- require "nokogiri"
1
+ require 'nokogiri'
2
2
 
3
3
  module ActiveMerchant #:nodoc:
4
4
  module Billing #:nodoc:
5
5
  class HdfcGateway < Gateway
6
- self.display_name = "HDFC"
7
- self.homepage_url = "http://www.hdfcbank.com/sme/sme-details/merchant-services/guzh6m0i"
6
+ self.display_name = 'HDFC'
7
+ self.homepage_url = 'http://www.hdfcbank.com/sme/sme-details/merchant-services/guzh6m0i'
8
8
 
9
- self.test_url = "https://securepgtest.fssnet.co.in/pgway/servlet/"
10
- self.live_url = "https://securepg.fssnet.co.in/pgway/servlet/"
9
+ self.test_url = 'https://securepgtest.fssnet.co.in/pgway/servlet/'
10
+ self.live_url = 'https://securepg.fssnet.co.in/pgway/servlet/'
11
11
 
12
- self.supported_countries = ["IN"]
13
- self.default_currency = "INR"
12
+ self.supported_countries = ['IN']
13
+ self.default_currency = 'INR'
14
14
  self.money_format = :dollars
15
15
  self.supported_cardtypes = [:visa, :master, :discover, :diners_club]
16
16
 
@@ -25,7 +25,7 @@ module ActiveMerchant #:nodoc:
25
25
  add_payment_method(post, payment_method)
26
26
  add_customer_data(post, options)
27
27
 
28
- commit("purchase", post)
28
+ commit('purchase', post)
29
29
  end
30
30
 
31
31
  def authorize(amount, payment_method, options={})
@@ -34,7 +34,7 @@ module ActiveMerchant #:nodoc:
34
34
  add_payment_method(post, payment_method)
35
35
  add_customer_data(post, options)
36
36
 
37
- commit("authorize", post)
37
+ commit('authorize', post)
38
38
  end
39
39
 
40
40
  def capture(amount, authorization, options={})
@@ -43,7 +43,7 @@ module ActiveMerchant #:nodoc:
43
43
  add_reference(post, authorization)
44
44
  add_customer_data(post, options)
45
45
 
46
- commit("capture", post)
46
+ commit('capture', post)
47
47
  end
48
48
 
49
49
  def refund(amount, authorization, options={})
@@ -52,22 +52,22 @@ module ActiveMerchant #:nodoc:
52
52
  add_reference(post, authorization)
53
53
  add_customer_data(post, options)
54
54
 
55
- commit("refund", post)
55
+ commit('refund', post)
56
56
  end
57
57
 
58
58
  private
59
59
 
60
60
  CURRENCY_CODES = Hash.new{|h,k| raise ArgumentError.new("Unsupported currency for HDFC: #{k}")}
61
- CURRENCY_CODES["AED"] = "784"
62
- CURRENCY_CODES["AUD"] = "036"
63
- CURRENCY_CODES["CAD"] = "124"
64
- CURRENCY_CODES["EUR"] = "978"
65
- CURRENCY_CODES["GBP"] = "826"
66
- CURRENCY_CODES["INR"] = "356"
67
- CURRENCY_CODES["OMR"] = "512"
68
- CURRENCY_CODES["QAR"] = "634"
69
- CURRENCY_CODES["SGD"] = "702"
70
- CURRENCY_CODES["USD"] = "840"
61
+ CURRENCY_CODES['AED'] = '784'
62
+ CURRENCY_CODES['AUD'] = '036'
63
+ CURRENCY_CODES['CAD'] = '124'
64
+ CURRENCY_CODES['EUR'] = '978'
65
+ CURRENCY_CODES['GBP'] = '826'
66
+ CURRENCY_CODES['INR'] = '356'
67
+ CURRENCY_CODES['OMR'] = '512'
68
+ CURRENCY_CODES['QAR'] = '634'
69
+ CURRENCY_CODES['SGD'] = '702'
70
+ CURRENCY_CODES['USD'] = '840'
71
71
 
72
72
  def add_invoice(post, amount, options)
73
73
  post[:amt] = amount(amount)
@@ -127,14 +127,14 @@ EOA
127
127
  end
128
128
 
129
129
  def fix_xml(xml)
130
- xml.gsub(/&(?!(?:amp|quot|apos|lt|gt);)/, "&amp;")
130
+ xml.gsub(/&(?!(?:amp|quot|apos|lt|gt);)/, '&amp;')
131
131
  end
132
132
 
133
133
  ACTIONS = {
134
- "purchase" => "1",
135
- "refund" => "2",
136
- "authorize" => "4",
137
- "capture" => "5",
134
+ 'purchase' => '1',
135
+ 'refund' => '2',
136
+ 'authorize' => '4',
137
+ 'capture' => '5',
138
138
  }
139
139
 
140
140
  def commit(action, post)
@@ -164,13 +164,13 @@ EOA
164
164
  end
165
165
 
166
166
  def url(action)
167
- endpoint = "TranPortalXMLServlet"
167
+ endpoint = 'TranPortalXMLServlet'
168
168
  (test? ? test_url : live_url) + endpoint
169
169
  end
170
170
 
171
171
  def success_from(result)
172
172
  case result
173
- when "CAPTURED", "APPROVED", "NOT ENROLLED", "ENROLLED"
173
+ when 'CAPTURED', 'APPROVED', 'NOT ENROLLED', 'ENROLLED'
174
174
  true
175
175
  else
176
176
  false
@@ -179,23 +179,23 @@ EOA
179
179
 
180
180
  def message_from(succeeded, response)
181
181
  if succeeded
182
- "Succeeded"
182
+ 'Succeeded'
183
183
  else
184
- (response[:error_text] || response[:result] || "Unable to read error message").split("-").last
184
+ (response[:error_text] || response[:result] || 'Unable to read error message').split('-').last
185
185
  end
186
186
  end
187
187
 
188
188
  def authorization_from(request, response)
189
- [response[:tranid], request[:member]].join("|")
189
+ [response[:tranid], request[:member]].join('|')
190
190
  end
191
191
 
192
192
  def split_authorization(authorization)
193
- tranid, member = authorization.split("|")
193
+ tranid, member = authorization.split('|')
194
194
  [tranid, member]
195
195
  end
196
196
 
197
197
  def escape(string, max_length=250)
198
- return "" unless string
198
+ return '' unless string
199
199
  if max_length
200
200
  string = string[0...max_length]
201
201
  end
@@ -1,4 +1,4 @@
1
- require "nokogiri"
1
+ require 'nokogiri'
2
2
 
3
3
  module ActiveMerchant #:nodoc:
4
4
  module Billing #:nodoc:
@@ -117,7 +117,7 @@ module ActiveMerchant #:nodoc:
117
117
  xml.hps :CardData do
118
118
  if card_or_token.respond_to?(:number)
119
119
  if card_or_token.track_data
120
- xml.tag!("hps:TrackData", 'method'=>'swipe') do
120
+ xml.tag!('hps:TrackData', 'method'=>'swipe') do
121
121
  xml.text! card_or_token.track_data
122
122
  end
123
123
  if options[:encryption_type]
@@ -202,7 +202,7 @@ module ActiveMerchant #:nodoc:
202
202
 
203
203
  doc = Nokogiri::XML(raw)
204
204
  doc.remove_namespaces!
205
- if(header = doc.xpath("//Header").first)
205
+ if(header = doc.xpath('//Header').first)
206
206
  header.elements.each do |node|
207
207
  if (node.elements.size == 0)
208
208
  response[node.name] = node.text
@@ -213,13 +213,13 @@ module ActiveMerchant #:nodoc:
213
213
  end
214
214
  end
215
215
  end
216
- if(transaction = doc.xpath("//Transaction/*[1]").first)
216
+ if(transaction = doc.xpath('//Transaction/*[1]').first)
217
217
  transaction.elements.each do |node|
218
218
  response[node.name] = node.text
219
219
  end
220
220
  end
221
- if(fault = doc.xpath("//Fault/Reason/Text").first)
222
- response["Fault"] = fault.text
221
+ if(fault = doc.xpath('//Fault/Reason/Text').first)
222
+ response['Fault'] = fault.text
223
223
  end
224
224
 
225
225
  response
@@ -250,22 +250,22 @@ module ActiveMerchant #:nodoc:
250
250
 
251
251
  def successful?(response)
252
252
  (
253
- (response["GatewayRspCode"] == "0") &&
254
- ((response["RspCode"] || "00") == "00" || response["RspCode"] == "85")
253
+ (response['GatewayRspCode'] == '0') &&
254
+ ((response['RspCode'] || '00') == '00' || response['RspCode'] == '85')
255
255
  )
256
256
  end
257
257
 
258
258
  def message_from(response)
259
- if(response["Fault"])
260
- response["Fault"]
261
- elsif(response["GatewayRspCode"] == "0")
262
- if(response["RspCode"] != "00" && response["RspCode"] != "85")
263
- issuer_message(response["RspCode"])
259
+ if(response['Fault'])
260
+ response['Fault']
261
+ elsif(response['GatewayRspCode'] == '0')
262
+ if(response['RspCode'] != '00' && response['RspCode'] != '85')
263
+ issuer_message(response['RspCode'])
264
264
  else
265
265
  response['GatewayRspMsg']
266
266
  end
267
267
  else
268
- (GATEWAY_MESSAGES[response["GatewayRspCode"]] || response["GatewayRspMsg"])
268
+ (GATEWAY_MESSAGES[response['GatewayRspCode']] || response['GatewayRspMsg'])
269
269
  end
270
270
  end
271
271
 
@@ -278,27 +278,27 @@ module ActiveMerchant #:nodoc:
278
278
  end
279
279
 
280
280
  ISSUER_MESSAGES = {
281
- "13" => "Must be greater than or equal 0.",
282
- "14" => "The card number is incorrect.",
283
- "54" => "The card has expired.",
284
- "55" => "The 4-digit pin is invalid.",
285
- "75" => "Maximum number of pin retries exceeded.",
286
- "80" => "Card expiration date is invalid.",
287
- "86" => "Can't verify card pin number."
281
+ '13' => 'Must be greater than or equal 0.',
282
+ '14' => 'The card number is incorrect.',
283
+ '54' => 'The card has expired.',
284
+ '55' => 'The 4-digit pin is invalid.',
285
+ '75' => 'Maximum number of pin retries exceeded.',
286
+ '80' => 'Card expiration date is invalid.',
287
+ '86' => "Can't verify card pin number."
288
288
  }
289
289
  def issuer_message(code)
290
- return "The card was declined." if %w(02 03 04 05 41 43 44 51 56 61 62 63 65 78).include?(code)
291
- return "An error occurred while processing the card." if %w(06 07 12 15 19 12 52 53 57 58 76 77 91 96 EC).include?(code)
290
+ return 'The card was declined.' if %w(02 03 04 05 41 43 44 51 56 61 62 63 65 78).include?(code)
291
+ return 'An error occurred while processing the card.' if %w(06 07 12 15 19 12 52 53 57 58 76 77 91 96 EC).include?(code)
292
292
  return "The card's security code is incorrect." if %w(EB N7).include?(code)
293
293
  ISSUER_MESSAGES[code]
294
294
  end
295
295
 
296
296
  GATEWAY_MESSAGES = {
297
- "-2" => "Authentication error. Please double check your service configuration.",
298
- "12" => "Invalid CPC data.",
299
- "13" => "Invalid card data.",
300
- "14" => "The card number is not a valid credit card number.",
301
- "30" => "Gateway timed out."
297
+ '-2' => 'Authentication error. Please double check your service configuration.',
298
+ '12' => 'Invalid CPC data.',
299
+ '13' => 'Invalid card data.',
300
+ '14' => 'The card number is not a valid credit card number.',
301
+ '30' => 'Gateway timed out.'
302
302
  }
303
303
  end
304
304
  end
@@ -14,12 +14,12 @@ module ActiveMerchant #:nodoc:
14
14
  self.display_name = 'iATS Payments'
15
15
 
16
16
  ACTIONS = {
17
- purchase: "ProcessCreditCardV1",
18
- purchase_check: "ProcessACHEFTV1",
19
- refund: "ProcessCreditCardRefundWithTransactionIdV1",
20
- refund_check: "ProcessACHEFTRefundWithTransactionIdV1",
21
- store: "CreateCreditCardCustomerCodeV1",
22
- unstore: "DeleteCustomerCodeV1"
17
+ purchase: 'ProcessCreditCardV1',
18
+ purchase_check: 'ProcessACHEFTV1',
19
+ refund: 'ProcessCreditCardRefundWithTransactionIdV1',
20
+ refund_check: 'ProcessACHEFTRefundWithTransactionIdV1',
21
+ store: 'CreateCreditCardCustomerCodeV1',
22
+ unstore: 'DeleteCustomerCodeV1'
23
23
  }
24
24
 
25
25
  def initialize(options={})
@@ -145,19 +145,19 @@ module ActiveMerchant #:nodoc:
145
145
  end
146
146
 
147
147
  def expdate(creditcard)
148
- year = sprintf("%.4i", creditcard.year)
149
- month = sprintf("%.2i", creditcard.month)
148
+ year = sprintf('%.4i', creditcard.year)
149
+ month = sprintf('%.2i', creditcard.month)
150
150
 
151
151
  "#{month}/#{year[-2..-1]}"
152
152
  end
153
153
 
154
154
  def creditcard_brand(brand)
155
155
  case brand
156
- when "visa" then "VISA"
157
- when "master" then "MC"
158
- when "discover" then "DSC"
159
- when "american_express" then "AMX"
160
- when "maestro" then "MAESTR"
156
+ when 'visa' then 'VISA'
157
+ when 'master' then 'MC'
158
+ when 'discover' then 'DSC'
159
+ when 'american_express' then 'AMX'
160
+ when 'maestro' then 'MAESTR'
161
161
  else
162
162
  raise "Unhandled credit card brand #{brand}"
163
163
  end
@@ -178,12 +178,12 @@ module ActiveMerchant #:nodoc:
178
178
 
179
179
  def endpoints
180
180
  {
181
- purchase: "ProcessLink.asmx",
182
- purchase_check: "ProcessLink.asmx",
183
- refund: "ProcessLink.asmx",
184
- refund_check: "ProcessLink.asmx",
185
- store: "CustomerLink.asmx",
186
- unstore: "CustomerLink.asmx"
181
+ purchase: 'ProcessLink.asmx',
182
+ purchase_check: 'ProcessLink.asmx',
183
+ refund: 'ProcessLink.asmx',
184
+ refund_check: 'ProcessLink.asmx',
185
+ store: 'CustomerLink.asmx',
186
+ unstore: 'CustomerLink.asmx'
187
187
  }
188
188
  end
189
189
 
@@ -211,7 +211,7 @@ module ActiveMerchant #:nodoc:
211
211
  def hashify_xml!(xml, response)
212
212
  xml = REXML::Document.new(xml)
213
213
 
214
- xml.elements.each("//IATSRESPONSE/*") do |node|
214
+ xml.elements.each('//IATSRESPONSE/*') do |node|
215
215
  recursively_parse_element(node, response)
216
216
  end
217
217
  end
@@ -229,7 +229,7 @@ module ActiveMerchant #:nodoc:
229
229
  end
230
230
 
231
231
  def success_from(response)
232
- response[:status] == "Success" && successful_result_message?(response)
232
+ response[:status] == 'Success' && successful_result_message?(response)
233
233
  end
234
234
 
235
235
  def message_from(response)
@@ -253,14 +253,14 @@ module ActiveMerchant #:nodoc:
253
253
  end
254
254
 
255
255
  def split_authorization(authorization)
256
- authorization.split("|")
256
+ authorization.split('|')
257
257
  end
258
258
 
259
259
  def envelope_namespaces
260
260
  {
261
- "xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance",
262
- "xmlns:xsd" => "http://www.w3.org/2001/XMLSchema",
263
- "xmlns:soap12" => "http://www.w3.org/2003/05/soap-envelope"
261
+ 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
262
+ 'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
263
+ 'xmlns:soap12' => 'http://www.w3.org/2003/05/soap-envelope'
264
264
  }
265
265
  end
266
266
 
@@ -269,7 +269,7 @@ module ActiveMerchant #:nodoc:
269
269
  xml.instruct!(:xml, :version => '1.0', :encoding => 'utf-8')
270
270
  xml.tag! 'soap12:Envelope', envelope_namespaces do
271
271
  xml.tag! 'soap12:Body' do
272
- xml.tag! ACTIONS[action], { "xmlns" => "https://www.iatspayments.com/NetGate/" } do
272
+ xml.tag! ACTIONS[action], { 'xmlns' => 'https://www.iatspayments.com/NetGate/' } do
273
273
  xml.tag!('agentCode', @options[:agent_code])
274
274
  xml.tag!('password', @options[:password])
275
275
  parameters.each do |name, value|
@@ -73,7 +73,7 @@ module ActiveMerchant #:nodoc:
73
73
  # CreditCard object.
74
74
  def update(vault_id, creditcard, options = {})
75
75
  post = {}
76
- post[:customer_vault] = "update_customer"
76
+ post[:customer_vault] = 'update_customer'
77
77
  add_customer_vault_id(post, vault_id)
78
78
  add_creditcard(post, creditcard, options)
79
79
  add_address(post, creditcard, options)
@@ -84,7 +84,7 @@ module ActiveMerchant #:nodoc:
84
84
 
85
85
  def delete(vault_id)
86
86
  post = {}
87
- post[:customer_vault] = "delete_customer"
87
+ post[:customer_vault] = 'delete_customer'
88
88
  add_customer_vault_id(post, vault_id)
89
89
  commit(nil, nil, post)
90
90
  end
@@ -141,7 +141,7 @@ module ActiveMerchant #:nodoc:
141
141
 
142
142
  def add_creditcard(post, creditcard,options)
143
143
  if options[:store]
144
- post[:customer_vault] = "add_customer"
144
+ post[:customer_vault] = 'add_customer'
145
145
  post[:customer_vault_id] = options[:store] unless options[:store] == true
146
146
  end
147
147
  post[:ccnumber] = creditcard.number
@@ -175,23 +175,23 @@ module ActiveMerchant #:nodoc:
175
175
 
176
176
  response = parse( ssl_post(self.live_url, post_data(action,parameters)) )
177
177
 
178
- Response.new(response["response"] == "1", message_from(response), response,
179
- :authorization => response["transactionid"],
178
+ Response.new(response['response'] == '1', message_from(response), response,
179
+ :authorization => response['transactionid'],
180
180
  :test => test?,
181
- :cvv_result => response["cvvresponse"],
182
- :avs_result => { :code => response["avsresponse"] }
181
+ :cvv_result => response['cvvresponse'],
182
+ :avs_result => { :code => response['avsresponse'] }
183
183
  )
184
184
 
185
185
  end
186
186
 
187
187
  def message_from(response)
188
- case response["responsetext"]
189
- when "SUCCESS","Approved"
190
- "This transaction has been approved"
191
- when "DECLINE"
192
- "This transaction has been declined"
188
+ case response['responsetext']
189
+ when 'SUCCESS','Approved'
190
+ 'This transaction has been approved'
191
+ when 'DECLINE'
192
+ 'This transaction has been declined'
193
193
  else
194
- response["responsetext"]
194
+ response['responsetext']
195
195
  end
196
196
  end
197
197
 
@@ -201,7 +201,7 @@ module ActiveMerchant #:nodoc:
201
201
  post[:password] = @options[:password]
202
202
  post[:type] = action if action
203
203
 
204
- request = post.merge(parameters).map {|key,value| "#{key}=#{CGI.escape(value.to_s)}"}.join("&")
204
+ request = post.merge(parameters).map {|key,value| "#{key}=#{CGI.escape(value.to_s)}"}.join('&')
205
205
  request
206
206
  end
207
207
 
@@ -210,7 +210,7 @@ module ActiveMerchant #:nodoc:
210
210
  when source.is_a?(String) then :vault
211
211
  when CreditCard.card_companies.keys.include?(card_brand(source)) then :credit_card
212
212
  when card_brand(source) == 'check' then :check
213
- else raise ArgumentError, "Unsupported funding source provided"
213
+ else raise ArgumentError, 'Unsupported funding source provided'
214
214
  end
215
215
  end
216
216
  end