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
@@ -119,7 +119,7 @@ module ActiveMerchant #:nodoc:
119
119
  'KO' => 'N',
120
120
  'NO' => 'R' }
121
121
 
122
- SUCCESS_MESSAGE = "The transaction was successful"
122
+ SUCCESS_MESSAGE = 'The transaction was successful'
123
123
 
124
124
  THREE_D_SECURE_DISPLAY_WAYS = { :main_window => 'MAINW', # display the identification page in the main window
125
125
  # (default value).
@@ -128,11 +128,11 @@ module ActiveMerchant #:nodoc:
128
128
  :pop_ix => 'POPIX' } # display the identification page in a pop-up window
129
129
  # and remain in the pop-up window.
130
130
 
131
- OGONE_NO_SIGNATURE_DEPRECATION_MESSAGE = "Signature usage will be the default for a future release of ActiveMerchant. You should either begin using it, or update your configuration to explicitly disable it (signature_encryptor: none)"
131
+ OGONE_NO_SIGNATURE_DEPRECATION_MESSAGE = 'Signature usage will be the default for a future release of ActiveMerchant. You should either begin using it, or update your configuration to explicitly disable it (signature_encryptor: none)'
132
132
  OGONE_STORE_OPTION_DEPRECATION_MESSAGE = "The 'store' option has been renamed to 'billing_id', and its usage is deprecated."
133
133
 
134
- self.test_url = "https://secure.ogone.com/ncol/test/"
135
- self.live_url = "https://secure.ogone.com/ncol/prod/"
134
+ self.test_url = 'https://secure.ogone.com/ncol/test/'
135
+ self.live_url = 'https://secure.ogone.com/ncol/prod/'
136
136
 
137
137
  self.supported_countries = ['BE', 'DE', 'FR', 'NL', 'AT', 'CH']
138
138
  # also supports Airplus and UATP
@@ -150,7 +150,7 @@ module ActiveMerchant #:nodoc:
150
150
  # Verify and reserve the specified amount on the account, without actually doing the transaction.
151
151
  def authorize(money, payment_source, options = {})
152
152
  post = {}
153
- action = (payment_source.brand == "mastercard") ? "PAU" : "RES"
153
+ action = (payment_source.brand == 'mastercard') ? 'PAU' : 'RES'
154
154
  add_invoice(post, options)
155
155
  add_payment_source(post, payment_source, options)
156
156
  add_address(post, payment_source, options)
@@ -235,12 +235,12 @@ module ActiveMerchant #:nodoc:
235
235
  private
236
236
 
237
237
  def reference_from(authorization)
238
- authorization.split(";").first
238
+ authorization.split(';').first
239
239
  end
240
240
 
241
241
  def reference_transaction?(identifier)
242
242
  return false unless identifier.is_a?(String)
243
- _, action = identifier.split(";")
243
+ _, action = identifier.split(';')
244
244
  !action.nil?
245
245
  end
246
246
 
@@ -286,7 +286,7 @@ module ActiveMerchant #:nodoc:
286
286
  THREE_D_SECURE_DISPLAY_WAYS[:main_window]
287
287
  add_pair post, 'WIN3DS', win_3ds
288
288
 
289
- add_pair post, 'HTTP_ACCEPT', options[:http_accept] || "*/*"
289
+ add_pair post, 'HTTP_ACCEPT', options[:http_accept] || '*/*'
290
290
  add_pair post, 'HTTP_USER_AGENT', options[:http_user_agent] if options[:http_user_agent]
291
291
  add_pair post, 'ACCEPTURL', options[:accept_url] if options[:accept_url]
292
292
  add_pair post, 'DECLINEURL', options[:decline_url] if options[:decline_url]
@@ -339,7 +339,7 @@ module ActiveMerchant #:nodoc:
339
339
  def add_creditcard(post, creditcard)
340
340
  add_pair post, 'CN', creditcard.name
341
341
  add_pair post, 'CARDNO', creditcard.number
342
- add_pair post, 'ED', "%02d%02s" % [creditcard.month, creditcard.year.to_s[-2..-1]]
342
+ add_pair post, 'ED', '%02d%02s' % [creditcard.month, creditcard.year.to_s[-2..-1]]
343
343
  add_pair post, 'CVC', creditcard.verification_value
344
344
  end
345
345
 
@@ -349,8 +349,8 @@ module ActiveMerchant #:nodoc:
349
349
 
350
350
  # Add HTML_ANSWER element (3-D Secure specific to the response's params)
351
351
  # Note: HTML_ANSWER is not an attribute so we add it "by hand" to the response
352
- if html_answer = REXML::XPath.first(xml_root, "//HTML_ANSWER")
353
- response["HTML_ANSWER"] = html_answer.text
352
+ if html_answer = REXML::XPath.first(xml_root, '//HTML_ANSWER')
353
+ response['HTML_ANSWER'] = html_answer.text
354
354
  end
355
355
 
356
356
  response
@@ -365,27 +365,27 @@ module ActiveMerchant #:nodoc:
365
365
  response = parse(ssl_post(url(parameters['PAYID']), post_data(action, parameters)))
366
366
 
367
367
  options = {
368
- :authorization => [response["PAYID"], action].join(";"),
368
+ :authorization => [response['PAYID'], action].join(';'),
369
369
  :test => test?,
370
- :avs_result => { :code => AVS_MAPPING[response["AAVCheck"]] },
371
- :cvv_result => CVV_MAPPING[response["CVCCheck"]]
370
+ :avs_result => { :code => AVS_MAPPING[response['AAVCheck']] },
371
+ :cvv_result => CVV_MAPPING[response['CVCCheck']]
372
372
  }
373
373
  OgoneResponse.new(successful?(response), message_from(response), response, options)
374
374
  end
375
375
 
376
376
  def url(payid)
377
- (test? ? test_url : live_url) + (payid ? "maintenancedirect.asp" : "orderdirect.asp")
377
+ (test? ? test_url : live_url) + (payid ? 'maintenancedirect.asp' : 'orderdirect.asp')
378
378
  end
379
379
 
380
380
  def successful?(response)
381
- response["NCERROR"] == "0"
381
+ response['NCERROR'] == '0'
382
382
  end
383
383
 
384
384
  def message_from(response)
385
385
  if successful?(response)
386
386
  SUCCESS_MESSAGE
387
387
  else
388
- format_error_message(response["NCERRORPLUS"])
388
+ format_error_message(response['NCERRORPLUS'])
389
389
  end
390
390
  end
391
391
 
@@ -393,9 +393,9 @@ module ActiveMerchant #:nodoc:
393
393
  raw_message = message.to_s.strip
394
394
  case raw_message
395
395
  when /\|/
396
- raw_message.split("|").join(", ").capitalize
396
+ raw_message.split('|').join(', ').capitalize
397
397
  when /\//
398
- raw_message.split("/").first.to_s.capitalize
398
+ raw_message.split('/').first.to_s.capitalize
399
399
  else
400
400
  raw_message.to_s.capitalize
401
401
  end
@@ -409,7 +409,7 @@ module ActiveMerchant #:nodoc:
409
409
 
410
410
  def add_signature(parameters)
411
411
  if @options[:signature].blank?
412
- ActiveMerchant.deprecated(OGONE_NO_SIGNATURE_DEPRECATION_MESSAGE) unless(@options[:signature_encryptor] == "none")
412
+ ActiveMerchant.deprecated(OGONE_NO_SIGNATURE_DEPRECATION_MESSAGE) unless(@options[:signature_encryptor] == 'none')
413
413
  return
414
414
  end
415
415
 
@@ -432,7 +432,7 @@ module ActiveMerchant #:nodoc:
432
432
 
433
433
  filtered_params = signed_parameters.select{|k,v| !v.blank?}
434
434
  sha_encryptor.hexdigest(
435
- filtered_params.sort_by{|k,v| k.upcase}.map{|k, v| "#{k.upcase}=#{v}#{secret}"}.join("")
435
+ filtered_params.sort_by{|k,v| k.upcase}.map{|k, v| "#{k.upcase}=#{v}#{secret}"}.join('')
436
436
  ).upcase
437
437
  end
438
438
 
@@ -449,7 +449,7 @@ module ActiveMerchant #:nodoc:
449
449
  ALIAS
450
450
  ).map{|key| parameters[key]} +
451
451
  [secret]
452
- ).join("")
452
+ ).join('')
453
453
  ).upcase
454
454
  end
455
455
 
@@ -182,7 +182,7 @@ module ActiveMerchant #:nodoc:
182
182
  key = options[:key] || @secret_key
183
183
  {
184
184
  'Content-Type' => 'application/json;utf-8',
185
- 'Omise-Version' => @api_version || "2014-07-27",
185
+ 'Omise-Version' => @api_version || '2014-07-27',
186
186
  'User-Agent' => "ActiveMerchantBindings/#{ActiveMerchant::VERSION} Ruby/#{RUBY_VERSION}",
187
187
  'Authorization' => 'Basic ' + Base64.encode64(key.to_s + ':').strip,
188
188
  'Accept-Encoding' => 'utf-8'
@@ -216,7 +216,7 @@ module ActiveMerchant #:nodoc:
216
216
  end
217
217
 
218
218
  def json_error(raw_response)
219
- msg = "Invalid response received from Omise API. Please contact support@omise.co if you continue to receive this message."
219
+ msg = 'Invalid response received from Omise API. Please contact support@omise.co if you continue to receive this message.'
220
220
  msg += "The raw response returned by the API was #{raw_response.inspect})"
221
221
  { message: msg }
222
222
  end
@@ -263,7 +263,7 @@ module ActiveMerchant #:nodoc:
263
263
  if successful?(response)
264
264
  'Success'
265
265
  else
266
- (response['message'] ? response['message'] : response['failure_message'])
266
+ response['message'] || response['failure_message']
267
267
  end
268
268
  end
269
269
 
@@ -38,6 +38,7 @@ module ActiveMerchant #:nodoc:
38
38
  def capture(money, authorization, options = {})
39
39
  post = {}
40
40
  post[:amount] = amount(money) if money
41
+ post[:payments] = options[:payments] if options[:payments]
41
42
  commit(:post, "charges/#{CGI.escape(authorization)}/capture", post, options)
42
43
  end
43
44
 
@@ -114,6 +115,7 @@ module ActiveMerchant #:nodoc:
114
115
  post[:device_session_id] = options[:device_session_id]
115
116
  post[:currency] = (options[:currency] || currency(money)).upcase
116
117
  post[:use_card_points] = options[:use_card_points] if options[:use_card_points]
118
+ post[:payment_plan] = {payments: options[:payments]} if options[:payments]
117
119
  add_creditcard(post, creditcard, options)
118
120
  post
119
121
  end
@@ -163,10 +165,10 @@ module ActiveMerchant #:nodoc:
163
165
 
164
166
  def headers(options = {})
165
167
  {
166
- "Content-Type" => "application/json",
167
- "Authorization" => "Basic " + Base64.strict_encode64(@api_key.to_s + ":").strip,
168
- "User-Agent" => "Openpay/v1 ActiveMerchantBindings/#{ActiveMerchant::VERSION}",
169
- "X-Openpay-Client-User-Agent" => user_agent
168
+ 'Content-Type' => 'application/json',
169
+ 'Authorization' => 'Basic ' + Base64.strict_encode64(@api_key.to_s + ':').strip,
170
+ 'User-Agent' => "Openpay/v1 ActiveMerchantBindings/#{ActiveMerchant::VERSION}",
171
+ 'X-Openpay-Client-User-Agent' => user_agent
170
172
  }
171
173
  end
172
174
 
@@ -253,7 +253,7 @@ module ActiveMerchant #:nodoc:
253
253
  post[:card] = {
254
254
  holder: payment.name,
255
255
  number: payment.number,
256
- expiryMonth: "%02d" % payment.month,
256
+ expiryMonth: '%02d' % payment.month,
257
257
  expiryYear: payment.year,
258
258
  cvv: payment.verification_value,
259
259
  }
@@ -297,8 +297,8 @@ module ActiveMerchant #:nodoc:
297
297
  parse(
298
298
  ssl_post(
299
299
  url,
300
- post.collect { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join("&"),
301
- "Content-Type" => "application/x-www-form-urlencoded;charset=UTF-8"
300
+ post.collect { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join('&'),
301
+ 'Content-Type' => 'application/x-www-form-urlencoded;charset=UTF-8'
302
302
  )
303
303
  )
304
304
  rescue ResponseError => e
@@ -365,7 +365,7 @@ module ActiveMerchant #:nodoc:
365
365
  else
366
366
  h[k] = v
367
367
  end
368
- end
368
+ end
369
369
  end
370
370
  end
371
371
  end
@@ -75,10 +75,10 @@ module ActiveMerchant #:nodoc:
75
75
  def parse_card_or_auth(card_or_auth, options)
76
76
  if card_or_auth.respond_to?(:number)
77
77
  @credit_card = card_or_auth
78
- @stored_data = ""
78
+ @stored_data = ''
79
79
  else
80
80
  options[:confirmationNumber] = card_or_auth
81
- @stored_data = "StoredData"
81
+ @stored_data = 'StoredData'
82
82
  end
83
83
  end
84
84
 
@@ -1,5 +1,5 @@
1
1
  require 'active_merchant/billing/gateways/orbital/orbital_soft_descriptors'
2
- require "rexml/document"
2
+ require 'rexml/document'
3
3
 
4
4
  module ActiveMerchant #:nodoc:
5
5
  module Billing #:nodoc:
@@ -30,15 +30,15 @@ module ActiveMerchant #:nodoc:
30
30
  class OrbitalGateway < Gateway
31
31
  include Empty
32
32
 
33
- API_VERSION = "7.1"
33
+ API_VERSION = '7.1'
34
34
 
35
35
  POST_HEADERS = {
36
- "MIME-Version" => "1.1",
37
- "Content-Type" => "application/PTI#{API_VERSION.gsub(/\./, '')}",
38
- "Content-transfer-encoding" => "text",
39
- "Request-number" => '1',
40
- "Document-type" => "Request",
41
- "Interface-Version" => "Ruby|ActiveMerchant|Proprietary Gateway"
36
+ 'MIME-Version' => '1.1',
37
+ 'Content-Type' => "application/PTI#{API_VERSION.gsub(/\./, '')}",
38
+ 'Content-transfer-encoding' => 'text',
39
+ 'Request-number' => '1',
40
+ 'Document-type' => 'Request',
41
+ 'Interface-Version' => 'Ruby|ActiveMerchant|Proprietary Gateway'
42
42
  }
43
43
 
44
44
  SUCCESS = '0'
@@ -65,14 +65,14 @@ module ActiveMerchant #:nodoc:
65
65
 
66
66
  class_attribute :secondary_test_url, :secondary_live_url
67
67
 
68
- self.test_url = "https://orbitalvar1.chasepaymentech.com/authorize"
69
- self.secondary_test_url = "https://orbitalvar2.chasepaymentech.com/authorize"
68
+ self.test_url = 'https://orbitalvar1.chasepaymentech.com/authorize'
69
+ self.secondary_test_url = 'https://orbitalvar2.chasepaymentech.com/authorize'
70
70
 
71
- self.live_url = "https://orbital1.chasepaymentech.com/authorize"
72
- self.secondary_live_url = "https://orbital2.chasepaymentech.com/authorize"
71
+ self.live_url = 'https://orbital1.chasepaymentech.com/authorize'
72
+ self.secondary_live_url = 'https://orbital2.chasepaymentech.com/authorize'
73
73
 
74
- self.supported_countries = ["US", "CA"]
75
- self.default_currency = "CAD"
74
+ self.supported_countries = ['US', 'CA']
75
+ self.default_currency = 'CAD'
76
76
  self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb]
77
77
 
78
78
  self.display_name = 'Orbital Paymentech'
@@ -83,45 +83,45 @@ module ActiveMerchant #:nodoc:
83
83
  AVS_SUPPORTED_COUNTRIES = ['US', 'CA', 'UK', 'GB']
84
84
 
85
85
  CURRENCY_CODES = {
86
- "AUD" => '036',
87
- "BRL" => '986',
88
- "CAD" => '124',
89
- "CLP" => '152',
90
- "CZK" => '203',
91
- "DKK" => '208',
92
- "HKD" => '344',
93
- "ICK" => '352',
94
- "JPY" => '392',
95
- "MXN" => '484',
96
- "NZD" => '554',
97
- "NOK" => '578',
98
- "SGD" => '702',
99
- "SEK" => '752',
100
- "CHF" => '756',
101
- "GBP" => '826',
102
- "USD" => '840',
103
- "EUR" => '978'
86
+ 'AUD' => '036',
87
+ 'BRL' => '986',
88
+ 'CAD' => '124',
89
+ 'CLP' => '152',
90
+ 'CZK' => '203',
91
+ 'DKK' => '208',
92
+ 'HKD' => '344',
93
+ 'ICK' => '352',
94
+ 'JPY' => '392',
95
+ 'MXN' => '484',
96
+ 'NZD' => '554',
97
+ 'NOK' => '578',
98
+ 'SGD' => '702',
99
+ 'SEK' => '752',
100
+ 'CHF' => '756',
101
+ 'GBP' => '826',
102
+ 'USD' => '840',
103
+ 'EUR' => '978'
104
104
  }
105
105
 
106
106
  CURRENCY_EXPONENTS = {
107
- "AUD" => '2',
108
- "BRL" => '2',
109
- "CAD" => '2',
110
- "CLP" => '2',
111
- "CZK" => '2',
112
- "DKK" => '2',
113
- "HKD" => '2',
114
- "ICK" => '2',
115
- "JPY" => '0',
116
- "MXN" => '2',
117
- "NZD" => '2',
118
- "NOK" => '2',
119
- "SGD" => '2',
120
- "SEK" => '2',
121
- "CHF" => '2',
122
- "GBP" => '2',
123
- "USD" => '2',
124
- "EUR" => '2'
107
+ 'AUD' => '2',
108
+ 'BRL' => '2',
109
+ 'CAD' => '2',
110
+ 'CLP' => '2',
111
+ 'CZK' => '2',
112
+ 'DKK' => '2',
113
+ 'HKD' => '2',
114
+ 'ICK' => '2',
115
+ 'JPY' => '0',
116
+ 'MXN' => '2',
117
+ 'NZD' => '2',
118
+ 'NOK' => '2',
119
+ 'SGD' => '2',
120
+ 'SEK' => '2',
121
+ 'CHF' => '2',
122
+ 'GBP' => '2',
123
+ 'USD' => '2',
124
+ 'EUR' => '2'
125
125
  }
126
126
 
127
127
  # INDUSTRY TYPES
@@ -243,7 +243,7 @@ module ActiveMerchant #:nodoc:
243
243
 
244
244
  def void(authorization, options = {}, deprecated = {})
245
245
  if(!options.kind_of?(Hash))
246
- ActiveMerchant.deprecated("Calling the void method with an amount parameter is deprecated and will be removed in a future version.")
246
+ ActiveMerchant.deprecated('Calling the void method with an amount parameter is deprecated and will be removed in a future version.')
247
247
  return void(options, deprecated.merge(:amount => authorization))
248
248
  end
249
249
 
@@ -315,7 +315,7 @@ module ActiveMerchant #:nodoc:
315
315
  private
316
316
 
317
317
  def authorization_string(*args)
318
- args.compact.join(";")
318
+ args.compact.join(';')
319
319
  end
320
320
 
321
321
  def split_authorization(authorization)
@@ -509,8 +509,8 @@ module ActiveMerchant #:nodoc:
509
509
  def parse(body)
510
510
  response = {}
511
511
  xml = REXML::Document.new(body)
512
- root = REXML::XPath.first(xml, "//Response") ||
513
- REXML::XPath.first(xml, "//ErrorResponse")
512
+ root = REXML::XPath.first(xml, '//Response') ||
513
+ REXML::XPath.first(xml, '//ErrorResponse')
514
514
  if root
515
515
  root.elements.to_a.each do |node|
516
516
  recurring_parse_element(response, node)
@@ -529,9 +529,9 @@ module ActiveMerchant #:nodoc:
529
529
  end
530
530
 
531
531
  def commit(order, message_type, trace_number=nil)
532
- headers = POST_HEADERS.merge("Content-length" => order.size.to_s)
533
- headers.merge!( "Trace-number" => trace_number.to_s,
534
- "Merchant-Id" => @options[:merchant_id] ) if @options[:retry_logic] && trace_number
532
+ headers = POST_HEADERS.merge('Content-length' => order.size.to_s)
533
+ headers.merge!( 'Trace-number' => trace_number.to_s,
534
+ 'Merchant-Id' => @options[:merchant_id] ) if @options[:retry_logic] && trace_number
535
535
  request = lambda{|url| parse(ssl_post(url, order, headers))}
536
536
 
537
537
  # Failover URL will be attempted in the event of a connection error
@@ -643,7 +643,7 @@ module ActiveMerchant #:nodoc:
643
643
  # RS - Subsequent Recurring Transactions
644
644
  def set_recurring_ind(xml, parameters)
645
645
  if parameters[:recurring_ind]
646
- raise "RecurringInd must be set to either \"RF\" or \"RS\"" unless %w(RF RS).include?(parameters[:recurring_ind])
646
+ raise 'RecurringInd must be set to either "RF" or "RS"' unless %w(RF RS).include?(parameters[:recurring_ind])
647
647
  xml.tag! :RecurringInd, parameters[:recurring_ind]
648
648
  end
649
649
  end
@@ -745,7 +745,7 @@ module ActiveMerchant #:nodoc:
745
745
  # Field lengths should be limited by byte count instead of character count
746
746
  # Returns the truncated value or nil
747
747
  def byte_limit(value, byte_length)
748
- limited_value = ""
748
+ limited_value = ''
749
749
 
750
750
  value.to_s.each_char do |c|
751
751
  break if((limited_value.bytesize + c.bytesize) > byte_length)
@@ -756,7 +756,7 @@ module ActiveMerchant #:nodoc:
756
756
  end
757
757
 
758
758
  def build_customer_request_xml(creditcard, options = {})
759
- ActiveMerchant.deprecated "Customer Profile support in Orbital is non-conformant to the ActiveMerchant API and will be removed in its current form in a future version. Please contact the ActiveMerchant maintainers if you have an interest in modifying it to conform to the store/unstore/update API."
759
+ ActiveMerchant.deprecated 'Customer Profile support in Orbital is non-conformant to the ActiveMerchant API and will be removed in its current form in a future version. Please contact the ActiveMerchant maintainers if you have an interest in modifying it to conform to the store/unstore/update API.'
760
760
  xml = xml_envelope
761
761
  xml.tag! :Request do
762
762
  xml.tag! :Profile do
@@ -793,7 +793,7 @@ module ActiveMerchant #:nodoc:
793
793
  end
794
794
 
795
795
  xml.tag! :CCAccountNum, creditcard.number if creditcard
796
- xml.tag! :CCExpireDate, creditcard.expiry_date.expiration.strftime("%m%y") if creditcard
796
+ xml.tag! :CCExpireDate, creditcard.expiry_date.expiration.strftime('%m%y') if creditcard
797
797
 
798
798
  # This has to come after CCExpireDate.
799
799
  add_managed_billing(xml, options)