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
@@ -191,7 +191,7 @@ module ActiveMerchant #:nodoc:
191
191
 
192
192
  def do_authorize(params)
193
193
  headers = {}
194
- headers['Referer'] = (options[:password] || "activemerchant.org")
194
+ headers['Referer'] = (options[:password] || 'activemerchant.org')
195
195
 
196
196
  response = raw_ssl_request(:post, live_url + 'auth/default.aspx', authorize_post_data(params), headers)
197
197
 
@@ -244,7 +244,7 @@ module ActiveMerchant #:nodoc:
244
244
  def make_headers(data, soap_call)
245
245
  {
246
246
  'Content-Type' => 'text/xml; charset=utf-8',
247
- 'Host' => "ssl.ditonlinebetalingssystem.dk",
247
+ 'Host' => 'ssl.ditonlinebetalingssystem.dk',
248
248
  'Content-Length' => data.size.to_s,
249
249
  'SOAPAction' => self.live_url + 'remote/payment/' + soap_call
250
250
  }
@@ -274,12 +274,12 @@ module ActiveMerchant #:nodoc:
274
274
  params[:declineurl] = live_url + 'auth/default.aspx?decline=1'
275
275
  params[:merchantnumber] = @options[:login]
276
276
 
277
- params.collect { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join("&")
277
+ params.collect { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join('&')
278
278
  end
279
279
 
280
280
  # Limited to 20 digits max
281
281
  def format_order_number(number)
282
- number.to_s.gsub(/[^\w]/, '').rjust(4, "0")[0...20]
282
+ number.to_s.gsub(/[^\w]/, '').rjust(4, '0')[0...20]
283
283
  end
284
284
  end
285
285
  end
@@ -301,7 +301,7 @@ module ActiveMerchant #:nodoc:
301
301
  post[:username] = options[:username]
302
302
  post[:password] = options[:password]
303
303
  end
304
- post.merge(parameters).collect { |key, value| "#{key}=#{CGI.escape(value.to_s)}" unless value.nil? }.compact.join("&")
304
+ post.merge(parameters).collect { |key, value| "#{key}=#{CGI.escape(value.to_s)}" unless value.nil? }.compact.join('&')
305
305
  end
306
306
  end
307
307
  end
@@ -65,13 +65,13 @@ module ActiveMerchant #:nodoc:
65
65
 
66
66
  private
67
67
  def requires_address!(options)
68
- raise ArgumentError.new("Missing eWay required parameters: address or billing_address") unless (options.has_key?(:address) or options.has_key?(:billing_address))
68
+ raise ArgumentError.new('Missing eWay required parameters: address or billing_address') unless (options.has_key?(:address) or options.has_key?(:billing_address))
69
69
  end
70
70
 
71
71
  def add_creditcard(post, creditcard)
72
72
  post[:CardNumber] = creditcard.number
73
- post[:CardExpiryMonth] = sprintf("%.2i", creditcard.month)
74
- post[:CardExpiryYear] = sprintf("%.4i", creditcard.year)[-2..-1]
73
+ post[:CardExpiryMonth] = sprintf('%.2i', creditcard.month)
74
+ post[:CardExpiryYear] = sprintf('%.4i', creditcard.year)[-2..-1]
75
75
  post[:CustomerFirstName] = creditcard.first_name
76
76
  post[:CustomerLastName] = creditcard.last_name
77
77
  post[:CardHoldersName] = creditcard.name
@@ -119,7 +119,7 @@ module ActiveMerchant #:nodoc:
119
119
  end
120
120
 
121
121
  def success?(response)
122
- response[:ewaytrxnstatus] == "True"
122
+ response[:ewaytrxnstatus] == 'True'
123
123
  end
124
124
 
125
125
  def parse(xml)
@@ -134,7 +134,7 @@ module ActiveMerchant #:nodoc:
134
134
 
135
135
  def post_data(parameters = {})
136
136
  xml = REXML::Document.new
137
- root = xml.add_element("ewaygateway")
137
+ root = xml.add_element('ewaygateway')
138
138
 
139
139
  parameters.each do |key, value|
140
140
  root.add_element("eway#{key}").text = value
@@ -159,66 +159,66 @@ module ActiveMerchant #:nodoc:
159
159
  end
160
160
 
161
161
  MESSAGES = {
162
- "00" => "Transaction Approved",
163
- "01" => "Refer to Issuer",
164
- "02" => "Refer to Issuer, special",
165
- "03" => "No Merchant",
166
- "04" => "Pick Up Card",
167
- "05" => "Do Not Honour",
168
- "06" => "Error",
169
- "07" => "Pick Up Card, Special",
170
- "08" => "Honour With Identification",
171
- "09" => "Request In Progress",
172
- "10" => "Approved For Partial Amount",
173
- "11" => "Approved, VIP",
174
- "12" => "Invalid Transaction",
175
- "13" => "Invalid Amount",
176
- "14" => "Invalid Card Number",
177
- "15" => "No Issuer",
178
- "16" => "Approved, Update Track 3",
179
- "19" => "Re-enter Last Transaction",
180
- "21" => "No Action Taken",
181
- "22" => "Suspected Malfunction",
182
- "23" => "Unacceptable Transaction Fee",
183
- "25" => "Unable to Locate Record On File",
184
- "30" => "Format Error",
185
- "31" => "Bank Not Supported By Switch",
186
- "33" => "Expired Card, Capture",
187
- "34" => "Suspected Fraud, Retain Card",
188
- "35" => "Card Acceptor, Contact Acquirer, Retain Card",
189
- "36" => "Restricted Card, Retain Card",
190
- "37" => "Contact Acquirer Security Department, Retain Card",
191
- "38" => "PIN Tries Exceeded, Capture",
192
- "39" => "No Credit Account",
193
- "40" => "Function Not Supported",
194
- "41" => "Lost Card",
195
- "42" => "No Universal Account",
196
- "43" => "Stolen Card",
197
- "44" => "No Investment Account",
198
- "51" => "Insufficient Funds",
199
- "52" => "No Cheque Account",
200
- "53" => "No Savings Account",
201
- "54" => "Expired Card",
202
- "55" => "Incorrect PIN",
203
- "56" => "No Card Record",
204
- "57" => "Function Not Permitted to Cardholder",
205
- "58" => "Function Not Permitted to Terminal",
206
- "59" => "Suspected Fraud",
207
- "60" => "Acceptor Contact Acquirer",
208
- "61" => "Exceeds Withdrawal Limit",
209
- "62" => "Restricted Card",
210
- "63" => "Security Violation",
211
- "64" => "Original Amount Incorrect",
212
- "66" => "Acceptor Contact Acquirer, Security",
213
- "67" => "Capture Card",
214
- "75" => "PIN Tries Exceeded",
215
- "82" => "CVV Validation Error",
216
- "90" => "Cutoff In Progress",
217
- "91" => "Card Issuer Unavailable",
218
- "92" => "Unable To Route Transaction",
219
- "93" => "Cannot Complete, Violation Of The Law",
220
- "94" => "Duplicate Transaction",
221
- "96" => "System Error"
162
+ '00' => 'Transaction Approved',
163
+ '01' => 'Refer to Issuer',
164
+ '02' => 'Refer to Issuer, special',
165
+ '03' => 'No Merchant',
166
+ '04' => 'Pick Up Card',
167
+ '05' => 'Do Not Honour',
168
+ '06' => 'Error',
169
+ '07' => 'Pick Up Card, Special',
170
+ '08' => 'Honour With Identification',
171
+ '09' => 'Request In Progress',
172
+ '10' => 'Approved For Partial Amount',
173
+ '11' => 'Approved, VIP',
174
+ '12' => 'Invalid Transaction',
175
+ '13' => 'Invalid Amount',
176
+ '14' => 'Invalid Card Number',
177
+ '15' => 'No Issuer',
178
+ '16' => 'Approved, Update Track 3',
179
+ '19' => 'Re-enter Last Transaction',
180
+ '21' => 'No Action Taken',
181
+ '22' => 'Suspected Malfunction',
182
+ '23' => 'Unacceptable Transaction Fee',
183
+ '25' => 'Unable to Locate Record On File',
184
+ '30' => 'Format Error',
185
+ '31' => 'Bank Not Supported By Switch',
186
+ '33' => 'Expired Card, Capture',
187
+ '34' => 'Suspected Fraud, Retain Card',
188
+ '35' => 'Card Acceptor, Contact Acquirer, Retain Card',
189
+ '36' => 'Restricted Card, Retain Card',
190
+ '37' => 'Contact Acquirer Security Department, Retain Card',
191
+ '38' => 'PIN Tries Exceeded, Capture',
192
+ '39' => 'No Credit Account',
193
+ '40' => 'Function Not Supported',
194
+ '41' => 'Lost Card',
195
+ '42' => 'No Universal Account',
196
+ '43' => 'Stolen Card',
197
+ '44' => 'No Investment Account',
198
+ '51' => 'Insufficient Funds',
199
+ '52' => 'No Cheque Account',
200
+ '53' => 'No Savings Account',
201
+ '54' => 'Expired Card',
202
+ '55' => 'Incorrect PIN',
203
+ '56' => 'No Card Record',
204
+ '57' => 'Function Not Permitted to Cardholder',
205
+ '58' => 'Function Not Permitted to Terminal',
206
+ '59' => 'Suspected Fraud',
207
+ '60' => 'Acceptor Contact Acquirer',
208
+ '61' => 'Exceeds Withdrawal Limit',
209
+ '62' => 'Restricted Card',
210
+ '63' => 'Security Violation',
211
+ '64' => 'Original Amount Incorrect',
212
+ '66' => 'Acceptor Contact Acquirer, Security',
213
+ '67' => 'Capture Card',
214
+ '75' => 'PIN Tries Exceeded',
215
+ '82' => 'CVV Validation Error',
216
+ '90' => 'Cutoff In Progress',
217
+ '91' => 'Card Issuer Unavailable',
218
+ '92' => 'Unable To Route Transaction',
219
+ '93' => 'Cannot Complete, Violation Of The Law',
220
+ '94' => 'Duplicate Transaction',
221
+ '96' => 'System Error'
222
222
  }
223
223
  end
224
224
  end
@@ -46,7 +46,7 @@ module ActiveMerchant #:nodoc:
46
46
  add_address(post, billing_address)
47
47
  add_misc_fields(post, options)
48
48
 
49
- commit("CreateCustomer", post)
49
+ commit('CreateCustomer', post)
50
50
  end
51
51
 
52
52
  def update(billing_id, creditcard, options={})
@@ -64,7 +64,7 @@ module ActiveMerchant #:nodoc:
64
64
  add_address(post, billing_address)
65
65
  add_misc_fields(post, options)
66
66
 
67
- commit("UpdateCustomer", post)
67
+ commit('UpdateCustomer', post)
68
68
  end
69
69
 
70
70
  # Process a payment in the given amount against the stored credit card given by billing_id
@@ -86,7 +86,7 @@ module ActiveMerchant #:nodoc:
86
86
  post[:amount]=money
87
87
  add_invoice(post, options)
88
88
 
89
- commit("ProcessPayment", post)
89
+ commit('ProcessPayment', post)
90
90
  end
91
91
 
92
92
  # Get customer's stored credit card details given by billing_id
@@ -98,7 +98,7 @@ module ActiveMerchant #:nodoc:
98
98
  post = {}
99
99
  post[:managedCustomerID] = billing_id.to_s
100
100
 
101
- commit("QueryCustomer", post)
101
+ commit('QueryCustomer', post)
102
102
  end
103
103
 
104
104
  # TODO: eWay API also provides QueryPayment
@@ -106,8 +106,8 @@ module ActiveMerchant #:nodoc:
106
106
  private
107
107
 
108
108
  def eway_requires!(hash)
109
- raise ArgumentError.new("Missing eWay required parameter in `billing_address`: title") unless hash.has_key?(:title)
110
- raise ArgumentError.new("Missing eWay required parameter in `billing_address`: country") unless hash.has_key?(:country)
109
+ raise ArgumentError.new('Missing eWay required parameter in `billing_address`: title') unless hash.has_key?(:title)
110
+ raise ArgumentError.new('Missing eWay required parameter in `billing_address`: country') unless hash.has_key?(:country)
111
111
  end
112
112
 
113
113
  def add_address(post, address)
@@ -140,8 +140,8 @@ module ActiveMerchant #:nodoc:
140
140
  # add credit card details to be stored by eway. NOTE eway requires "title" field
141
141
  def add_creditcard(post, creditcard)
142
142
  post[:CCNumber] = creditcard.number
143
- post[:CCExpiryMonth] = sprintf("%.2i", creditcard.month)
144
- post[:CCExpiryYear] = sprintf("%.4i", creditcard.year)[-2..-1]
143
+ post[:CCExpiryMonth] = sprintf('%.2i', creditcard.month)
144
+ post[:CCExpiryYear] = sprintf('%.4i', creditcard.year)[-2..-1]
145
145
  post[:CCNameOnCard] = creditcard.name
146
146
  post[:FirstName] = creditcard.first_name
147
147
  post[:LastName] = creditcard.last_name
@@ -150,7 +150,7 @@ module ActiveMerchant #:nodoc:
150
150
  def parse(body)
151
151
  reply = {}
152
152
  xml = REXML::Document.new(body)
153
- if root = REXML::XPath.first(xml, "//soap:Fault") then
153
+ if root = REXML::XPath.first(xml, '//soap:Fault') then
154
154
  reply=parse_fault(root)
155
155
  else
156
156
  if root = REXML::XPath.first(xml, '//ProcessPaymentResponse/ewayResponse') then
@@ -173,12 +173,12 @@ module ActiveMerchant #:nodoc:
173
173
  # ERROR: This state should never occur. If there is a problem,
174
174
  # a soap:Fault will be returned. The presence of this
175
175
  # element always means a success.
176
- raise StandardError, "Unexpected \"false\" in UpdateCustomerResult"
176
+ raise StandardError, 'Unexpected "false" in UpdateCustomerResult'
177
177
  end
178
178
  else
179
179
  # ERROR: This state should never occur currently. We have handled
180
180
  # responses for all the methods which we support.
181
- raise StandardError, "Unexpected response"
181
+ raise StandardError, 'Unexpected response'
182
182
  end
183
183
  end
184
184
  end
@@ -3,15 +3,15 @@ require 'json'
3
3
  module ActiveMerchant #:nodoc:
4
4
  module Billing #:nodoc:
5
5
  class EwayRapidGateway < Gateway
6
- self.test_url = "https://api.sandbox.ewaypayments.com/"
7
- self.live_url = "https://api.ewaypayments.com/"
6
+ self.test_url = 'https://api.sandbox.ewaypayments.com/'
7
+ self.live_url = 'https://api.ewaypayments.com/'
8
8
 
9
9
  self.money_format = :cents
10
10
  self.supported_countries = ['AU', 'NZ', 'GB', 'SG', 'MY', 'HK']
11
11
  self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :jcb]
12
- self.homepage_url = "http://www.eway.com.au/"
13
- self.display_name = "eWAY Rapid 3.1"
14
- self.default_currency = "AUD"
12
+ self.homepage_url = 'http://www.eway.com.au/'
13
+ self.display_name = 'eWAY Rapid 3.1'
14
+ self.default_currency = 'AUD'
15
15
 
16
16
  class_attribute :partner_id
17
17
 
@@ -72,13 +72,13 @@ module ActiveMerchant #:nodoc:
72
72
  add_metadata(params, options)
73
73
  add_invoice(params, amount, options)
74
74
  add_reference(params, identification)
75
- commit(url_for("CapturePayment"), params)
75
+ commit(url_for('CapturePayment'), params)
76
76
  end
77
77
 
78
78
  def void(identification, options = {})
79
79
  params = {}
80
80
  add_reference(params, identification)
81
- commit(url_for("CancelAuthorisation"), params)
81
+ commit(url_for('CancelAuthorisation'), params)
82
82
  end
83
83
 
84
84
  # Public: Refund a transaction.
@@ -109,8 +109,8 @@ module ActiveMerchant #:nodoc:
109
109
  def refund(amount, identification, options = {})
110
110
  params = {}
111
111
  add_metadata(params, options)
112
- add_invoice(params, amount, options, "Refund")
113
- add_reference(params["Refund"], identification)
112
+ add_invoice(params, amount, options, 'Refund')
113
+ add_reference(params['Refund'], identification)
114
114
  add_customer_data(params, options)
115
115
  commit(url_for("Transaction/#{identification}/Refund"), params)
116
116
  end
@@ -140,7 +140,7 @@ module ActiveMerchant #:nodoc:
140
140
  add_customer_data(params, options)
141
141
  add_credit_card(params, payment_method, options)
142
142
  params['Method'] = 'CreateTokenCustomer'
143
- commit(url_for("Transaction"), params)
143
+ commit(url_for('Transaction'), params)
144
144
  end
145
145
 
146
146
  # Public: Update a customer's data
@@ -170,7 +170,7 @@ module ActiveMerchant #:nodoc:
170
170
  add_credit_card(params, payment_method, options)
171
171
  add_customer_token(params, customer_token)
172
172
  params['Method'] = 'UpdateTokenCustomer'
173
- commit(url_for("Transaction"), params)
173
+ commit(url_for('Transaction'), params)
174
174
  end
175
175
 
176
176
  def supports_scrubbing
@@ -197,7 +197,7 @@ module ActiveMerchant #:nodoc:
197
197
  params
198
198
  end
199
199
 
200
- def add_invoice(params, money, options, key = "Payment")
200
+ def add_invoice(params, money, options, key = 'Payment')
201
201
  currency_code = options[:currency] || currency(money)
202
202
  params[key] = {
203
203
  'TotalAmount' => localized_amount(money, currency_code),
@@ -243,8 +243,8 @@ module ActiveMerchant #:nodoc:
243
243
  card_details = params['Customer']['CardDetails'] = {}
244
244
  card_details['Name'] = truncate(credit_card.name, 50)
245
245
  card_details['Number'] = credit_card.number
246
- card_details['ExpiryMonth'] = "%02d" % (credit_card.month || 0)
247
- card_details['ExpiryYear'] = "%02d" % (credit_card.year || 0)
246
+ card_details['ExpiryMonth'] = '%02d' % (credit_card.month || 0)
247
+ card_details['ExpiryYear'] = '%02d' % (credit_card.year || 0)
248
248
  card_details['CVN'] = credit_card.verification_value
249
249
  else
250
250
  add_customer_token(params, credit_card)
@@ -262,8 +262,8 @@ module ActiveMerchant #:nodoc:
262
262
 
263
263
  def commit(url, params)
264
264
  headers = {
265
- "Authorization" => ("Basic " + Base64.strict_encode64(@options[:login].to_s + ":" + @options[:password].to_s).chomp),
266
- "Content-Type" => "application/json"
265
+ 'Authorization' => ('Basic ' + Base64.strict_encode64(@options[:login].to_s + ':' + @options[:password].to_s).chomp),
266
+ 'Content-Type' => 'application/json'
267
267
  }
268
268
  request = params.to_json
269
269
  raw = parse(ssl_post(url, request, headers))
@@ -287,12 +287,12 @@ module ActiveMerchant #:nodoc:
287
287
  end
288
288
 
289
289
  def success?(response)
290
- if response['ResponseCode'] == "00"
290
+ if response['ResponseCode'] == '00'
291
291
  true
292
292
  elsif response['TransactionStatus']
293
293
  (response['TransactionStatus'] == true)
294
- elsif response["Succeeded"]
295
- (response["Succeeded"] == true)
294
+ elsif response['Succeeded']
295
+ (response['Succeeded'] == true)
296
296
  else
297
297
  false
298
298
  end
@@ -311,9 +311,9 @@ module ActiveMerchant #:nodoc:
311
311
  elsif response['ResponseCode']
312
312
  ActiveMerchant::Billing::EwayGateway::MESSAGES[response['ResponseCode']]
313
313
  elsif succeeded
314
- "Succeeded"
314
+ 'Succeeded'
315
315
  else
316
- "Failed"
316
+ 'Failed'
317
317
  end
318
318
  end
319
319
 
@@ -326,12 +326,12 @@ module ActiveMerchant #:nodoc:
326
326
  def avs_result_from(response)
327
327
  verification = response['Verification'] || {}
328
328
  code = case verification['Address']
329
- when "Valid"
330
- "M"
331
- when "Invalid"
332
- "N"
329
+ when 'Valid'
330
+ 'M'
331
+ when 'Invalid'
332
+ 'N'
333
333
  else
334
- "I"
334
+ 'I'
335
335
  end
336
336
  {:code => code}
337
337
  end
@@ -339,12 +339,12 @@ module ActiveMerchant #:nodoc:
339
339
  def cvv_result_from(response)
340
340
  verification = response['Verification'] || {}
341
341
  case verification['CVN']
342
- when "Valid"
343
- "M"
344
- when "Invalid"
345
- "N"
342
+ when 'Valid'
343
+ 'M'
344
+ when 'Invalid'
345
+ 'N'
346
346
  else
347
- "P"
347
+ 'P'
348
348
  end
349
349
  end
350
350
 
@@ -3,15 +3,15 @@ module ActiveMerchant #:nodoc:
3
3
  class ExactGateway < Gateway
4
4
  self.live_url = self.test_url = 'https://secure2.e-xact.com/vplug-in/transaction/rpc-enc/service.asmx'
5
5
 
6
- API_VERSION = "8.5"
6
+ API_VERSION = '8.5'
7
7
 
8
- TEST_LOGINS = [ {:login => "A00049-01", :password => "test1"},
9
- {:login => "A00427-01", :password => "testus"} ]
8
+ TEST_LOGINS = [ {:login => 'A00049-01', :password => 'test1'},
9
+ {:login => 'A00427-01', :password => 'testus'} ]
10
10
 
11
- TRANSACTIONS = { :sale => "00",
12
- :authorization => "01",
13
- :capture => "32",
14
- :credit => "34" }
11
+ TRANSACTIONS = { :sale => '00',
12
+ :authorization => '01',
13
+ :capture => '32',
14
+ :credit => '34' }
15
15
 
16
16
 
17
17
  ENVELOPE_NAMESPACES = { 'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
@@ -19,7 +19,7 @@ module ActiveMerchant #:nodoc:
19
19
  'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance'
20
20
  }
21
21
 
22
- SEND_AND_COMMIT_ATTRIBUTES = { 'xmlns:n1' => "http://secure2.e-xact.com/vplug-in/transaction/rpc-enc/Request",
22
+ SEND_AND_COMMIT_ATTRIBUTES = { 'xmlns:n1' => 'http://secure2.e-xact.com/vplug-in/transaction/rpc-enc/Request',
23
23
  'env:encodingStyle' => 'http://schemas.xmlsoap.org/soap/encoding/'
24
24
  }
25
25
 
@@ -27,11 +27,11 @@ module ActiveMerchant #:nodoc:
27
27
  'xsi:type' => 'n2:Transaction'
28
28
  }
29
29
 
30
- POST_HEADERS = { 'soapAction' => "http://secure2.e-xact.com/vplug-in/transaction/rpc-enc/SendAndCommit",
30
+ POST_HEADERS = { 'soapAction' => 'http://secure2.e-xact.com/vplug-in/transaction/rpc-enc/SendAndCommit',
31
31
  'Content-Type' => 'text/xml'
32
32
  }
33
33
 
34
- SUCCESS = "true"
34
+ SUCCESS = 'true'
35
35
 
36
36
  SENSITIVE_FIELDS = [ :verification_str2, :expiry_date, :card_number ]
37
37
 
@@ -207,9 +207,9 @@ module ActiveMerchant #:nodoc:
207
207
  response = {}
208
208
  xml = REXML::Document.new(xml)
209
209
 
210
- if root = REXML::XPath.first(xml, "//types:TransactionResult")
210
+ if root = REXML::XPath.first(xml, '//types:TransactionResult')
211
211
  parse_elements(response, root)
212
- elsif root = REXML::XPath.first(xml, "//soap:Fault")
212
+ elsif root = REXML::XPath.first(xml, '//soap:Fault')
213
213
  parse_elements(response, root)
214
214
  end
215
215