activemerchant 1.45.0 → 1.126.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (288) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG +2167 -2
  3. data/CONTRIBUTORS +57 -0
  4. data/README.md +62 -41
  5. data/lib/active_merchant/billing/avs_result.rb +25 -28
  6. data/lib/active_merchant/billing/base.rb +11 -35
  7. data/lib/active_merchant/billing/check.rb +28 -24
  8. data/lib/active_merchant/billing/compatibility.rb +10 -12
  9. data/lib/active_merchant/billing/credit_card.rb +141 -69
  10. data/lib/active_merchant/billing/credit_card_formatting.rb +4 -4
  11. data/lib/active_merchant/billing/credit_card_methods.rb +348 -52
  12. data/lib/active_merchant/billing/cvv_result.rb +0 -1
  13. data/lib/active_merchant/billing/gateway.rb +125 -61
  14. data/lib/active_merchant/billing/gateways/adyen.rb +633 -127
  15. data/lib/active_merchant/billing/gateways/airwallex.rb +341 -0
  16. data/lib/active_merchant/billing/gateways/allied_wallet.rb +205 -0
  17. data/lib/active_merchant/billing/gateways/authorize_net.rb +883 -195
  18. data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +31 -24
  19. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +104 -103
  20. data/lib/active_merchant/billing/gateways/axcessms.rb +179 -0
  21. data/lib/active_merchant/billing/gateways/balanced.rb +72 -65
  22. data/lib/active_merchant/billing/gateways/bambora_apac.rb +222 -0
  23. data/lib/active_merchant/billing/gateways/bank_frick.rb +16 -16
  24. data/lib/active_merchant/billing/gateways/banwire.rb +24 -13
  25. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +397 -0
  26. data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +7 -7
  27. data/lib/active_merchant/billing/gateways/be2bill.rb +7 -7
  28. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +143 -62
  29. data/lib/active_merchant/billing/gateways/beanstream.rb +45 -13
  30. data/lib/active_merchant/billing/gateways/beanstream_interac.rb +13 -10
  31. data/lib/active_merchant/billing/gateways/blue_pay.rb +549 -506
  32. data/lib/active_merchant/billing/gateways/blue_snap.rb +623 -0
  33. data/lib/active_merchant/billing/gateways/bogus.rb +82 -36
  34. data/lib/active_merchant/billing/gateways/borgun.rb +61 -40
  35. data/lib/active_merchant/billing/gateways/bpoint.rb +277 -0
  36. data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +21 -2
  37. data/lib/active_merchant/billing/gateways/braintree/token_nonce.rb +113 -0
  38. data/lib/active_merchant/billing/gateways/braintree.rb +3 -3
  39. data/lib/active_merchant/billing/gateways/braintree_blue.rb +592 -203
  40. data/lib/active_merchant/billing/gateways/braintree_orange.rb +3 -4
  41. data/lib/active_merchant/billing/gateways/bridge_pay.rb +116 -61
  42. data/lib/active_merchant/billing/gateways/cams.rb +230 -0
  43. data/lib/active_merchant/billing/gateways/card_connect.rb +320 -0
  44. data/lib/active_merchant/billing/gateways/card_save.rb +7 -9
  45. data/lib/active_merchant/billing/gateways/card_stream.rb +248 -97
  46. data/lib/active_merchant/billing/gateways/cardknox.rb +327 -0
  47. data/lib/active_merchant/billing/gateways/cardprocess.rb +256 -0
  48. data/lib/active_merchant/billing/gateways/cashnet.rb +70 -26
  49. data/lib/active_merchant/billing/gateways/cc5.rb +14 -17
  50. data/lib/active_merchant/billing/gateways/cecabank.rb +73 -53
  51. data/lib/active_merchant/billing/gateways/cenpos.rb +328 -0
  52. data/lib/active_merchant/billing/gateways/checkout.rb +32 -33
  53. data/lib/active_merchant/billing/gateways/checkout_v2.rb +340 -0
  54. data/lib/active_merchant/billing/gateways/citrus_pay.rb +21 -0
  55. data/lib/active_merchant/billing/gateways/clearhaus.rb +219 -0
  56. data/lib/active_merchant/billing/gateways/commercegate.rb +11 -12
  57. data/lib/active_merchant/billing/gateways/conekta.rb +55 -34
  58. data/lib/active_merchant/billing/gateways/creditcall.rb +272 -0
  59. data/lib/active_merchant/billing/gateways/credorax.rb +506 -0
  60. data/lib/active_merchant/billing/gateways/ct_payment.rb +269 -0
  61. data/lib/active_merchant/billing/gateways/culqi.rb +279 -0
  62. data/lib/active_merchant/billing/gateways/cyber_source.rb +637 -221
  63. data/lib/active_merchant/billing/gateways/d_local.rb +303 -0
  64. data/lib/active_merchant/billing/gateways/data_cash.rb +57 -355
  65. data/lib/active_merchant/billing/gateways/decidir.rb +347 -0
  66. data/lib/active_merchant/billing/gateways/decidir_plus.rb +344 -0
  67. data/lib/active_merchant/billing/gateways/dibs.rb +199 -0
  68. data/lib/active_merchant/billing/gateways/digitzs.rb +295 -0
  69. data/lib/active_merchant/billing/gateways/ebanx.rb +334 -0
  70. data/lib/active_merchant/billing/gateways/efsnet.rb +46 -50
  71. data/lib/active_merchant/billing/gateways/elavon.rb +377 -250
  72. data/lib/active_merchant/billing/gateways/element.rb +386 -0
  73. data/lib/active_merchant/billing/gateways/epay.rb +92 -71
  74. data/lib/active_merchant/billing/gateways/evo_ca.rb +13 -14
  75. data/lib/active_merchant/billing/gateways/eway.rb +85 -73
  76. data/lib/active_merchant/billing/gateways/eway_managed.rb +85 -87
  77. data/lib/active_merchant/billing/gateways/eway_rapid.rb +134 -80
  78. data/lib/active_merchant/billing/gateways/exact.rb +37 -36
  79. data/lib/active_merchant/billing/gateways/ezic.rb +195 -0
  80. data/lib/active_merchant/billing/gateways/fat_zebra.rb +124 -74
  81. data/lib/active_merchant/billing/gateways/federated_canada.rb +11 -13
  82. data/lib/active_merchant/billing/gateways/finansbank.rb +4 -5
  83. data/lib/active_merchant/billing/gateways/first_giving.rb +23 -23
  84. data/lib/active_merchant/billing/gateways/first_pay.rb +45 -23
  85. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +184 -87
  86. data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +505 -0
  87. data/lib/active_merchant/billing/gateways/flo2cash.rb +215 -0
  88. data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +20 -0
  89. data/lib/active_merchant/billing/gateways/forte.rb +286 -0
  90. data/lib/active_merchant/billing/gateways/garanti.rb +31 -32
  91. data/lib/active_merchant/billing/gateways/global_collect.rb +507 -0
  92. data/lib/active_merchant/billing/gateways/global_transport.rb +25 -15
  93. data/lib/active_merchant/billing/gateways/hdfc.rb +55 -57
  94. data/lib/active_merchant/billing/gateways/hps.rb +252 -68
  95. data/lib/active_merchant/billing/gateways/iats_payments.rb +99 -38
  96. data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +15 -0
  97. data/lib/active_merchant/billing/gateways/inspire.rb +48 -48
  98. data/lib/active_merchant/billing/gateways/instapay.rb +10 -14
  99. data/lib/active_merchant/billing/gateways/ipg.rb +415 -0
  100. data/lib/active_merchant/billing/gateways/ipp.rb +176 -0
  101. data/lib/active_merchant/billing/gateways/iridium.rb +254 -244
  102. data/lib/active_merchant/billing/gateways/itransact.rb +14 -14
  103. data/lib/active_merchant/billing/gateways/iveri.rb +254 -0
  104. data/lib/active_merchant/billing/gateways/ixopay.rb +320 -0
  105. data/lib/active_merchant/billing/gateways/jetpay.rb +200 -80
  106. data/lib/active_merchant/billing/gateways/jetpay_v2.rb +432 -0
  107. data/lib/active_merchant/billing/gateways/komoju.rb +115 -0
  108. data/lib/active_merchant/billing/gateways/kushki.rb +277 -0
  109. data/lib/active_merchant/billing/gateways/latitude19.rb +412 -0
  110. data/lib/active_merchant/billing/gateways/linkpoint.rb +95 -85
  111. data/lib/active_merchant/billing/gateways/litle.rb +371 -94
  112. data/lib/active_merchant/billing/gateways/mastercard.rb +293 -0
  113. data/lib/active_merchant/billing/gateways/maxipago.rb +146 -123
  114. data/lib/active_merchant/billing/gateways/mercado_pago.rb +331 -0
  115. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +47 -23
  116. data/lib/active_merchant/billing/gateways/merchant_one.rb +16 -20
  117. data/lib/active_merchant/billing/gateways/merchant_partners.rb +245 -0
  118. data/lib/active_merchant/billing/gateways/merchant_ware.rb +54 -60
  119. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +60 -44
  120. data/lib/active_merchant/billing/gateways/merchant_warrior.rb +76 -23
  121. data/lib/active_merchant/billing/gateways/mercury.rb +73 -54
  122. data/lib/active_merchant/billing/gateways/metrics_global.rb +33 -43
  123. data/lib/active_merchant/billing/gateways/micropayment.rb +182 -0
  124. data/lib/active_merchant/billing/gateways/migs/migs_codes.rb +7 -7
  125. data/lib/active_merchant/billing/gateways/migs.rb +101 -37
  126. data/lib/active_merchant/billing/gateways/mit.rb +260 -0
  127. data/lib/active_merchant/billing/gateways/modern_payments.rb +3 -3
  128. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +30 -34
  129. data/lib/active_merchant/billing/gateways/moka.rb +290 -0
  130. data/lib/active_merchant/billing/gateways/monei.rb +422 -0
  131. data/lib/active_merchant/billing/gateways/moneris.rb +236 -72
  132. data/lib/active_merchant/billing/gateways/money_movers.rb +11 -13
  133. data/lib/active_merchant/billing/gateways/mundipagg.rb +363 -0
  134. data/lib/active_merchant/billing/gateways/nab_transact.rb +87 -68
  135. data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +163 -0
  136. data/lib/active_merchant/billing/gateways/net_registry.rb +12 -12
  137. data/lib/active_merchant/billing/gateways/netaxept.rb +33 -34
  138. data/lib/active_merchant/billing/gateways/netbanx.rb +376 -0
  139. data/lib/active_merchant/billing/gateways/netbilling.rb +82 -43
  140. data/lib/active_merchant/billing/gateways/netpay.rb +10 -10
  141. data/lib/active_merchant/billing/gateways/network_merchants.rb +7 -11
  142. data/lib/active_merchant/billing/gateways/nmi.rb +279 -174
  143. data/lib/active_merchant/billing/gateways/ogone.rb +96 -50
  144. data/lib/active_merchant/billing/gateways/omise.rb +323 -0
  145. data/lib/active_merchant/billing/gateways/openpay.rb +58 -23
  146. data/lib/active_merchant/billing/gateways/opp.rb +394 -0
  147. data/lib/active_merchant/billing/gateways/optimal_payment.rb +87 -69
  148. data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +5 -7
  149. data/lib/active_merchant/billing/gateways/orbital.rb +771 -328
  150. data/lib/active_merchant/billing/gateways/pac_net_raven.rb +31 -32
  151. data/lib/active_merchant/billing/gateways/pagarme.rb +239 -0
  152. data/lib/active_merchant/billing/gateways/pago_facil.rb +12 -14
  153. data/lib/active_merchant/billing/gateways/pay_arc.rb +392 -0
  154. data/lib/active_merchant/billing/gateways/pay_conex.rb +245 -0
  155. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +84 -68
  156. data/lib/active_merchant/billing/gateways/pay_hub.rb +213 -0
  157. data/lib/active_merchant/billing/gateways/pay_junction.rb +37 -37
  158. data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +206 -0
  159. data/lib/active_merchant/billing/gateways/pay_secure.rb +15 -17
  160. data/lib/active_merchant/billing/gateways/pay_trace.rb +404 -0
  161. data/lib/active_merchant/billing/gateways/paybox_direct.rb +85 -49
  162. data/lib/active_merchant/billing/gateways/payeezy.rb +458 -0
  163. data/lib/active_merchant/billing/gateways/payex.rb +39 -42
  164. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +67 -41
  165. data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +11 -8
  166. data/lib/active_merchant/billing/gateways/payflow/payflow_response.rb +3 -3
  167. data/lib/active_merchant/billing/gateways/payflow.rb +215 -46
  168. data/lib/active_merchant/billing/gateways/payflow_express.rb +64 -68
  169. data/lib/active_merchant/billing/gateways/payflow_express_uk.rb +2 -3
  170. data/lib/active_merchant/billing/gateways/payflow_uk.rb +5 -6
  171. data/lib/active_merchant/billing/gateways/payment_express.rb +78 -58
  172. data/lib/active_merchant/billing/gateways/paymentez.rb +353 -0
  173. data/lib/active_merchant/billing/gateways/paymill.rb +163 -75
  174. data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +55 -7
  175. data/lib/active_merchant/billing/gateways/paypal/paypal_recurring_api.rb +1 -1
  176. data/lib/active_merchant/billing/gateways/paypal.rb +37 -18
  177. data/lib/active_merchant/billing/gateways/paypal_ca.rb +2 -2
  178. data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +5 -5
  179. data/lib/active_merchant/billing/gateways/paypal_express.rb +12 -6
  180. data/lib/active_merchant/billing/gateways/paypal_express_common.rb +3 -3
  181. data/lib/active_merchant/billing/gateways/paysafe.rb +412 -0
  182. data/lib/active_merchant/billing/gateways/payscout.rb +10 -13
  183. data/lib/active_merchant/billing/gateways/paystation.rb +96 -91
  184. data/lib/active_merchant/billing/gateways/payu_in.rb +249 -0
  185. data/lib/active_merchant/billing/gateways/payu_latam.rb +479 -0
  186. data/lib/active_merchant/billing/gateways/payway.rb +27 -27
  187. data/lib/active_merchant/billing/gateways/payway_dot_com.rb +253 -0
  188. data/lib/active_merchant/billing/gateways/pin.rb +113 -37
  189. data/lib/active_merchant/billing/gateways/plugnpay.rb +82 -82
  190. data/lib/active_merchant/billing/gateways/priority.rb +369 -0
  191. data/lib/active_merchant/billing/gateways/pro_pay.rb +325 -0
  192. data/lib/active_merchant/billing/gateways/psigate.rb +55 -44
  193. data/lib/active_merchant/billing/gateways/psl_card.rb +32 -40
  194. data/lib/active_merchant/billing/gateways/qbms.rb +86 -76
  195. data/lib/active_merchant/billing/gateways/quantum.rb +21 -23
  196. data/lib/active_merchant/billing/gateways/quickbooks.rb +377 -0
  197. data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +184 -0
  198. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +297 -0
  199. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +226 -0
  200. data/lib/active_merchant/billing/gateways/quickpay.rb +10 -353
  201. data/lib/active_merchant/billing/gateways/qvalent.rb +305 -0
  202. data/lib/active_merchant/billing/gateways/rapyd.rb +258 -0
  203. data/lib/active_merchant/billing/gateways/realex.rb +154 -52
  204. data/lib/active_merchant/billing/gateways/redsys.rb +488 -161
  205. data/lib/active_merchant/billing/gateways/s5.rb +247 -0
  206. data/lib/active_merchant/billing/gateways/safe_charge.rb +298 -0
  207. data/lib/active_merchant/billing/gateways/sage.rb +404 -133
  208. data/lib/active_merchant/billing/gateways/sage_pay.rb +145 -109
  209. data/lib/active_merchant/billing/gateways/sallie_mae.rb +13 -15
  210. data/lib/active_merchant/billing/gateways/secure_net.rb +62 -54
  211. data/lib/active_merchant/billing/gateways/secure_pay.rb +32 -42
  212. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +36 -27
  213. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +14 -16
  214. data/lib/active_merchant/billing/gateways/securion_pay.rb +265 -0
  215. data/lib/active_merchant/billing/gateways/simetrik.rb +362 -0
  216. data/lib/active_merchant/billing/gateways/skip_jack.rb +52 -54
  217. data/lib/active_merchant/billing/gateways/smart_ps.rb +51 -60
  218. data/lib/active_merchant/billing/gateways/so_easy_pay.rb +29 -29
  219. data/lib/active_merchant/billing/gateways/spreedly_core.rb +108 -43
  220. data/lib/active_merchant/billing/gateways/stripe.rb +536 -120
  221. data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +516 -0
  222. data/lib/active_merchant/billing/gateways/swipe_checkout.rb +19 -25
  223. data/lib/active_merchant/billing/gateways/telr.rb +273 -0
  224. data/lib/active_merchant/billing/gateways/tns.rb +16 -217
  225. data/lib/active_merchant/billing/gateways/trans_first.rb +148 -34
  226. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +612 -0
  227. data/lib/active_merchant/billing/gateways/transact_pro.rb +222 -0
  228. data/lib/active_merchant/billing/gateways/transax.rb +6 -8
  229. data/lib/active_merchant/billing/gateways/transnational.rb +1 -2
  230. data/lib/active_merchant/billing/gateways/trexle.rb +221 -0
  231. data/lib/active_merchant/billing/gateways/trust_commerce.rb +162 -89
  232. data/lib/active_merchant/billing/gateways/usa_epay.rb +5 -6
  233. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +332 -236
  234. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +185 -72
  235. data/lib/active_merchant/billing/gateways/vanco.rb +294 -0
  236. data/lib/active_merchant/billing/gateways/verifi.rb +52 -53
  237. data/lib/active_merchant/billing/gateways/viaklix.rb +19 -31
  238. data/lib/active_merchant/billing/gateways/visanet_peru.rb +250 -0
  239. data/lib/active_merchant/billing/gateways/vpos.rb +220 -0
  240. data/lib/active_merchant/billing/gateways/webpay.rb +9 -9
  241. data/lib/active_merchant/billing/gateways/wepay.rb +108 -62
  242. data/lib/active_merchant/billing/gateways/wirecard.rb +52 -43
  243. data/lib/active_merchant/billing/gateways/wompi.rb +193 -0
  244. data/lib/active_merchant/billing/gateways/world_net.rb +345 -0
  245. data/lib/active_merchant/billing/gateways/worldpay.rb +725 -121
  246. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +208 -0
  247. data/lib/active_merchant/billing/gateways/worldpay_us.rb +79 -39
  248. data/lib/active_merchant/billing/gateways.rb +8 -11
  249. data/lib/active_merchant/billing/model.rb +2 -2
  250. data/lib/active_merchant/billing/network_tokenization_credit_card.rb +39 -0
  251. data/lib/active_merchant/billing/payment_token.rb +1 -1
  252. data/lib/active_merchant/billing/rails.rb +1 -1
  253. data/lib/active_merchant/billing/response.rb +19 -13
  254. data/lib/active_merchant/billing/three_d_secure_eci_mapper.rb +27 -0
  255. data/lib/active_merchant/billing.rb +3 -0
  256. data/lib/active_merchant/connection.rb +196 -0
  257. data/lib/active_merchant/country.rb +13 -8
  258. data/lib/active_merchant/errors.rb +6 -0
  259. data/lib/active_merchant/net_http_ssl_connection.rb +11 -0
  260. data/lib/active_merchant/network_connection_retries.rb +78 -0
  261. data/lib/active_merchant/post_data.rb +26 -0
  262. data/lib/active_merchant/posts_data.rb +92 -0
  263. data/lib/active_merchant/version.rb +1 -1
  264. data/lib/active_merchant.rb +14 -59
  265. data/lib/activemerchant.rb +1 -1
  266. data/lib/certs/cacert.pem +3214 -0
  267. data/lib/support/gateway_support.rb +8 -10
  268. data/lib/support/outbound_hosts.rb +13 -10
  269. data/lib/support/ssl_verify.rb +9 -14
  270. data/lib/support/ssl_version.rb +86 -0
  271. metadata +136 -94
  272. checksums.yaml.gz.sig +0 -1
  273. data/lib/active_merchant/billing/gateways/app55.rb +0 -176
  274. data/lib/active_merchant/billing/gateways/barclays_epdq.rb +0 -314
  275. data/lib/active_merchant/billing/gateways/certo_direct.rb +0 -278
  276. data/lib/active_merchant/billing/gateways/ideal/ideal_base.rb +0 -246
  277. data/lib/active_merchant/billing/gateways/ideal/ideal_rabobank.pem +0 -13
  278. data/lib/active_merchant/billing/gateways/ideal/ideal_response.rb +0 -29
  279. data/lib/active_merchant/billing/gateways/ideal_rabobank.rb +0 -66
  280. data/lib/active_merchant/billing/gateways/moneris_us.rb +0 -291
  281. data/lib/active_merchant/billing/gateways/sage/sage_bankcard.rb +0 -87
  282. data/lib/active_merchant/billing/gateways/sage/sage_core.rb +0 -114
  283. data/lib/active_merchant/billing/gateways/sage/sage_vault.rb +0 -149
  284. data/lib/active_merchant/billing/gateways/sage/sage_virtual_check.rb +0 -102
  285. data/lib/active_merchant/billing/gateways/vindicia.rb +0 -385
  286. data/lib/active_merchant/offsite_payments_shim.rb +0 -19
  287. data.tar.gz.sig +0 -0
  288. metadata.gz.sig +0 -0
@@ -1,4 +1,3 @@
1
- #!ruby19
2
1
  # encoding: utf-8
3
2
 
4
3
  module ActiveMerchant #:nodoc:
@@ -6,54 +5,53 @@ module ActiveMerchant #:nodoc:
6
5
  class SkipJackGateway < Gateway
7
6
  API_VERSION = '?.?'
8
7
 
9
- self.live_url = "https://www.skipjackic.com"
10
- self.test_url = "https://developer.skipjackic.com"
8
+ self.live_url = 'https://www.skipjackic.com'
9
+ self.test_url = 'https://developer.skipjackic.com'
11
10
 
12
- BASIC_PATH = "/scripts/evolvcc.dll"
13
- ADVANCED_PATH = "/evolvcc/evolvcc.aspx"
11
+ BASIC_PATH = '/scripts/evolvcc.dll'
12
+ ADVANCED_PATH = '/evolvcc/evolvcc.aspx'
14
13
 
15
14
  ACTIONS = {
16
- :authorization => 'AuthorizeAPI',
17
- :change_status => 'SJAPI_TransactionChangeStatusRequest',
18
- :get_status => 'SJAPI_TransactionStatusRequest'
15
+ authorization: 'AuthorizeAPI',
16
+ change_status: 'SJAPI_TransactionChangeStatusRequest',
17
+ get_status: 'SJAPI_TransactionStatusRequest'
19
18
  }
20
19
 
21
20
  SUCCESS_MESSAGE = 'The transaction was successful.'
22
21
 
23
22
  MONETARY_CHANGE_STATUSES = ['SETTLE', 'AUTHORIZE', 'AUTHORIZE ADDITIONAL', 'CREDIT', 'SPLITSETTLE']
24
23
 
25
- CARD_CODE_ERRORS = %w( N S "" )
24
+ CARD_CODE_ERRORS = %w(N S "")
26
25
 
27
26
  CARD_CODE_MESSAGES = {
28
- "M" => "Card verification number matched",
29
- "N" => "Card verification number didn't match",
30
- "P" => "Card verification number was not processed",
31
- "S" => "Card verification number should be on card but was not indicated",
32
- "U" => "Issuer was not certified for card verification",
33
- "" => "Transaction failed because incorrect card verification number was entered or no number was entered"
27
+ 'M' => 'Card verification number matched',
28
+ 'N' => "Card verification number didn't match",
29
+ 'P' => 'Card verification number was not processed',
30
+ 'S' => 'Card verification number should be on card but was not indicated',
31
+ 'U' => 'Issuer was not certified for card verification',
32
+ '' => 'Transaction failed because incorrect card verification number was entered or no number was entered'
34
33
  }
35
34
 
36
- AVS_ERRORS = %w( A B C E I N O P R W Z )
35
+ AVS_ERRORS = %w(A B C E I N O P R W Z)
37
36
 
38
37
  AVS_MESSAGES = {
39
- "A" => "Street address matches billing information, zip/postal code does not",
40
- "B" => "Street address match for international transaction. Postal code not verified due to incompatible formats",
41
- "C" => "Street address and postal code not verified for internation transaction due to incompatible formats",
42
- "D" => "Street address and postal code match for international transaction",
43
- "E" => "Address verification service error",
44
- "I" => "Address information not verified by international issuer",
45
- "M" => "Street address and postal code match for international transaction",
46
- "N" => "Neither street address nor zip/postal match billing information",
47
- "O" => "Non-US issuer does not participate",
48
- "P" => "Postal codes match for international transaction but street address not verified due to incompatible formats",
49
- "P" => "Address verification not applicable for this transaction",
50
- "R" => "Payment gateway was unavailable or timed out",
51
- "S" => "Address verification service not supported by issuer",
52
- "U" => "Address information is unavailable",
53
- "W" => "9-digit zip/postal code matches billing information, street address does not",
54
- "X" => "Street address and 9-digit zip/postal code matches billing information",
55
- "Y" => "Street address and 5-digit zip/postal code matches billing information",
56
- "Z" => "5-digit zip/postal code matches billing information, street address does not",
38
+ 'A' => 'Street address matches billing information, zip/postal code does not',
39
+ 'B' => 'Street address match for international transaction. Postal code not verified due to incompatible formats',
40
+ 'C' => 'Street address and postal code not verified for internation transaction due to incompatible formats',
41
+ 'D' => 'Street address and postal code match for international transaction',
42
+ 'E' => 'Address verification service error',
43
+ 'I' => 'Address information not verified by international issuer',
44
+ 'M' => 'Street address and postal code match for international transaction',
45
+ 'N' => 'Neither street address nor zip/postal match billing information',
46
+ 'O' => 'Non-US issuer does not participate',
47
+ 'P' => 'Postal codes match for international transaction but street address not verified due to incompatible formats',
48
+ 'R' => 'Payment gateway was unavailable or timed out',
49
+ 'S' => 'Address verification service not supported by issuer',
50
+ 'U' => 'Address information is unavailable',
51
+ 'W' => '9-digit zip/postal code matches billing information, street address does not',
52
+ 'X' => 'Street address and 9-digit zip/postal code matches billing information',
53
+ 'Y' => 'Street address and 5-digit zip/postal code matches billing information',
54
+ 'Z' => '5-digit zip/postal code matches billing information, street address does not'
57
55
  }
58
56
 
59
57
  CHANGE_STATUS_ERROR_MESSAGES = {
@@ -162,8 +160,8 @@ module ActiveMerchant #:nodoc:
162
160
  '-117' => 'POS Check Invalid Cashier Number'
163
161
  }
164
162
 
165
- self.supported_countries = ['US', 'CA']
166
- self.supported_cardtypes = [:visa, :master, :american_express, :jcb, :discover, :diners_club]
163
+ self.supported_countries = %w[US CA]
164
+ self.supported_cardtypes = %i[visa master american_express jcb discover diners_club]
167
165
  self.homepage_url = 'http://www.skipjack.com/'
168
166
  self.display_name = 'SkipJack'
169
167
 
@@ -215,7 +213,7 @@ module ActiveMerchant #:nodoc:
215
213
  #
216
214
  # * <tt>:force_settlement</tt> -- Force the settlement to occur as soon as possible. This option is not supported by other gateways. See the SkipJack API reference for more details
217
215
  def capture(money, authorization, options = {})
218
- post = { }
216
+ post = {}
219
217
  add_status_action(post, 'SETTLE')
220
218
  add_forced_settlement(post, options)
221
219
  add_transaction_id(post, authorization)
@@ -244,7 +242,7 @@ module ActiveMerchant #:nodoc:
244
242
  end
245
243
 
246
244
  def status(order_id)
247
- commit(:get_status, nil, :szOrderNumber => order_id)
245
+ commit(:get_status, nil, szOrderNumber: order_id)
248
246
  end
249
247
 
250
248
  private
@@ -262,21 +260,20 @@ module ActiveMerchant #:nodoc:
262
260
  end
263
261
 
264
262
  def commit(action, money, parameters)
265
- response = parse( ssl_post( url_for(action), post_data(action, money, parameters) ), action )
263
+ response = parse(ssl_post(url_for(action), post_data(action, money, parameters)), action)
266
264
 
267
265
  # Pass along the original transaction id in the case an update transaction
268
266
  Response.new(response[:success], message_from(response, action), response,
269
- :test => test?,
270
- :authorization => response[:szTransactionFileName] || parameters[:szTransactionId],
271
- :avs_result => { :code => response[:szAVSResponseCode] },
272
- :cvv_result => response[:szCVV2ResponseCode]
273
- )
267
+ test: test?,
268
+ authorization: response[:szTransactionFileName] || parameters[:szTransactionId],
269
+ avs_result: { code: response[:szAVSResponseCode] },
270
+ cvv_result: response[:szCVV2ResponseCode])
274
271
  end
275
272
 
276
273
  def url_for(action)
277
274
  result = test? ? self.test_url : self.live_url
278
275
  result += advanced? && action == :authorization ? ADVANCED_PATH : BASIC_PATH
279
- result += "?#{ACTIONS[action]}"
276
+ result + "?#{ACTIONS[action]}"
280
277
  end
281
278
 
282
279
  def add_credentials(params, action)
@@ -302,9 +299,9 @@ module ActiveMerchant #:nodoc:
302
299
  when :authorization
303
300
  parse_authorization_response(body)
304
301
  when :get_status
305
- parse_status_response(body, [ :SerialNumber, :TransactionAmount, :TransactionStatusCode, :TransactionStatusMessage, :OrderNumber, :TransactionDateTime, :TransactionID, :ApprovalCode, :BatchNumber ])
302
+ parse_status_response(body, %i[SerialNumber TransactionAmount TransactionStatusCode TransactionStatusMessage OrderNumber TransactionDateTime TransactionID ApprovalCode BatchNumber])
306
303
  else
307
- parse_status_response(body, [ :SerialNumber, :TransactionAmount, :DesiredStatus, :StatusResponse, :StatusResponseMessage, :OrderNumber, :AuditID ])
304
+ parse_status_response(body, %i[SerialNumber TransactionAmount DesiredStatus StatusResponse StatusResponseMessage OrderNumber AuditID])
308
305
  end
309
306
  end
310
307
 
@@ -319,7 +316,7 @@ module ActiveMerchant #:nodoc:
319
316
  def authorize_response_map(body)
320
317
  lines = split_lines(body)
321
318
  keys, values = split_line(lines[0]), split_line(lines[1])
322
- Hash[*(keys.zip(values).flatten)].symbolize_keys
319
+ Hash[*keys.zip(values).flatten].symbolize_keys
323
320
  end
324
321
 
325
322
  def parse_authorization_response(body)
@@ -331,10 +328,10 @@ module ActiveMerchant #:nodoc:
331
328
  def parse_status_response(body, response_keys)
332
329
  lines = split_lines(body)
333
330
 
334
- keys = [ :szSerialNumber, :szErrorCode, :szNumberRecords]
331
+ keys = %i[szSerialNumber szErrorCode szNumberRecords]
335
332
  values = split_line(lines[0])[0..2]
336
333
 
337
- result = Hash[*(keys.zip(values).flatten)]
334
+ result = Hash[*keys.zip(values).flatten]
338
335
 
339
336
  result[:szErrorMessage] = ''
340
337
  result[:success] = (result[:szErrorCode] == '0')
@@ -355,8 +352,8 @@ module ActiveMerchant #:nodoc:
355
352
  def post_data(action, money, params = {})
356
353
  add_credentials(params, action)
357
354
  add_amount(params, action, money)
358
- sorted_params = params.to_a.sort{|a,b| a.to_s <=> b.to_s}.reverse
359
- sorted_params.collect { |key, value| "#{key.to_s}=#{CGI.escape(value.to_s)}" }.join("&")
355
+ sorted_params = params.to_a.sort_by(&:to_s).reverse
356
+ sorted_params.collect { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join('&')
360
357
  end
361
358
 
362
359
  def add_transaction_id(post, transaction_id)
@@ -370,14 +367,14 @@ module ActiveMerchant #:nodoc:
370
367
  post[:OrderDescription] = options[:description]
371
368
 
372
369
  if order_items = options[:items]
373
- post[:OrderString] = order_items.collect { |item| "#{item[:sku]}~#{item[:description].tr('~','-')}~#{item[:declared_value]}~#{item[:quantity]}~#{item[:taxable]}~~~~~~~~#{item[:tax_rate]}~||"}.join
370
+ post[:OrderString] = order_items.collect { |item| "#{item[:sku]}~#{item[:description].tr('~', '-')}~#{item[:declared_value]}~#{item[:quantity]}~#{item[:taxable]}~~~~~~~~#{item[:tax_rate]}~||" }.join
374
371
  else
375
372
  post[:OrderString] = '1~None~0.00~0~N~||'
376
373
  end
377
374
  end
378
375
 
379
376
  def add_creditcard(post, creditcard)
380
- post[:AccountNumber] = creditcard.number
377
+ post[:AccountNumber] = creditcard.number
381
378
  post[:Month] = creditcard.month
382
379
  post[:Year] = creditcard.year
383
380
  post[:CVV2] = creditcard.verification_value if creditcard.verification_value?
@@ -436,6 +433,7 @@ module ActiveMerchant #:nodoc:
436
433
  return CARD_CODE_MESSAGES[response[:szCVV2ResponseCode]] if CARD_CODE_ERRORS.include?(response[:szCVV2ResponseCode])
437
434
  return AVS_MESSAGES[response[:szAVSResponseMessage]] if AVS_ERRORS.include?(response[:szAVSResponseCode])
438
435
  return RETURN_CODE_MESSAGES[response[:szReturnCode]] if response[:szReturnCode] != '1'
436
+
439
437
  return response[:szAuthorizationDeclinedMessage]
440
438
  end
441
439
  end
@@ -3,7 +3,6 @@ require File.join(File.dirname(__FILE__), '..', 'check.rb')
3
3
  module ActiveMerchant #:nodoc:
4
4
  module Billing #:nodoc:
5
5
  class SmartPs < Gateway #:nodoc:
6
-
7
6
  ##
8
7
  # This is the base gateway for processors who use the smartPS processing system
9
8
 
@@ -23,9 +22,9 @@ module ActiveMerchant #:nodoc:
23
22
  def authorize(money, creditcard, options = {})
24
23
  post = {}
25
24
  add_invoice(post, options)
26
- add_payment_source(post, creditcard,options)
25
+ add_payment_source(post, creditcard, options)
27
26
  add_address(post, options[:billing_address] || options[:address])
28
- add_address(post, options[:shipping_address], "shipping")
27
+ add_address(post, options[:shipping_address], 'shipping')
29
28
  add_customer_data(post, options)
30
29
  add_currency(post, money, options)
31
30
  add_taxes(post, options)
@@ -38,7 +37,7 @@ module ActiveMerchant #:nodoc:
38
37
  add_invoice(post, options)
39
38
  add_payment_source(post, payment_source, options)
40
39
  add_address(post, options[:billing_address] || options[:address])
41
- add_address(post, options[:shipping_address], "shipping")
40
+ add_address(post, options[:shipping_address], 'shipping')
42
41
  add_customer_data(post, options)
43
42
  add_currency(post, money, options)
44
43
  add_taxes(post, options)
@@ -48,13 +47,13 @@ module ActiveMerchant #:nodoc:
48
47
  end
49
48
 
50
49
  def capture(money, authorization, options = {})
51
- post ={}
50
+ post = {}
52
51
  post[:transactionid] = authorization
53
52
  commit('capture', money, post)
54
53
  end
55
54
 
56
55
  def void(authorization, options = {})
57
- post ={}
56
+ post = {}
58
57
  post[:transactionid] = authorization
59
58
  commit('void', nil, post)
60
59
  end
@@ -65,7 +64,7 @@ module ActiveMerchant #:nodoc:
65
64
  add_payment_source(post, payment_source, options)
66
65
  add_address(post, options[:billing_address] || options[:address])
67
66
  add_customer_data(post, options)
68
- add_sku(post,options)
67
+ add_sku(post, options)
69
68
  add_currency(post, money, options)
70
69
  add_processor(post, options)
71
70
  commit('credit', money, post)
@@ -89,7 +88,7 @@ module ActiveMerchant #:nodoc:
89
88
  # CreditCard object.
90
89
  def update(vault_id, creditcard, options = {})
91
90
  post = {}
92
- post[:customer_vault] = "update_customer"
91
+ post[:customer_vault] = 'update_customer'
93
92
  add_customer_vault_id(post, vault_id)
94
93
  add_creditcard(post, creditcard, options)
95
94
  add_address(post, options[:billing_address] || options[:address])
@@ -106,10 +105,9 @@ module ActiveMerchant #:nodoc:
106
105
  commit('update', nil, post)
107
106
  end
108
107
 
109
-
110
108
  def delete(vault_id)
111
109
  post = {}
112
- post[:customer_vault] = "delete_customer"
110
+ post[:customer_vault] = 'delete_customer'
113
111
  add_customer_vault_id(post, vault_id)
114
112
  commit(nil, nil, post)
115
113
  end
@@ -119,36 +117,33 @@ module ActiveMerchant #:nodoc:
119
117
  def store(payment_source, options = {})
120
118
  post = {}
121
119
  billing_id = options.delete(:billing_id).to_s || true
122
- add_payment_source(post, payment_source, :store => billing_id)
120
+ add_payment_source(post, payment_source, store: billing_id)
123
121
  add_address(post, options[:billing_address] || options[:address])
124
122
  add_customer_data(post, options)
125
123
  commit(nil, nil, post)
126
124
  end
127
125
 
128
- alias_method :unstore, :delete
126
+ alias unstore delete
129
127
 
130
128
  private
129
+
131
130
  def add_customer_data(post, options)
132
- if options.has_key? :email
133
- post[:email] = options[:email]
134
- end
131
+ post[:email] = options[:email] if options.has_key? :email
135
132
 
136
- if options.has_key? :ip
137
- post[:ipaddress] = options[:ip]
138
- end
133
+ post[:ipaddress] = options[:ip] if options.has_key? :ip
139
134
  end
140
135
 
141
- def add_address(post, address,prefix="")
142
- prefix +="_" unless prefix.blank?
143
- unless address.blank? or address.values.blank?
144
- post[prefix+"address1"] = address[:address1].to_s
145
- post[prefix+"address2"] = address[:address2].to_s unless address[:address2].blank?
146
- post[prefix+"company"] = address[:company].to_s
147
- post[prefix+"phone"] = address[:phone].to_s
148
- post[prefix+"zip"] = address[:zip].to_s
149
- post[prefix+"city"] = address[:city].to_s
150
- post[prefix+"country"] = address[:country].to_s
151
- post[prefix+"state"] = address[:state].blank? ? 'n/a' : address[:state]
136
+ def add_address(post, address, prefix = '')
137
+ prefix += '_' unless prefix.blank?
138
+ unless address.blank? || address.values.blank?
139
+ post[prefix + 'address1'] = address[:address1].to_s
140
+ post[prefix + 'address2'] = address[:address2].to_s unless address[:address2].blank?
141
+ post[prefix + 'company'] = address[:company].to_s
142
+ post[prefix + 'phone'] = address[:phone].to_s
143
+ post[prefix + 'zip'] = address[:zip].to_s
144
+ post[prefix + 'city'] = address[:city].to_s
145
+ post[prefix + 'country'] = address[:country].to_s
146
+ post[prefix + 'state'] = address[:state].blank? ? 'n/a' : address[:state]
152
147
  end
153
148
  end
154
149
 
@@ -168,7 +163,7 @@ module ActiveMerchant #:nodoc:
168
163
  post[:orderid] = options[:order_id].to_s.gsub(/[^\w.]/, '')
169
164
  end
170
165
 
171
- def add_payment_source(params, source, options={})
166
+ def add_payment_source(params, source, options = {})
172
167
  case determine_funding_source(source)
173
168
  when :vault then add_customer_vault_id(params, source)
174
169
  when :credit_card then add_creditcard(params, source, options)
@@ -182,19 +177,19 @@ module ActiveMerchant #:nodoc:
182
177
 
183
178
  def add_creditcard(post, creditcard, options)
184
179
  if options[:store]
185
- post[:customer_vault] = "add_customer"
180
+ post[:customer_vault] = 'add_customer'
186
181
  post[:customer_vault_id] = options[:store] unless options[:store] == true
187
182
  end
188
- post[:ccnumber] = creditcard.number
183
+ post[:ccnumber] = creditcard.number
189
184
  post[:cvv] = creditcard.verification_value if creditcard.verification_value?
190
- post[:ccexp] = expdate(creditcard)
185
+ post[:ccexp] = expdate(creditcard)
191
186
  post[:firstname] = creditcard.first_name
192
187
  post[:lastname] = creditcard.last_name
193
188
  end
194
189
 
195
190
  def add_check(post, check, options)
196
191
  if options[:store]
197
- post[:customer_vault] = "add_customer"
192
+ post[:customer_vault] = 'add_customer'
198
193
  post[:customer_vault_id] = options[:store] unless options[:store] == true
199
194
  end
200
195
 
@@ -206,8 +201,8 @@ module ActiveMerchant #:nodoc:
206
201
  post[:account_type] = check.account_type # The customer's type of ACH account
207
202
  end
208
203
 
209
- def add_sku(post,options)
210
- post["product_sku_#"] = options[:sku] || options["product_sku_#"]
204
+ def add_sku(post, options)
205
+ post['product_sku_#'] = options[:sku] || options['product_sku_#']
211
206
  end
212
207
 
213
208
  def add_transaction(post, auth)
@@ -221,7 +216,7 @@ module ActiveMerchant #:nodoc:
221
216
  def parse(body)
222
217
  results = {}
223
218
  body.split(/&/).each do |pair|
224
- key,val = pair.split(/=/)
219
+ key, val = pair.split(/=/)
225
220
  results[key] = val
226
221
  end
227
222
 
@@ -229,55 +224,51 @@ module ActiveMerchant #:nodoc:
229
224
  end
230
225
 
231
226
  def commit(action, money, parameters)
232
- parameters[:amount] = amount(money) if money
233
- response = parse( ssl_post(self.live_url, post_data(action,parameters)) )
234
- Response.new(response["response"] == "1", message_from(response), response,
235
- :authorization => (response["transactionid"] || response["customer_vault_id"]),
236
- :test => test?,
237
- :cvv_result => response["cvvresponse"],
238
- :avs_result => { :code => response["avsresponse"] }
239
- )
240
-
227
+ parameters[:amount] = localized_amount(money, parameters[:currency] || default_currency) if money
228
+ response = parse(ssl_post(self.live_url, post_data(action, parameters)))
229
+ Response.new(response['response'] == '1', message_from(response), response,
230
+ authorization: (response['transactionid'] || response['customer_vault_id']),
231
+ test: test?,
232
+ cvv_result: response['cvvresponse'],
233
+ avs_result: { code: response['avsresponse'] })
241
234
  end
242
235
 
243
236
  def expdate(creditcard)
244
- year = sprintf("%.04i", creditcard.year)
245
- month = sprintf("%.02i", creditcard.month)
237
+ year = sprintf('%.04i', creditcard.year)
238
+ month = sprintf('%.02i', creditcard.month)
246
239
 
247
240
  "#{month}#{year[-2..-1]}"
248
241
  end
249
242
 
250
-
251
243
  def message_from(response)
252
- case response["responsetext"]
253
- when "SUCCESS", "Approved", nil # This is dubious, but responses from UPDATE are nil.
254
- "This transaction has been approved"
255
- when "DECLINE"
256
- "This transaction has been declined"
244
+ case response['responsetext']
245
+ when 'SUCCESS', 'Approved', nil # This is dubious, but responses from UPDATE are nil.
246
+ 'This transaction has been approved'
247
+ when 'DECLINE'
248
+ 'This transaction has been declined'
257
249
  else
258
- response["responsetext"]
250
+ response['responsetext']
259
251
  end
260
252
  end
261
253
 
262
254
  def post_data(action, parameters = {})
263
255
  post = {}
264
- post[:username] = @options[:login]
256
+ post[:username] = @options[:login]
265
257
  post[:password] = @options[:password]
266
258
  post[:type] = action if action
267
259
 
268
- request = post.merge(parameters).map {|key,value| "#{key}=#{CGI.escape(value.to_s)}"}.join("&")
260
+ request = post.merge(parameters).map { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join('&')
269
261
  request
270
262
  end
271
263
 
272
264
  def determine_funding_source(source)
273
265
  case
274
266
  when source.is_a?(String) then :vault
275
- when CreditCard.card_companies.keys.include?(card_brand(source)) then :credit_card
267
+ when CreditCard.card_companies.include?(card_brand(source)) then :credit_card
276
268
  when card_brand(source) == 'check' then :check
277
- else raise ArgumentError, "Unsupported funding source provided"
269
+ else raise ArgumentError, 'Unsupported funding source provided'
278
270
  end
279
271
  end
280
272
  end
281
273
  end
282
274
  end
283
-
@@ -4,13 +4,13 @@ module ActiveMerchant #:nodoc:
4
4
  self.live_url = self.test_url = 'https://secure.soeasypay.com/gateway.asmx'
5
5
  self.money_format = :cents
6
6
 
7
- self.supported_countries = [
8
- 'US', 'CA', 'AT', 'BE', 'BG', 'HR', 'CY', 'CZ', 'DK', 'EE',
9
- 'FI', 'FR', 'DE', 'GR', 'HU', 'IE', 'IT', 'LV', 'LT', 'LU',
10
- 'MT', 'NL', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE', 'GB',
11
- 'IS', 'NO', 'CH'
7
+ self.supported_countries = %w[
8
+ US CA AT BE BG HR CY CZ DK EE
9
+ FI FR DE GR HU IE IT LV LT LU
10
+ MT NL PL PT RO SK SI ES SE GB
11
+ IS NO CH
12
12
  ]
13
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :maestro, :jcb, :solo, :diners_club]
13
+ self.supported_cardtypes = %i[visa master american_express discover maestro jcb diners_club]
14
14
  self.homepage_url = 'http://www.soeasypay.com/'
15
15
  self.display_name = 'SoEasyPay'
16
16
 
@@ -39,11 +39,11 @@ module ActiveMerchant #:nodoc:
39
39
  commit('CaptureTransaction', do_capture(money, authorization, options), options)
40
40
  end
41
41
 
42
- def refund(money, authorization, options={})
42
+ def refund(money, authorization, options = {})
43
43
  commit('RefundTransaction', do_refund(money, authorization, options), options)
44
44
  end
45
45
 
46
- def void(authorization, options={})
46
+ def void(authorization, options = {})
47
47
  commit('CancelTransaction', do_void(authorization, options), options)
48
48
  end
49
49
 
@@ -114,7 +114,7 @@ module ActiveMerchant #:nodoc:
114
114
  def fill_cardholder(soap, card, options)
115
115
  ch_info = options[:billing_address] || options[:address]
116
116
 
117
- soap.tag!('customerIP',options[:ip].to_s)
117
+ soap.tag!('customerIP', options[:ip].to_s)
118
118
  name = card.name || ch_info[:name]
119
119
  soap.tag!('cardHolderName', name.to_s)
120
120
  address = ch_info[:address1] || ''
@@ -135,11 +135,11 @@ module ActiveMerchant #:nodoc:
135
135
  def fill_card(soap, card)
136
136
  soap.tag!('cardNumber', card.number.to_s)
137
137
  soap.tag!('cardSecurityCode', card.verification_value.to_s)
138
- soap.tag!('cardExpireMonth', card.month.to_s.rjust(2, "0"))
138
+ soap.tag!('cardExpireMonth', card.month.to_s.rjust(2, '0'))
139
139
  soap.tag!('cardExpireYear', card.year.to_s)
140
140
  end
141
141
 
142
- def fill_order_info(soap, money, options, skip_currency=false)
142
+ def fill_order_info(soap, money, options, skip_currency = false)
143
143
  soap.tag!('orderID', options[:order_id].to_s)
144
144
  soap.tag!('orderDescription', "Order #{options[:order_id]}")
145
145
  soap.tag!('amount', amount(money).to_s)
@@ -149,7 +149,7 @@ module ActiveMerchant #:nodoc:
149
149
  def parse(response, action)
150
150
  result = {}
151
151
  document = REXML::Document.new(response)
152
- response_element = document.root.get_elements("//[@xsi:type='tns:#{action}Response']").first
152
+ response_element = document.root.get_elements("//*[@xsi:type='tns:#{action}Response']").first
153
153
  response_element.elements.each do |element|
154
154
  result[element.name.underscore] = element.text
155
155
  end
@@ -157,30 +157,31 @@ module ActiveMerchant #:nodoc:
157
157
  end
158
158
 
159
159
  def commit(soap_action, soap, options)
160
- headers = {"SOAPAction" => "\"urn:Interface##{soap_action}\"",
161
- "Content-Type" => "text/xml; charset=utf-8"}
160
+ headers = { 'SOAPAction' => "\"urn:Interface##{soap_action}\"",
161
+ 'Content-Type' => 'text/xml; charset=utf-8' }
162
162
  response_string = ssl_post(test? ? self.test_url : self.live_url, soap, headers)
163
163
  response = parse(response_string, soap_action)
164
164
  return Response.new(response['errorcode'] == '000',
165
- response['errormessage'],
166
- response,
167
- :test => test?,
168
- :authorization => response['transaction_id'])
165
+ response['errormessage'],
166
+ response,
167
+ test: test?,
168
+ authorization: response['transaction_id'])
169
169
  end
170
170
 
171
171
  def build_soap(request)
172
- retval = Builder::XmlMarkup.new(:indent => 2)
173
- retval.instruct!(:xml, :version => '1.0', :encoding => 'utf-8')
172
+ retval = Builder::XmlMarkup.new(indent: 2)
173
+ retval.instruct!(:xml, version: '1.0', encoding: 'utf-8')
174
174
  retval.tag!('soap:Envelope', {
175
- 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
176
- 'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
177
- 'xmlns:soapenc' => 'http://schemas.xmlsoap.org/soap/encoding/',
178
- 'xmlns:tns' => 'urn:Interface',
179
- 'xmlns:types' => 'urn:Interface/encodedTypes',
180
- 'xmlns:soap' => 'http://schemas.xmlsoap.org/soap/envelope/'}) do
181
- retval.tag!('soap:Body', {'soap:encodingStyle'=>'http://schemas.xmlsoap.org/soap/encoding/'}) do
175
+ 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
176
+ 'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
177
+ 'xmlns:soapenc' => 'http://schemas.xmlsoap.org/soap/encoding/',
178
+ 'xmlns:tns' => 'urn:Interface',
179
+ 'xmlns:types' => 'urn:Interface/encodedTypes',
180
+ 'xmlns:soap' => 'http://schemas.xmlsoap.org/soap/envelope/'
181
+ }) do
182
+ retval.tag!('soap:Body', { 'soap:encodingStyle' => 'http://schemas.xmlsoap.org/soap/encoding/' }) do
182
183
  retval.tag!("tns:#{request}") do
183
- retval.tag!("#{request}Request", {'xsi:type'=>"tns:#{request}Request"}) do
184
+ retval.tag!("#{request}Request", { 'xsi:type' => "tns:#{request}Request" }) do
184
185
  yield retval
185
186
  end
186
187
  end
@@ -188,7 +189,6 @@ module ActiveMerchant #:nodoc:
188
189
  end
189
190
  retval.target!
190
191
  end
191
-
192
192
  end
193
193
  end
194
194
  end