activemerchant 1.100.0 → 1.133.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (267) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +1057 -0
  3. data/README.md +11 -9
  4. data/lib/active_merchant/billing/avs_result.rb +9 -9
  5. data/lib/active_merchant/billing/base.rb +0 -13
  6. data/lib/active_merchant/billing/check.rb +49 -17
  7. data/lib/active_merchant/billing/compatibility.rb +5 -4
  8. data/lib/active_merchant/billing/credit_card.rb +55 -8
  9. data/lib/active_merchant/billing/credit_card_formatting.rb +1 -0
  10. data/lib/active_merchant/billing/credit_card_methods.rb +209 -36
  11. data/lib/active_merchant/billing/cvv_result.rb +0 -1
  12. data/lib/active_merchant/billing/gateway.rb +38 -36
  13. data/lib/active_merchant/billing/gateways/adyen.rb +399 -78
  14. data/lib/active_merchant/billing/gateways/airwallex.rb +370 -0
  15. data/lib/active_merchant/billing/gateways/alelo.rb +256 -0
  16. data/lib/active_merchant/billing/gateways/allied_wallet.rb +14 -14
  17. data/lib/active_merchant/billing/gateways/authorize_net.rb +200 -130
  18. data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +27 -20
  19. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +48 -51
  20. data/lib/active_merchant/billing/gateways/axcessms.rb +13 -15
  21. data/lib/active_merchant/billing/gateways/balanced.rb +43 -36
  22. data/lib/active_merchant/billing/gateways/bambora_apac.rb +16 -20
  23. data/lib/active_merchant/billing/gateways/bank_frick.rb +13 -13
  24. data/lib/active_merchant/billing/gateways/banwire.rb +5 -5
  25. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +43 -30
  26. data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +1 -1
  27. data/lib/active_merchant/billing/gateways/be2bill.rb +5 -5
  28. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +37 -36
  29. data/lib/active_merchant/billing/gateways/beanstream.rb +21 -3
  30. data/lib/active_merchant/billing/gateways/beanstream_interac.rb +1 -1
  31. data/lib/active_merchant/billing/gateways/blue_pay.rb +53 -28
  32. data/lib/active_merchant/billing/gateways/blue_snap.rb +176 -54
  33. data/lib/active_merchant/billing/gateways/bogus.rb +24 -20
  34. data/lib/active_merchant/billing/gateways/borgun.rb +92 -38
  35. data/lib/active_merchant/billing/gateways/bpoint.rb +15 -15
  36. data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +8 -2
  37. data/lib/active_merchant/billing/gateways/braintree/token_nonce.rb +113 -0
  38. data/lib/active_merchant/billing/gateways/braintree.rb +1 -1
  39. data/lib/active_merchant/billing/gateways/braintree_blue.rb +387 -175
  40. data/lib/active_merchant/billing/gateways/bridge_pay.rb +13 -13
  41. data/lib/active_merchant/billing/gateways/cams.rb +10 -10
  42. data/lib/active_merchant/billing/gateways/card_connect.rb +33 -14
  43. data/lib/active_merchant/billing/gateways/card_save.rb +3 -4
  44. data/lib/active_merchant/billing/gateways/card_stream.rb +67 -40
  45. data/lib/active_merchant/billing/gateways/cardknox.rb +13 -13
  46. data/lib/active_merchant/billing/gateways/cardprocess.rb +4 -2
  47. data/lib/active_merchant/billing/gateways/cashnet.rb +28 -12
  48. data/lib/active_merchant/billing/gateways/cc5.rb +9 -9
  49. data/lib/active_merchant/billing/gateways/cecabank.rb +38 -38
  50. data/lib/active_merchant/billing/gateways/cenpos.rb +29 -28
  51. data/lib/active_merchant/billing/gateways/checkout.rb +7 -9
  52. data/lib/active_merchant/billing/gateways/checkout_v2.rb +316 -68
  53. data/lib/active_merchant/billing/gateways/citrus_pay.rb +1 -2
  54. data/lib/active_merchant/billing/gateways/clearhaus.rb +32 -33
  55. data/lib/active_merchant/billing/gateways/commerce_hub.rb +370 -0
  56. data/lib/active_merchant/billing/gateways/commercegate.rb +4 -4
  57. data/lib/active_merchant/billing/gateways/conekta.rb +8 -6
  58. data/lib/active_merchant/billing/gateways/creditcall.rb +18 -17
  59. data/lib/active_merchant/billing/gateways/credorax.rb +152 -63
  60. data/lib/active_merchant/billing/gateways/ct_payment.rb +15 -14
  61. data/lib/active_merchant/billing/gateways/culqi.rb +30 -28
  62. data/lib/active_merchant/billing/gateways/cyber_source/cyber_source_common.rb +36 -0
  63. data/lib/active_merchant/billing/gateways/cyber_source.rb +496 -187
  64. data/lib/active_merchant/billing/gateways/cyber_source_rest.rb +454 -0
  65. data/lib/active_merchant/billing/gateways/d_local.rb +148 -31
  66. data/lib/active_merchant/billing/gateways/data_cash.rb +34 -37
  67. data/lib/active_merchant/billing/gateways/decidir.rb +134 -21
  68. data/lib/active_merchant/billing/gateways/decidir_plus.rb +344 -0
  69. data/lib/active_merchant/billing/gateways/dibs.rb +10 -10
  70. data/lib/active_merchant/billing/gateways/digitzs.rb +11 -8
  71. data/lib/active_merchant/billing/gateways/ebanx.rb +90 -40
  72. data/lib/active_merchant/billing/gateways/efsnet.rb +36 -36
  73. data/lib/active_merchant/billing/gateways/elavon.rb +349 -194
  74. data/lib/active_merchant/billing/gateways/element.rb +71 -21
  75. data/lib/active_merchant/billing/gateways/epay.rb +43 -43
  76. data/lib/active_merchant/billing/gateways/evo_ca.rb +12 -13
  77. data/lib/active_merchant/billing/gateways/eway.rb +9 -9
  78. data/lib/active_merchant/billing/gateways/eway_managed.rb +55 -56
  79. data/lib/active_merchant/billing/gateways/eway_rapid.rb +37 -22
  80. data/lib/active_merchant/billing/gateways/exact.rb +19 -20
  81. data/lib/active_merchant/billing/gateways/ezic.rb +9 -9
  82. data/lib/active_merchant/billing/gateways/fat_zebra.rb +24 -19
  83. data/lib/active_merchant/billing/gateways/federated_canada.rb +6 -7
  84. data/lib/active_merchant/billing/gateways/finansbank.rb +3 -3
  85. data/lib/active_merchant/billing/gateways/first_giving.rb +5 -4
  86. data/lib/active_merchant/billing/gateways/first_pay.rb +7 -7
  87. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +39 -38
  88. data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +51 -31
  89. data/lib/active_merchant/billing/gateways/flo2cash.rb +24 -24
  90. data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +1 -1
  91. data/lib/active_merchant/billing/gateways/forte.rb +38 -22
  92. data/lib/active_merchant/billing/gateways/garanti.rb +12 -15
  93. data/lib/active_merchant/billing/gateways/global_collect.rb +333 -89
  94. data/lib/active_merchant/billing/gateways/global_transport.rb +8 -9
  95. data/lib/active_merchant/billing/gateways/hdfc.rb +22 -23
  96. data/lib/active_merchant/billing/gateways/hps.rb +171 -50
  97. data/lib/active_merchant/billing/gateways/iats_payments.rb +47 -25
  98. data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +1 -1
  99. data/lib/active_merchant/billing/gateways/inspire.rb +22 -27
  100. data/lib/active_merchant/billing/gateways/instapay.rb +5 -8
  101. data/lib/active_merchant/billing/gateways/ipg.rb +420 -0
  102. data/lib/active_merchant/billing/gateways/ipp.rb +9 -9
  103. data/lib/active_merchant/billing/gateways/iridium.rb +30 -31
  104. data/lib/active_merchant/billing/gateways/itransact.rb +11 -10
  105. data/lib/active_merchant/billing/gateways/iveri.rb +62 -23
  106. data/lib/active_merchant/billing/gateways/ixopay.rb +320 -0
  107. data/lib/active_merchant/billing/gateways/jetpay.rb +10 -17
  108. data/lib/active_merchant/billing/gateways/jetpay_v2.rb +13 -18
  109. data/lib/active_merchant/billing/gateways/komoju.rb +1 -1
  110. data/lib/active_merchant/billing/gateways/kushki.rb +100 -22
  111. data/lib/active_merchant/billing/gateways/latitude19.rb +20 -19
  112. data/lib/active_merchant/billing/gateways/linkpoint.rb +71 -72
  113. data/lib/active_merchant/billing/gateways/litle.rb +181 -45
  114. data/lib/active_merchant/billing/gateways/mastercard.rb +16 -22
  115. data/lib/active_merchant/billing/gateways/maxipago.rb +2 -2
  116. data/lib/active_merchant/billing/gateways/mercado_pago.rb +89 -18
  117. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +58 -24
  118. data/lib/active_merchant/billing/gateways/merchant_one.rb +7 -10
  119. data/lib/active_merchant/billing/gateways/merchant_partners.rb +19 -19
  120. data/lib/active_merchant/billing/gateways/merchant_ware.rb +18 -22
  121. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +15 -17
  122. data/lib/active_merchant/billing/gateways/merchant_warrior.rb +46 -8
  123. data/lib/active_merchant/billing/gateways/mercury.rb +19 -23
  124. data/lib/active_merchant/billing/gateways/metrics_global.rb +24 -33
  125. data/lib/active_merchant/billing/gateways/micropayment.rb +11 -12
  126. data/lib/active_merchant/billing/gateways/migs/migs_codes.rb +7 -7
  127. data/lib/active_merchant/billing/gateways/migs.rb +18 -21
  128. data/lib/active_merchant/billing/gateways/mit.rb +260 -0
  129. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +10 -12
  130. data/lib/active_merchant/billing/gateways/moka.rb +290 -0
  131. data/lib/active_merchant/billing/gateways/monei.rb +236 -150
  132. data/lib/active_merchant/billing/gateways/moneris.rb +122 -53
  133. data/lib/active_merchant/billing/gateways/money_movers.rb +6 -7
  134. data/lib/active_merchant/billing/gateways/mundipagg.rb +69 -23
  135. data/lib/active_merchant/billing/gateways/nab_transact.rb +18 -20
  136. data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +10 -12
  137. data/lib/active_merchant/billing/gateways/net_registry.rb +8 -9
  138. data/lib/active_merchant/billing/gateways/netaxept.rb +12 -12
  139. data/lib/active_merchant/billing/gateways/netbanx.rb +128 -46
  140. data/lib/active_merchant/billing/gateways/netbilling.rb +18 -21
  141. data/lib/active_merchant/billing/gateways/netpay.rb +5 -4
  142. data/lib/active_merchant/billing/gateways/network_merchants.rb +7 -10
  143. data/lib/active_merchant/billing/gateways/nmi.rb +69 -27
  144. data/lib/active_merchant/billing/gateways/ogone.rb +62 -31
  145. data/lib/active_merchant/billing/gateways/omise.rb +15 -16
  146. data/lib/active_merchant/billing/gateways/openpay.rb +33 -15
  147. data/lib/active_merchant/billing/gateways/opp.rb +39 -33
  148. data/lib/active_merchant/billing/gateways/optimal_payment.rb +43 -42
  149. data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +3 -5
  150. data/lib/active_merchant/billing/gateways/orbital.rb +623 -362
  151. data/lib/active_merchant/billing/gateways/pac_net_raven.rb +20 -20
  152. data/lib/active_merchant/billing/gateways/pagarme.rb +16 -23
  153. data/lib/active_merchant/billing/gateways/pago_facil.rb +4 -6
  154. data/lib/active_merchant/billing/gateways/pay_arc.rb +392 -0
  155. data/lib/active_merchant/billing/gateways/pay_conex.rb +17 -17
  156. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +30 -33
  157. data/lib/active_merchant/billing/gateways/pay_hub.rb +10 -10
  158. data/lib/active_merchant/billing/gateways/pay_junction.rb +31 -31
  159. data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +36 -18
  160. data/lib/active_merchant/billing/gateways/pay_secure.rb +10 -11
  161. data/lib/active_merchant/billing/gateways/pay_trace.rb +450 -0
  162. data/lib/active_merchant/billing/gateways/paybox_direct.rb +64 -40
  163. data/lib/active_merchant/billing/gateways/payeezy.rb +130 -27
  164. data/lib/active_merchant/billing/gateways/payex.rb +24 -25
  165. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +17 -17
  166. data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +1 -1
  167. data/lib/active_merchant/billing/gateways/payflow.rb +103 -25
  168. data/lib/active_merchant/billing/gateways/payflow_express.rb +4 -4
  169. data/lib/active_merchant/billing/gateways/payflow_uk.rb +1 -1
  170. data/lib/active_merchant/billing/gateways/payment_express.rb +22 -18
  171. data/lib/active_merchant/billing/gateways/paymentez.rb +89 -24
  172. data/lib/active_merchant/billing/gateways/paymill.rb +14 -16
  173. data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +2 -1
  174. data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +4 -0
  175. data/lib/active_merchant/billing/gateways/paypal.rb +13 -5
  176. data/lib/active_merchant/billing/gateways/paypal_ca.rb +1 -1
  177. data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +1 -1
  178. data/lib/active_merchant/billing/gateways/paypal_express.rb +4 -1
  179. data/lib/active_merchant/billing/gateways/paypal_express_common.rb +1 -1
  180. data/lib/active_merchant/billing/gateways/paysafe.rb +420 -0
  181. data/lib/active_merchant/billing/gateways/payscout.rb +8 -9
  182. data/lib/active_merchant/billing/gateways/paystation.rb +6 -9
  183. data/lib/active_merchant/billing/gateways/payu_in.rb +20 -19
  184. data/lib/active_merchant/billing/gateways/payu_latam.rb +70 -37
  185. data/lib/active_merchant/billing/gateways/payway.rb +22 -22
  186. data/lib/active_merchant/billing/gateways/payway_dot_com.rb +253 -0
  187. data/lib/active_merchant/billing/gateways/pin.rb +60 -21
  188. data/lib/active_merchant/billing/gateways/plexo.rb +308 -0
  189. data/lib/active_merchant/billing/gateways/plugnpay.rb +20 -21
  190. data/lib/active_merchant/billing/gateways/priority.rb +392 -0
  191. data/lib/active_merchant/billing/gateways/pro_pay.rb +13 -14
  192. data/lib/active_merchant/billing/gateways/psigate.rb +29 -29
  193. data/lib/active_merchant/billing/gateways/psl_card.rb +7 -8
  194. data/lib/active_merchant/billing/gateways/qbms.rb +25 -26
  195. data/lib/active_merchant/billing/gateways/quantum.rb +9 -11
  196. data/lib/active_merchant/billing/gateways/quickbooks.rb +126 -39
  197. data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +98 -98
  198. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +19 -23
  199. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +3 -3
  200. data/lib/active_merchant/billing/gateways/quickpay.rb +0 -1
  201. data/lib/active_merchant/billing/gateways/qvalent.rb +36 -20
  202. data/lib/active_merchant/billing/gateways/rapyd.rb +319 -0
  203. data/lib/active_merchant/billing/gateways/reach.rb +277 -0
  204. data/lib/active_merchant/billing/gateways/realex.rb +42 -16
  205. data/lib/active_merchant/billing/gateways/redsys.rb +191 -86
  206. data/lib/active_merchant/billing/gateways/s5.rb +10 -9
  207. data/lib/active_merchant/billing/gateways/safe_charge.rb +70 -33
  208. data/lib/active_merchant/billing/gateways/sage.rb +19 -21
  209. data/lib/active_merchant/billing/gateways/sage_pay.rb +57 -57
  210. data/lib/active_merchant/billing/gateways/sallie_mae.rb +3 -4
  211. data/lib/active_merchant/billing/gateways/secure_net.rb +19 -26
  212. data/lib/active_merchant/billing/gateways/secure_pay.rb +24 -33
  213. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +18 -20
  214. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +4 -5
  215. data/lib/active_merchant/billing/gateways/securion_pay.rb +48 -7
  216. data/lib/active_merchant/billing/gateways/shift4.rb +345 -0
  217. data/lib/active_merchant/billing/gateways/simetrik.rb +368 -0
  218. data/lib/active_merchant/billing/gateways/skip_jack.rb +19 -19
  219. data/lib/active_merchant/billing/gateways/smart_ps.rb +26 -32
  220. data/lib/active_merchant/billing/gateways/so_easy_pay.rb +24 -25
  221. data/lib/active_merchant/billing/gateways/spreedly_core.rb +27 -21
  222. data/lib/active_merchant/billing/gateways/stripe.rb +126 -53
  223. data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +441 -113
  224. data/lib/active_merchant/billing/gateways/swipe_checkout.rb +7 -8
  225. data/lib/active_merchant/billing/gateways/telr.rb +17 -18
  226. data/lib/active_merchant/billing/gateways/tns.rb +3 -7
  227. data/lib/active_merchant/billing/gateways/trans_first.rb +10 -9
  228. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +28 -24
  229. data/lib/active_merchant/billing/gateways/transact_pro.rb +13 -15
  230. data/lib/active_merchant/billing/gateways/transax.rb +1 -2
  231. data/lib/active_merchant/billing/gateways/trexle.rb +5 -2
  232. data/lib/active_merchant/billing/gateways/trust_commerce.rb +57 -47
  233. data/lib/active_merchant/billing/gateways/usa_epay.rb +1 -2
  234. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +176 -184
  235. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +60 -48
  236. data/lib/active_merchant/billing/gateways/vanco.rb +17 -8
  237. data/lib/active_merchant/billing/gateways/verifi.rb +13 -14
  238. data/lib/active_merchant/billing/gateways/viaklix.rb +9 -14
  239. data/lib/active_merchant/billing/gateways/visanet_peru.rb +26 -21
  240. data/lib/active_merchant/billing/gateways/vpos.rb +223 -0
  241. data/lib/active_merchant/billing/gateways/webpay.rb +4 -4
  242. data/lib/active_merchant/billing/gateways/wepay.rb +14 -16
  243. data/lib/active_merchant/billing/gateways/wirecard.rb +14 -16
  244. data/lib/active_merchant/billing/gateways/wompi.rb +197 -0
  245. data/lib/active_merchant/billing/gateways/world_net.rb +36 -35
  246. data/lib/active_merchant/billing/gateways/worldpay.rb +556 -190
  247. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +47 -54
  248. data/lib/active_merchant/billing/gateways/worldpay_us.rb +16 -16
  249. data/lib/active_merchant/billing/network_tokenization_credit_card.rb +2 -2
  250. data/lib/active_merchant/billing/response.rb +25 -6
  251. data/lib/active_merchant/billing/three_d_secure_eci_mapper.rb +27 -0
  252. data/lib/active_merchant/billing.rb +1 -0
  253. data/lib/active_merchant/connection.rb +14 -15
  254. data/lib/active_merchant/country.rb +3 -1
  255. data/lib/active_merchant/errors.rb +4 -1
  256. data/lib/active_merchant/net_http_ssl_connection.rb +1 -0
  257. data/lib/active_merchant/network_connection_retries.rb +15 -17
  258. data/lib/active_merchant/post_data.rb +3 -2
  259. data/lib/active_merchant/posts_data.rb +2 -2
  260. data/lib/active_merchant/version.rb +1 -1
  261. data/lib/active_merchant.rb +2 -2
  262. data/lib/certs/cacert.pem +1587 -2361
  263. data/lib/support/gateway_support.rb +1 -1
  264. data/lib/support/ssl_verify.rb +3 -7
  265. data/lib/support/ssl_version.rb +2 -3
  266. metadata +86 -34
  267. data/lib/active_merchant/billing/gateways/moneris_us.rb +0 -352
@@ -10,7 +10,7 @@ module ActiveMerchant #:nodoc:
10
10
 
11
11
  self.supported_countries = ['US']
12
12
  self.default_currency = 'USD'
13
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
13
+ self.supported_cardtypes = %i[visa master american_express discover]
14
14
 
15
15
  self.homepage_url = 'https://www.creditcall.com'
16
16
  self.display_name = 'Creditcall'
@@ -24,29 +24,29 @@ module ActiveMerchant #:nodoc:
24
24
 
25
25
  AVS_CODE = {
26
26
  'matched;matched' => 'D',
27
- 'matched;notchecked' =>'B',
27
+ 'matched;notchecked' => 'B',
28
28
  'matched;notmatched' => 'A',
29
29
  'matched;partialmatch' => 'A',
30
30
  'notchecked;matched' => 'P',
31
- 'notchecked;notchecked' =>'I',
31
+ 'notchecked;notchecked' => 'I',
32
32
  'notchecked;notmatched' => 'I',
33
33
  'notchecked;partialmatch' => 'I',
34
34
  'notmatched;matched' => 'W',
35
- 'notmatched;notchecked' =>'C',
35
+ 'notmatched;notchecked' => 'C',
36
36
  'notmatched;notmatched' => 'C',
37
37
  'notmatched;partialmatch' => 'C',
38
38
  'partialmatched;matched' => 'W',
39
- 'partialmatched;notchecked' =>'C',
39
+ 'partialmatched;notchecked' => 'C',
40
40
  'partialmatched;notmatched' => 'C',
41
41
  'partialmatched;partialmatch' => 'C'
42
42
  }
43
43
 
44
- def initialize(options={})
44
+ def initialize(options = {})
45
45
  requires!(options, :terminal_id, :transaction_key)
46
46
  super
47
47
  end
48
48
 
49
- def purchase(money, payment_method, options={})
49
+ def purchase(money, payment_method, options = {})
50
50
  multi_response = MultiResponse.run do |r|
51
51
  r.process { authorize(money, payment_method, options) }
52
52
  r.process { capture(money, r.authorization, options) }
@@ -66,7 +66,7 @@ module ActiveMerchant #:nodoc:
66
66
  )
67
67
  end
68
68
 
69
- def authorize(money, payment_method, options={})
69
+ def authorize(money, payment_method, options = {})
70
70
  request = build_xml_request do |xml|
71
71
  add_transaction_details(xml, money, nil, 'Auth', options)
72
72
  add_terminal_details(xml, options)
@@ -76,7 +76,7 @@ module ActiveMerchant #:nodoc:
76
76
  commit(request)
77
77
  end
78
78
 
79
- def capture(money, authorization, options={})
79
+ def capture(money, authorization, options = {})
80
80
  request = build_xml_request do |xml|
81
81
  add_transaction_details(xml, money, authorization, 'Conf', options)
82
82
  add_terminal_details(xml, options)
@@ -85,7 +85,7 @@ module ActiveMerchant #:nodoc:
85
85
  commit(request)
86
86
  end
87
87
 
88
- def refund(money, authorization, options={})
88
+ def refund(money, authorization, options = {})
89
89
  request = build_xml_request do |xml|
90
90
  add_transaction_details(xml, money, authorization, 'Refund', options)
91
91
  add_terminal_details(xml, options)
@@ -94,7 +94,7 @@ module ActiveMerchant #:nodoc:
94
94
  commit(request)
95
95
  end
96
96
 
97
- def void(authorization, options={})
97
+ def void(authorization, options = {})
98
98
  request = build_xml_request do |xml|
99
99
  add_transaction_details(xml, nil, authorization, 'Void', options)
100
100
  add_terminal_details(xml, options)
@@ -103,7 +103,7 @@ module ActiveMerchant #:nodoc:
103
103
  commit(request)
104
104
  end
105
105
 
106
- def verify(credit_card, options={})
106
+ def verify(credit_card, options = {})
107
107
  MultiResponse.run(:use_first_response) do |r|
108
108
  r.process { authorize(100, credit_card, options) }
109
109
  r.process(:ignore_result) { void(r.authorization, options) }
@@ -144,7 +144,7 @@ module ActiveMerchant #:nodoc:
144
144
  builder.to_xml
145
145
  end
146
146
 
147
- def add_transaction_details(xml, amount, authorization, type, options={})
147
+ def add_transaction_details(xml, amount, authorization, type, options = {})
148
148
  xml.TransactionDetails do
149
149
  xml.MessageType type
150
150
  xml.Amount(unit: 'Minor') { xml.text(amount) } if amount
@@ -153,7 +153,7 @@ module ActiveMerchant #:nodoc:
153
153
  end
154
154
  end
155
155
 
156
- def add_terminal_details(xml, options={})
156
+ def add_terminal_details(xml, options = {})
157
157
  xml.TerminalDetails do
158
158
  xml.TerminalID @options[:terminal_id]
159
159
  xml.TransactionKey @options[:transaction_key]
@@ -161,7 +161,7 @@ module ActiveMerchant #:nodoc:
161
161
  end
162
162
  end
163
163
 
164
- def add_card_details(xml, payment_method, options={})
164
+ def add_card_details(xml, payment_method, options = {})
165
165
  xml.CardDetails do
166
166
  xml.Manual(type: manual_type(options)) do
167
167
  xml.PAN payment_method.number
@@ -175,10 +175,11 @@ module ActiveMerchant #:nodoc:
175
175
 
176
176
  def add_additional_verification(xml, options)
177
177
  return unless (options[:verify_zip].to_s == 'true') || (options[:verify_address].to_s == 'true')
178
+
178
179
  if address = options[:billing_address]
179
180
  xml.AdditionalVerification do
180
- xml.Zip address[:zip] if options[:verify_zip].to_s == 'true'
181
- xml.Address address[:address1] if options[:verify_address].to_s == 'true'
181
+ xml.Zip address[:zip] if options[:verify_zip].to_s == 'true'
182
+ xml.Address address[:address1] if options[:verify_address].to_s == 'true'
182
183
  end
183
184
  end
184
185
  end
@@ -4,7 +4,7 @@ module ActiveMerchant #:nodoc:
4
4
  class_attribute :test_url, :live_na_url, :live_eu_url
5
5
 
6
6
  self.display_name = 'Credorax Gateway'
7
- self.homepage_url = 'https://www.credorax.com/'
7
+ self.homepage_url = 'https://www.finaro.com/'
8
8
 
9
9
  # NOTE: the IP address you run the remote tests from will need to be
10
10
  # whitelisted by Credorax; contact support@credorax.com as necessary to
@@ -20,12 +20,19 @@ module ActiveMerchant #:nodoc:
20
20
  self.live_url = 'https://assigned-subdomain.credorax.net/crax_gate/service/gateway'
21
21
 
22
22
  self.supported_countries = %w(AD AT BE BG HR CY CZ DK EE FR DE GI GR GG HU IS IE IM IT JE LV LI LT LU MT MC NO PL PT RO SM SK ES SE CH GB)
23
+
23
24
  self.default_currency = 'EUR'
24
- self.currencies_without_fractions = %w(CLP JPY KRW PYG VND)
25
- self.currencies_with_three_decimal_places = %w(BHD JOD KWD OMR RSD TND)
25
+ self.currencies_without_fractions = %w(BIF CLP DJF GNF ISK JPY KMF KRW PYG RWF VND VUV XAF XOF XPF)
26
+ self.currencies_with_three_decimal_places = %w(BHD IQD JOD KWD LYD OMR TND)
26
27
 
27
28
  self.money_format = :cents
28
- self.supported_cardtypes = [:visa, :master, :maestro]
29
+ self.supported_cardtypes = %i[visa master maestro american_express jcb discover diners_club]
30
+
31
+ NETWORK_TOKENIZATION_CARD_SOURCE = {
32
+ 'apple_pay' => 'applepay',
33
+ 'google_pay' => 'googlepay',
34
+ 'network_token' => 'vts_mdes_token'
35
+ }
29
36
 
30
37
  RESPONSE_MESSAGES = {
31
38
  '00' => 'Approved or completed successfully',
@@ -62,26 +69,27 @@ module ActiveMerchant #:nodoc:
62
69
  '31' => 'Issuer signed-off',
63
70
  '32' => 'Completed partially',
64
71
  '33' => 'Pick-up, expired card',
65
- '34' => 'Suspect Fraud',
72
+ '34' => 'Implausible card data',
66
73
  '35' => 'Pick-up, card acceptor contact acquirer',
67
74
  '36' => 'Pick up, card restricted',
68
75
  '37' => 'Pick up, call acquirer security',
69
76
  '38' => 'Pick up, Allowable PIN tries exceeded',
70
- '39' => 'Transaction Not Allowed',
77
+ '39' => 'No credit account',
71
78
  '40' => 'Requested function not supported',
72
79
  '41' => 'Lost Card, Pickup',
73
80
  '42' => 'No universal account',
74
81
  '43' => 'Pick up, stolen card',
75
82
  '44' => 'No investment account',
83
+ '46' => 'Closed account',
76
84
  '50' => 'Do not renew',
77
- '51' => 'Not sufficient funds',
85
+ '51' => 'Insufficient funds',
78
86
  '52' => 'No checking Account',
79
87
  '53' => 'No savings account',
80
88
  '54' => 'Expired card',
81
- '55' => 'Pin incorrect',
89
+ '55' => 'Incorrect PIN',
82
90
  '56' => 'No card record',
83
91
  '57' => 'Transaction not allowed for cardholder',
84
- '58' => 'Transaction not allowed for merchant',
92
+ '58' => 'Transaction not permitted to terminal',
85
93
  '59' => 'Suspected Fraud',
86
94
  '60' => 'Card acceptor contact acquirer',
87
95
  '61' => 'Exceeds withdrawal amount limit',
@@ -92,22 +100,22 @@ module ActiveMerchant #:nodoc:
92
100
  '66' => 'Call acquirers security department',
93
101
  '67' => 'Card to be picked up at ATM',
94
102
  '68' => 'Response received too late.',
95
- '70' => 'Invalid transaction; contact card issuer',
103
+ '70' => 'PIN data required',
96
104
  '71' => 'Decline PIN not changed',
97
105
  '75' => 'Pin tries exceeded',
98
106
  '76' => 'Wrong PIN, number of PIN tries exceeded',
99
107
  '77' => 'Wrong Reference No.',
100
- '78' => 'Record Not Found',
101
- '79' => 'Already reversed',
108
+ '78' => 'Blocked, first used/ Record not found',
109
+ '79' => 'Declined due to lifecycle event',
102
110
  '80' => 'Network error',
103
- '81' => 'Foreign network error / PIN cryptographic error',
104
- '82' => 'Time out at issuer system',
111
+ '81' => 'PIN cryptographic error',
112
+ '82' => 'Bad CVV/ Declined due to policy event',
105
113
  '83' => 'Transaction failed',
106
114
  '84' => 'Pre-authorization timed out',
107
115
  '85' => 'No reason to decline',
108
116
  '86' => 'Cannot verify pin',
109
117
  '87' => 'Purchase amount only, no cashback allowed',
110
- '88' => 'MAC sync Error',
118
+ '88' => 'Cryptographic failure',
111
119
  '89' => 'Authentication failure',
112
120
  '91' => 'Issuer not available',
113
121
  '92' => 'Unable to route at acquirer Module',
@@ -115,23 +123,29 @@ module ActiveMerchant #:nodoc:
115
123
  '94' => 'Duplicate Transmission',
116
124
  '95' => 'Reconcile error / Auth Not found',
117
125
  '96' => 'System malfunction',
126
+ '97' => 'Transaction has been declined by the processor',
127
+ 'N3' => 'Cash service not available',
128
+ 'N4' => 'Cash request exceeds issuer or approved limit',
129
+ 'N7' => 'CVV2 failure',
118
130
  'R0' => 'Stop Payment Order',
119
131
  'R1' => 'Revocation of Authorisation Order',
120
- 'R3' => 'Revocation of all Authorisations Order'
132
+ 'R3' => 'Revocation of all Authorisation Orders',
133
+ '1A' => 'Strong Customer Authentication required'
121
134
  }
122
135
 
123
- def initialize(options={})
136
+ def initialize(options = {})
124
137
  requires!(options, :merchant_id, :cipher_key)
125
138
  super
126
139
  end
127
140
 
128
- def purchase(amount, payment_method, options={})
141
+ def purchase(amount, payment_method, options = {})
129
142
  post = {}
130
143
  add_invoice(post, amount, options)
131
- add_payment_method(post, payment_method)
144
+ add_payment_method(post, payment_method, options)
132
145
  add_customer_data(post, options)
133
146
  add_email(post, options)
134
147
  add_3d_secure(post, options)
148
+ add_3ds_2_optional_fields(post, options)
135
149
  add_echo(post, options)
136
150
  add_submerchant_id(post, options)
137
151
  add_stored_credential(post, options)
@@ -140,22 +154,24 @@ module ActiveMerchant #:nodoc:
140
154
  commit(:purchase, post)
141
155
  end
142
156
 
143
- def authorize(amount, payment_method, options={})
157
+ def authorize(amount, payment_method, options = {})
144
158
  post = {}
145
159
  add_invoice(post, amount, options)
146
- add_payment_method(post, payment_method)
160
+ add_payment_method(post, payment_method, options)
147
161
  add_customer_data(post, options)
148
162
  add_email(post, options)
149
163
  add_3d_secure(post, options)
164
+ add_3ds_2_optional_fields(post, options)
150
165
  add_echo(post, options)
151
166
  add_submerchant_id(post, options)
152
167
  add_stored_credential(post, options)
153
168
  add_processor(post, options)
169
+ add_authorization_details(post, options)
154
170
 
155
171
  commit(:authorize, post)
156
172
  end
157
173
 
158
- def capture(amount, authorization, options={})
174
+ def capture(amount, authorization, options = {})
159
175
  post = {}
160
176
  add_invoice(post, amount, options)
161
177
  add_reference(post, authorization)
@@ -167,7 +183,7 @@ module ActiveMerchant #:nodoc:
167
183
  commit(:capture, post)
168
184
  end
169
185
 
170
- def void(authorization, options={})
186
+ def void(authorization, options = {})
171
187
  post = {}
172
188
  add_customer_data(post, options)
173
189
  reference_action = add_reference(post, authorization)
@@ -179,7 +195,7 @@ module ActiveMerchant #:nodoc:
179
195
  commit(:void, post, reference_action)
180
196
  end
181
197
 
182
- def refund(amount, authorization, options={})
198
+ def refund(amount, authorization, options = {})
183
199
  post = {}
184
200
  add_invoice(post, amount, options)
185
201
  add_reference(post, authorization)
@@ -187,25 +203,33 @@ module ActiveMerchant #:nodoc:
187
203
  add_echo(post, options)
188
204
  add_submerchant_id(post, options)
189
205
  add_processor(post, options)
206
+ add_email(post, options)
207
+ add_recipient(post, options)
190
208
 
191
- commit(:refund, post)
209
+ if options[:referral_cft]
210
+ add_customer_name(post, options)
211
+ commit(:referral_cft, post)
212
+ else
213
+ commit(:refund, post)
214
+ end
192
215
  end
193
216
 
194
- def credit(amount, payment_method, options={})
217
+ def credit(amount, payment_method, options = {})
195
218
  post = {}
196
219
  add_invoice(post, amount, options)
197
- add_payment_method(post, payment_method)
220
+ add_payment_method(post, payment_method, options)
198
221
  add_customer_data(post, options)
199
222
  add_email(post, options)
200
223
  add_echo(post, options)
201
224
  add_submerchant_id(post, options)
202
225
  add_transaction_type(post, options)
203
226
  add_processor(post, options)
227
+ add_customer_name(post, options)
204
228
 
205
229
  commit(:credit, post)
206
230
  end
207
231
 
208
- def verify(credit_card, options={})
232
+ def verify(credit_card, options = {})
209
233
  MultiResponse.run(:use_first_response) do |r|
210
234
  r.process { authorize(100, credit_card, options) }
211
235
  r.process(:ignore_result) { void(r.authorization, options) }
@@ -222,6 +246,25 @@ module ActiveMerchant #:nodoc:
222
246
  gsub(%r((b5=)\d+), '\1[FILTERED]')
223
247
  end
224
248
 
249
+ def add_3ds_2_optional_fields(post, options)
250
+ three_ds = options[:three_ds_2] || {}
251
+
252
+ if three_ds.has_key?(:optional)
253
+ three_ds[:optional].each do |key, value|
254
+ normalized_value = normalize(value)
255
+ next if normalized_value.nil?
256
+
257
+ if key == :'3ds_homephonecountry'
258
+ next unless options[:billing_address] && options[:billing_address][:phone]
259
+ end
260
+
261
+ post[key] = normalized_value unless post[key]
262
+ end
263
+ end
264
+
265
+ post
266
+ end
267
+
225
268
  private
226
269
 
227
270
  def add_invoice(post, money, options)
@@ -240,8 +283,9 @@ module ActiveMerchant #:nodoc:
240
283
  'maestro' => '9'
241
284
  }
242
285
 
243
- def add_payment_method(post, payment_method)
244
- post[:c1] = payment_method.name
286
+ def add_payment_method(post, payment_method, options)
287
+ post[:c1] = payment_method&.name || ''
288
+ add_network_tokenization_card(post, payment_method, options) if payment_method.is_a? NetworkTokenizationCreditCard
245
289
  post[:b2] = CARD_TYPES[payment_method.brand] || ''
246
290
  post[:b1] = payment_method.number
247
291
  post[:b5] = payment_method.verification_value
@@ -249,17 +293,26 @@ module ActiveMerchant #:nodoc:
249
293
  post[:b3] = format(payment_method.month, :two_digits)
250
294
  end
251
295
 
296
+ def add_network_tokenization_card(post, payment_method, options)
297
+ post[:b21] = NETWORK_TOKENIZATION_CARD_SOURCE[payment_method.source.to_s]
298
+ post[:token_eci] = post[:b21] == 'vts_mdes_token' ? '07' : nil
299
+ post[:token_eci] = options[:eci] || payment_method&.eci || (payment_method.brand.to_s == 'master' ? '00' : '07')
300
+ post[:token_crypto] = payment_method&.payment_cryptogram if payment_method.source.to_s == 'network_token'
301
+ end
302
+
252
303
  def add_stored_credential(post, options)
253
304
  add_transaction_type(post, options)
254
305
  # if :transaction_type option is not passed, then check for :stored_credential options
255
306
  return unless (stored_credential = options[:stored_credential]) && options.dig(:transaction_type).nil?
307
+
256
308
  if stored_credential[:initiator] == 'merchant'
257
309
  case stored_credential[:reason_type]
258
310
  when 'recurring'
259
- stored_credential[:initial_transaction] ? post[:a9] = '1' : post[:a9] = '2'
311
+ post[:a9] = stored_credential[:initial_transaction] ? '1' : '2'
260
312
  when 'installment', 'unscheduled'
261
313
  post[:a9] = '8'
262
314
  end
315
+ post[:g6] = stored_credential[:network_transaction_id] if stored_credential[:network_transaction_id]
263
316
  else
264
317
  post[:a9] = '9'
265
318
  end
@@ -268,12 +321,12 @@ module ActiveMerchant #:nodoc:
268
321
  def add_customer_data(post, options)
269
322
  post[:d1] = options[:ip] || '127.0.0.1'
270
323
  if (billing_address = options[:billing_address])
271
- post[:c5] = billing_address[:address1]
272
- post[:c7] = billing_address[:city]
273
- post[:c10] = billing_address[:zip]
274
- post[:c8] = billing_address[:state]
275
- post[:c9] = billing_address[:country]
276
- post[:c2] = billing_address[:phone]
324
+ post[:c5] = billing_address[:address1] if billing_address[:address1]
325
+ post[:c7] = billing_address[:city] if billing_address[:city]
326
+ post[:c10] = billing_address[:zip] if billing_address[:zip]
327
+ post[:c8] = billing_address[:state] if billing_address[:state]
328
+ post[:c9] = billing_address[:country] if billing_address[:country]
329
+ post[:c2] = billing_address[:phone] if billing_address[:phone]
277
330
  end
278
331
  end
279
332
 
@@ -289,42 +342,72 @@ module ActiveMerchant #:nodoc:
289
342
  post[:c3] = options[:email] || 'unspecified@example.com'
290
343
  end
291
344
 
345
+ def add_recipient(post, options)
346
+ return unless options[:recipient_street_address] || options[:recipient_city] || options[:recipient_province_code] || options[:recipient_country_code]
347
+
348
+ recipient_country_code = options[:recipient_country_code]&.length == 3 ? options[:recipient_country_code] : Country.find(options[:recipient_country_code]).code(:alpha3).value if options[:recipient_country_code]
349
+ post[:j6] = options[:recipient_street_address] if options[:recipient_street_address]
350
+ post[:j7] = options[:recipient_city] if options[:recipient_city]
351
+ post[:j8] = options[:recipient_province_code] if options[:recipient_province_code]
352
+ post[:j9] = recipient_country_code
353
+ end
354
+
355
+ def add_customer_name(post, options)
356
+ post[:j5] = options[:first_name] if options[:first_name]
357
+ post[:j13] = options[:last_name] if options[:last_name]
358
+ end
359
+
292
360
  def add_3d_secure(post, options)
293
- if options[:eci] && options[:xid]
361
+ if (options[:eci] && options[:xid]) || (options[:three_d_secure] && options[:three_d_secure][:version]&.start_with?('1'))
294
362
  add_3d_secure_1_data(post, options)
295
363
  elsif options[:execute_threed] && options[:three_ds_2]
296
364
  three_ds_2_options = options[:three_ds_2]
297
365
  browser_info = three_ds_2_options[:browser_info]
298
366
  post[:'3ds_initiate'] = options[:three_ds_initiate] || '01'
367
+ post[:f23] = options[:f23] if options[:f23]
299
368
  post[:'3ds_purchasedate'] = Time.now.utc.strftime('%Y%m%d%I%M%S')
300
369
  options.dig(:stored_credential, :initiator) == 'merchant' ? post[:'3ds_channel'] = '03' : post[:'3ds_channel'] = '02'
370
+ post[:'3ds_reqchallengeind'] = options[:three_ds_reqchallengeind] if options[:three_ds_reqchallengeind]
301
371
  post[:'3ds_redirect_url'] = three_ds_2_options[:notification_url]
302
372
  post[:'3ds_challengewindowsize'] = options[:three_ds_challenge_window_size] || '03'
303
- post[:'3ds_version'] = options[:three_ds_version] if options[:three_ds_version]
304
373
  post[:d5] = browser_info[:user_agent]
305
- post[:'3ds_transtype'] = options[:transaction_type] || '01'
374
+ post[:'3ds_transtype'] = options[:three_ds_transtype] || '01'
306
375
  post[:'3ds_browsertz'] = browser_info[:timezone]
307
376
  post[:'3ds_browserscreenwidth'] = browser_info[:width]
308
377
  post[:'3ds_browserscreenheight'] = browser_info[:height]
309
- post[:'3ds_browsercolordepth'] = browser_info[:depth]
378
+ post[:'3ds_browsercolordepth'] = browser_info[:depth].to_s == '30' ? '32' : browser_info[:depth]
310
379
  post[:d6] = browser_info[:language]
311
380
  post[:'3ds_browserjavaenabled'] = browser_info[:java]
312
381
  post[:'3ds_browseracceptheader'] = browser_info[:accept_header]
313
- if (shipping_address = options[:shipping_address])
314
- post[:'3ds_shipaddrstate'] = shipping_address[:state]
315
- post[:'3ds_shipaddrpostcode'] = shipping_address[:zip]
316
- post[:'3ds_shipaddrline2'] = shipping_address[:address2]
317
- post[:'3ds_shipaddrline1'] = shipping_address[:address1]
318
- post[:'3ds_shipaddrcountry'] = shipping_address[:country]
319
- post[:'3ds_shipaddrcity'] = shipping_address[:city]
320
- end
382
+ add_complete_shipping_address(post, options[:shipping_address]) if options[:shipping_address]
321
383
  elsif options[:three_d_secure]
322
384
  add_normalized_3d_secure_2_data(post, options)
323
385
  end
324
386
  end
325
387
 
326
388
  def add_3d_secure_1_data(post, options)
327
- post[:i8] = build_i8(options[:eci], options[:cavv], options[:xid])
389
+ if three_d_secure_options = options[:three_d_secure]
390
+ post[:i8] = build_i8(
391
+ three_d_secure_options[:eci],
392
+ three_d_secure_options[:cavv],
393
+ three_d_secure_options[:xid]
394
+ )
395
+ post[:'3ds_version'] = three_d_secure_options[:version]&.start_with?('1') ? '1.0' : three_d_secure_options[:version]
396
+ else
397
+ post[:i8] = build_i8(options[:eci], options[:cavv], options[:xid])
398
+ post[:'3ds_version'] = options[:three_ds_version].nil? || options[:three_ds_version]&.start_with?('1') ? '1.0' : options[:three_ds_version]
399
+ end
400
+ end
401
+
402
+ def add_complete_shipping_address(post, shipping_address)
403
+ return if shipping_address.values.any?(&:blank?)
404
+
405
+ post[:'3ds_shipaddrstate'] = shipping_address[:state]
406
+ post[:'3ds_shipaddrpostcode'] = shipping_address[:zip]
407
+ post[:'3ds_shipaddrline2'] = shipping_address[:address2]
408
+ post[:'3ds_shipaddrline1'] = shipping_address[:address1]
409
+ post[:'3ds_shipaddrcountry'] = shipping_address[:country]
410
+ post[:'3ds_shipaddrcity'] = shipping_address[:city]
328
411
  end
329
412
 
330
413
  def add_normalized_3d_secure_2_data(post, options)
@@ -334,11 +417,11 @@ module ActiveMerchant #:nodoc:
334
417
  three_d_secure_options[:eci],
335
418
  three_d_secure_options[:cavv]
336
419
  )
337
- post[:'3ds_version'] = three_d_secure_options[:version]
420
+ post[:'3ds_version'] = three_d_secure_options[:version]&.start_with?('2') ? '2.0' : three_d_secure_options[:version]
338
421
  post[:'3ds_dstrxid'] = three_d_secure_options[:ds_transaction_id]
339
422
  end
340
423
 
341
- def build_i8(eci, cavv=nil, xid=nil)
424
+ def build_i8(eci, cavv = nil, xid = nil)
342
425
  "#{eci}:#{cavv || 'none'}:#{xid || 'none'}"
343
426
  end
344
427
 
@@ -358,21 +441,27 @@ module ActiveMerchant #:nodoc:
358
441
  end
359
442
 
360
443
  def add_processor(post, options)
361
- post[:r1] = options[:processor] || 'CREDORAX'
444
+ post[:r1] = options[:processor] if options[:processor]
362
445
  post[:r2] = options[:processor_merchant_id] if options[:processor_merchant_id]
363
446
  end
364
447
 
448
+ def add_authorization_details(post, options)
449
+ post[:a10] = options[:authorization_type] if options[:authorization_type]
450
+ post[:a11] = options[:multiple_capture_count] if options[:multiple_capture_count]
451
+ end
452
+
365
453
  ACTIONS = {
366
454
  purchase: '1',
367
455
  authorize: '2',
368
456
  capture: '3',
369
457
  authorize_void: '4',
370
458
  refund: '5',
371
- credit: '6',
459
+ credit: '35',
372
460
  purchase_void: '7',
373
461
  refund_void: '8',
374
462
  capture_void: '9',
375
- threeds_completion: '92'
463
+ threeds_completion: '92',
464
+ referral_cft: '34'
376
465
  }
377
466
 
378
467
  def commit(action, params, reference_action = nil)
@@ -383,7 +472,7 @@ module ActiveMerchant #:nodoc:
383
472
  success_from(response),
384
473
  message_from(response),
385
474
  response,
386
- authorization: "#{response["Z1"]};#{response["Z4"]};#{response["A1"]};#{action}",
475
+ authorization: "#{response['Z1']};#{response['Z4']};#{response['A1']};#{action}",
387
476
  avs_result: AVSResult.new(code: response['Z9']),
388
477
  cvv_result: CVVResult.new(response['Z14']),
389
478
  test: test?
@@ -392,8 +481,10 @@ module ActiveMerchant #:nodoc:
392
481
 
393
482
  def sign_request(params)
394
483
  params = params.sort
395
- params.each { |param| param[1].gsub!(/[<>()\\]/, ' ') }
396
- values = params.map { |param| param[1].strip }
484
+ values = params.map do |param|
485
+ value = param[1].gsub(/[<>()\\]/, ' ')
486
+ value.strip
487
+ end
397
488
  Digest::MD5.hexdigest(values.join + @options[:cipher_key])
398
489
  end
399
490
 
@@ -406,11 +497,9 @@ module ActiveMerchant #:nodoc:
406
497
  end
407
498
 
408
499
  def request_action(action, reference_action)
409
- if reference_action
410
- ACTIONS["#{reference_action}_#{action}".to_sym]
411
- else
412
- ACTIONS[action]
413
- end
500
+ return ACTIONS["#{reference_action}_#{action}".to_sym] if reference_action
501
+
502
+ ACTIONS[action]
414
503
  end
415
504
 
416
505
  def url