activemerchant 1.105.0 → 1.107.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (173) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +99 -1
  3. data/README.md +2 -2
  4. data/lib/active_merchant/billing/credit_card_methods.rb +12 -3
  5. data/lib/active_merchant/billing/gateway.rb +22 -22
  6. data/lib/active_merchant/billing/gateways/adyen.rb +18 -7
  7. data/lib/active_merchant/billing/gateways/allied_wallet.rb +2 -2
  8. data/lib/active_merchant/billing/gateways/authorize_net.rb +19 -19
  9. data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +11 -11
  10. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +35 -35
  11. data/lib/active_merchant/billing/gateways/axcessms.rb +3 -3
  12. data/lib/active_merchant/billing/gateways/bambora_apac.rb +1 -1
  13. data/lib/active_merchant/billing/gateways/bank_frick.rb +1 -1
  14. data/lib/active_merchant/billing/gateways/banwire.rb +2 -2
  15. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +5 -5
  16. data/lib/active_merchant/billing/gateways/be2bill.rb +4 -4
  17. data/lib/active_merchant/billing/gateways/beanstream.rb +1 -1
  18. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +27 -27
  19. data/lib/active_merchant/billing/gateways/beanstream_interac.rb +1 -1
  20. data/lib/active_merchant/billing/gateways/blue_pay.rb +8 -8
  21. data/lib/active_merchant/billing/gateways/blue_snap.rb +5 -2
  22. data/lib/active_merchant/billing/gateways/bogus.rb +20 -20
  23. data/lib/active_merchant/billing/gateways/borgun.rb +17 -6
  24. data/lib/active_merchant/billing/gateways/bpoint.rb +1 -1
  25. data/lib/active_merchant/billing/gateways/braintree_blue.rb +81 -77
  26. data/lib/active_merchant/billing/gateways/bridge_pay.rb +3 -3
  27. data/lib/active_merchant/billing/gateways/card_connect.rb +1 -1
  28. data/lib/active_merchant/billing/gateways/card_stream.rb +19 -19
  29. data/lib/active_merchant/billing/gateways/cc5.rb +7 -7
  30. data/lib/active_merchant/billing/gateways/cecabank.rb +3 -3
  31. data/lib/active_merchant/billing/gateways/cenpos.rb +3 -3
  32. data/lib/active_merchant/billing/gateways/checkout_v2.rb +20 -9
  33. data/lib/active_merchant/billing/gateways/clearhaus.rb +1 -1
  34. data/lib/active_merchant/billing/gateways/commercegate.rb +2 -2
  35. data/lib/active_merchant/billing/gateways/conekta.rb +1 -1
  36. data/lib/active_merchant/billing/gateways/creditcall.rb +4 -4
  37. data/lib/active_merchant/billing/gateways/ct_payment.rb +1 -1
  38. data/lib/active_merchant/billing/gateways/culqi.rb +2 -2
  39. data/lib/active_merchant/billing/gateways/cyber_source.rb +154 -91
  40. data/lib/active_merchant/billing/gateways/d_local.rb +4 -2
  41. data/lib/active_merchant/billing/gateways/data_cash.rb +33 -33
  42. data/lib/active_merchant/billing/gateways/decidir.rb +7 -2
  43. data/lib/active_merchant/billing/gateways/ebanx.rb +14 -2
  44. data/lib/active_merchant/billing/gateways/efsnet.rb +23 -23
  45. data/lib/active_merchant/billing/gateways/elavon.rb +70 -18
  46. data/lib/active_merchant/billing/gateways/element.rb +12 -4
  47. data/lib/active_merchant/billing/gateways/epay.rb +40 -40
  48. data/lib/active_merchant/billing/gateways/evo_ca.rb +11 -11
  49. data/lib/active_merchant/billing/gateways/eway.rb +3 -3
  50. data/lib/active_merchant/billing/gateways/eway_managed.rb +40 -40
  51. data/lib/active_merchant/billing/gateways/eway_rapid.rb +7 -7
  52. data/lib/active_merchant/billing/gateways/exact.rb +11 -11
  53. data/lib/active_merchant/billing/gateways/fat_zebra.rb +3 -2
  54. data/lib/active_merchant/billing/gateways/federated_canada.rb +5 -5
  55. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +21 -21
  56. data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +20 -20
  57. data/lib/active_merchant/billing/gateways/flo2cash.rb +4 -4
  58. data/lib/active_merchant/billing/gateways/forte.rb +8 -7
  59. data/lib/active_merchant/billing/gateways/garanti.rb +8 -8
  60. data/lib/active_merchant/billing/gateways/global_collect.rb +30 -24
  61. data/lib/active_merchant/billing/gateways/hdfc.rb +3 -3
  62. data/lib/active_merchant/billing/gateways/hps.rb +5 -3
  63. data/lib/active_merchant/billing/gateways/iats_payments.rb +32 -15
  64. data/lib/active_merchant/billing/gateways/inspire.rb +7 -7
  65. data/lib/active_merchant/billing/gateways/instapay.rb +3 -3
  66. data/lib/active_merchant/billing/gateways/ipp.rb +1 -1
  67. data/lib/active_merchant/billing/gateways/iridium.rb +12 -10
  68. data/lib/active_merchant/billing/gateways/itransact.rb +7 -7
  69. data/lib/active_merchant/billing/gateways/iveri.rb +6 -3
  70. data/lib/active_merchant/billing/gateways/ixopay.rb +22 -0
  71. data/lib/active_merchant/billing/gateways/jetpay.rb +4 -4
  72. data/lib/active_merchant/billing/gateways/jetpay_v2.rb +5 -5
  73. data/lib/active_merchant/billing/gateways/kushki.rb +34 -5
  74. data/lib/active_merchant/billing/gateways/latitude19.rb +2 -2
  75. data/lib/active_merchant/billing/gateways/linkpoint.rb +62 -62
  76. data/lib/active_merchant/billing/gateways/litle.rb +8 -3
  77. data/lib/active_merchant/billing/gateways/mastercard.rb +2 -2
  78. data/lib/active_merchant/billing/gateways/mercado_pago.rb +1 -0
  79. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +5 -5
  80. data/lib/active_merchant/billing/gateways/merchant_one.rb +2 -2
  81. data/lib/active_merchant/billing/gateways/merchant_partners.rb +4 -4
  82. data/lib/active_merchant/billing/gateways/merchant_ware.rb +12 -12
  83. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +11 -11
  84. data/lib/active_merchant/billing/gateways/merchant_warrior.rb +12 -2
  85. data/lib/active_merchant/billing/gateways/mercury.rb +9 -9
  86. data/lib/active_merchant/billing/gateways/metrics_global.rb +15 -15
  87. data/lib/active_merchant/billing/gateways/migs.rb +13 -13
  88. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +7 -7
  89. data/lib/active_merchant/billing/gateways/monei.rb +19 -19
  90. data/lib/active_merchant/billing/gateways/moneris.rb +10 -10
  91. data/lib/active_merchant/billing/gateways/money_movers.rb +5 -5
  92. data/lib/active_merchant/billing/gateways/mundipagg.rb +1 -1
  93. data/lib/active_merchant/billing/gateways/nab_transact.rb +15 -15
  94. data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +1 -1
  95. data/lib/active_merchant/billing/gateways/net_registry.rb +6 -6
  96. data/lib/active_merchant/billing/gateways/netaxept.rb +4 -4
  97. data/lib/active_merchant/billing/gateways/netbanx.rb +14 -14
  98. data/lib/active_merchant/billing/gateways/netbilling.rb +12 -12
  99. data/lib/active_merchant/billing/gateways/netpay.rb +2 -2
  100. data/lib/active_merchant/billing/gateways/network_merchants.rb +5 -5
  101. data/lib/active_merchant/billing/gateways/ogone.rb +7 -7
  102. data/lib/active_merchant/billing/gateways/openpay.rb +2 -2
  103. data/lib/active_merchant/billing/gateways/opp.rb +13 -7
  104. data/lib/active_merchant/billing/gateways/optimal_payment.rb +13 -9
  105. data/lib/active_merchant/billing/gateways/orbital.rb +54 -12
  106. data/lib/active_merchant/billing/gateways/pac_net_raven.rb +7 -7
  107. data/lib/active_merchant/billing/gateways/pay_conex.rb +2 -2
  108. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +16 -16
  109. data/lib/active_merchant/billing/gateways/pay_junction.rb +16 -16
  110. data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +18 -2
  111. data/lib/active_merchant/billing/gateways/pay_secure.rb +6 -6
  112. data/lib/active_merchant/billing/gateways/paybox_direct.rb +36 -36
  113. data/lib/active_merchant/billing/gateways/payflow.rb +7 -7
  114. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +12 -12
  115. data/lib/active_merchant/billing/gateways/payflow_express.rb +4 -4
  116. data/lib/active_merchant/billing/gateways/payment_express.rb +9 -9
  117. data/lib/active_merchant/billing/gateways/paymill.rb +3 -3
  118. data/lib/active_merchant/billing/gateways/paypal.rb +1 -1
  119. data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +5 -5
  120. data/lib/active_merchant/billing/gateways/paypal_express_common.rb +1 -1
  121. data/lib/active_merchant/billing/gateways/payscout.rb +5 -5
  122. data/lib/active_merchant/billing/gateways/paystation.rb +2 -2
  123. data/lib/active_merchant/billing/gateways/payu_latam.rb +3 -3
  124. data/lib/active_merchant/billing/gateways/payway.rb +12 -12
  125. data/lib/active_merchant/billing/gateways/pin.rb +16 -16
  126. data/lib/active_merchant/billing/gateways/plugnpay.rb +10 -10
  127. data/lib/active_merchant/billing/gateways/psigate.rb +26 -26
  128. data/lib/active_merchant/billing/gateways/psl_card.rb +4 -4
  129. data/lib/active_merchant/billing/gateways/qbms.rb +23 -23
  130. data/lib/active_merchant/billing/gateways/quantum.rb +4 -4
  131. data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +95 -95
  132. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +9 -9
  133. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +2 -2
  134. data/lib/active_merchant/billing/gateways/qvalent.rb +1 -1
  135. data/lib/active_merchant/billing/gateways/realex.rb +17 -10
  136. data/lib/active_merchant/billing/gateways/redsys.rb +24 -16
  137. data/lib/active_merchant/billing/gateways/safe_charge.rb +1 -1
  138. data/lib/active_merchant/billing/gateways/sage.rb +10 -10
  139. data/lib/active_merchant/billing/gateways/sage_pay.rb +35 -35
  140. data/lib/active_merchant/billing/gateways/sallie_mae.rb +2 -2
  141. data/lib/active_merchant/billing/gateways/secure_net.rb +9 -9
  142. data/lib/active_merchant/billing/gateways/secure_pay.rb +13 -13
  143. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +16 -16
  144. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +2 -2
  145. data/lib/active_merchant/billing/gateways/skip_jack.rb +8 -8
  146. data/lib/active_merchant/billing/gateways/smart_ps.rb +16 -16
  147. data/lib/active_merchant/billing/gateways/so_easy_pay.rb +6 -6
  148. data/lib/active_merchant/billing/gateways/spreedly_core.rb +4 -4
  149. data/lib/active_merchant/billing/gateways/stripe.rb +15 -10
  150. data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +50 -9
  151. data/lib/active_merchant/billing/gateways/swipe_checkout.rb +2 -2
  152. data/lib/active_merchant/billing/gateways/trans_first.rb +4 -4
  153. data/lib/active_merchant/billing/gateways/trust_commerce.rb +19 -19
  154. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +110 -110
  155. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +29 -29
  156. data/lib/active_merchant/billing/gateways/verifi.rb +10 -10
  157. data/lib/active_merchant/billing/gateways/viaklix.rb +6 -6
  158. data/lib/active_merchant/billing/gateways/visanet_peru.rb +6 -6
  159. data/lib/active_merchant/billing/gateways/webpay.rb +2 -2
  160. data/lib/active_merchant/billing/gateways/wirecard.rb +6 -6
  161. data/lib/active_merchant/billing/gateways/worldpay.rb +22 -20
  162. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +32 -32
  163. data/lib/active_merchant/billing/gateways/worldpay_us.rb +2 -2
  164. data/lib/active_merchant/billing/network_tokenization_credit_card.rb +1 -1
  165. data/lib/active_merchant/connection.rb +1 -1
  166. data/lib/active_merchant/network_connection_retries.rb +3 -3
  167. data/lib/active_merchant/post_data.rb +1 -1
  168. data/lib/active_merchant/version.rb +1 -1
  169. data/lib/certs/cacert.pem +75 -0
  170. data/lib/support/ssl_verify.rb +2 -2
  171. data/lib/support/ssl_version.rb +2 -2
  172. metadata +4 -4
  173. data/lib/active_merchant/billing/gateways/moneris_us.rb +0 -352
@@ -216,10 +216,10 @@ module ActiveMerchant #:nodoc:
216
216
  end
217
217
 
218
218
  Response.new(success, message, response,
219
- :test => test?,
220
- :authorization => authorization,
221
- :avs_result => { :code => response[:AVSResponseCode] },
222
- :cvv_result => response[:CVV2ResponseCode]
219
+ test: test?,
220
+ authorization: authorization,
221
+ avs_result: { code: response[:AVSResponseCode] },
222
+ cvv_result: response[:CVV2ResponseCode]
223
223
  )
224
224
  end
225
225
 
@@ -1,151 +1,151 @@
1
1
  module QuickpayCommon
2
2
  MD5_CHECK_FIELDS = {
3
3
  3 => {
4
- :authorize => %w(protocol msgtype merchant ordernumber amount
5
- currency autocapture cardnumber expirationdate
6
- cvd cardtypelock testmode),
4
+ authorize: %w(protocol msgtype merchant ordernumber amount
5
+ currency autocapture cardnumber expirationdate
6
+ cvd cardtypelock testmode),
7
7
 
8
- :capture => %w(protocol msgtype merchant amount finalize transaction),
8
+ capture: %w(protocol msgtype merchant amount finalize transaction),
9
9
 
10
- :cancel => %w(protocol msgtype merchant transaction),
10
+ cancel: %w(protocol msgtype merchant transaction),
11
11
 
12
- :refund => %w(protocol msgtype merchant amount transaction),
12
+ refund: %w(protocol msgtype merchant amount transaction),
13
13
 
14
- :subscribe => %w(protocol msgtype merchant ordernumber cardnumber
15
- expirationdate cvd cardtypelock description testmode),
14
+ subscribe: %w(protocol msgtype merchant ordernumber cardnumber
15
+ expirationdate cvd cardtypelock description testmode),
16
16
 
17
- :recurring => %w(protocol msgtype merchant ordernumber amount
18
- currency autocapture transaction),
17
+ recurring: %w(protocol msgtype merchant ordernumber amount
18
+ currency autocapture transaction),
19
19
 
20
- :status => %w(protocol msgtype merchant transaction),
20
+ status: %w(protocol msgtype merchant transaction),
21
21
 
22
- :chstatus => %w(protocol msgtype merchant)
22
+ chstatus: %w(protocol msgtype merchant)
23
23
  },
24
24
 
25
25
  4 => {
26
- :authorize => %w(protocol msgtype merchant ordernumber amount
27
- currency autocapture cardnumber expirationdate cvd
28
- cardtypelock testmode fraud_remote_addr
29
- fraud_http_accept fraud_http_accept_language
30
- fraud_http_accept_encoding fraud_http_accept_charset
31
- fraud_http_referer fraud_http_user_agent apikey),
26
+ authorize: %w(protocol msgtype merchant ordernumber amount
27
+ currency autocapture cardnumber expirationdate cvd
28
+ cardtypelock testmode fraud_remote_addr
29
+ fraud_http_accept fraud_http_accept_language
30
+ fraud_http_accept_encoding fraud_http_accept_charset
31
+ fraud_http_referer fraud_http_user_agent apikey),
32
32
 
33
- :capture => %w(protocol msgtype merchant amount finalize transaction apikey),
33
+ capture: %w(protocol msgtype merchant amount finalize transaction apikey),
34
34
 
35
- :cancel => %w(protocol msgtype merchant transaction apikey),
35
+ cancel: %w(protocol msgtype merchant transaction apikey),
36
36
 
37
- :refund => %w(protocol msgtype merchant amount transaction apikey),
37
+ refund: %w(protocol msgtype merchant amount transaction apikey),
38
38
 
39
- :subscribe => %w(protocol msgtype merchant ordernumber cardnumber
40
- expirationdate cvd cardtypelock description testmode
41
- fraud_remote_addr fraud_http_accept fraud_http_accept_language
42
- fraud_http_accept_encoding fraud_http_accept_charset
43
- fraud_http_referer fraud_http_user_agent apikey),
39
+ subscribe: %w(protocol msgtype merchant ordernumber cardnumber
40
+ expirationdate cvd cardtypelock description testmode
41
+ fraud_remote_addr fraud_http_accept fraud_http_accept_language
42
+ fraud_http_accept_encoding fraud_http_accept_charset
43
+ fraud_http_referer fraud_http_user_agent apikey),
44
44
 
45
- :recurring => %w(protocol msgtype merchant ordernumber amount currency
46
- autocapture transaction apikey),
45
+ recurring: %w(protocol msgtype merchant ordernumber amount currency
46
+ autocapture transaction apikey),
47
47
 
48
- :status => %w(protocol msgtype merchant transaction apikey),
48
+ status: %w(protocol msgtype merchant transaction apikey),
49
49
 
50
- :chstatus => %w(protocol msgtype merchant apikey)
50
+ chstatus: %w(protocol msgtype merchant apikey)
51
51
  },
52
52
 
53
53
  5 => {
54
- :authorize => %w(protocol msgtype merchant ordernumber amount
55
- currency autocapture cardnumber expirationdate cvd
56
- cardtypelock testmode fraud_remote_addr
57
- fraud_http_accept fraud_http_accept_language
58
- fraud_http_accept_encoding fraud_http_accept_charset
59
- fraud_http_referer fraud_http_user_agent apikey),
54
+ authorize: %w(protocol msgtype merchant ordernumber amount
55
+ currency autocapture cardnumber expirationdate cvd
56
+ cardtypelock testmode fraud_remote_addr
57
+ fraud_http_accept fraud_http_accept_language
58
+ fraud_http_accept_encoding fraud_http_accept_charset
59
+ fraud_http_referer fraud_http_user_agent apikey),
60
60
 
61
- :capture => %w(protocol msgtype merchant amount finalize transaction apikey),
61
+ capture: %w(protocol msgtype merchant amount finalize transaction apikey),
62
62
 
63
- :cancel => %w(protocol msgtype merchant transaction apikey),
63
+ cancel: %w(protocol msgtype merchant transaction apikey),
64
64
 
65
- :refund => %w(protocol msgtype merchant amount transaction apikey),
65
+ refund: %w(protocol msgtype merchant amount transaction apikey),
66
66
 
67
- :subscribe => %w(protocol msgtype merchant ordernumber cardnumber
68
- expirationdate cvd cardtypelock description testmode
69
- fraud_remote_addr fraud_http_accept fraud_http_accept_language
70
- fraud_http_accept_encoding fraud_http_accept_charset
71
- fraud_http_referer fraud_http_user_agent apikey),
67
+ subscribe: %w(protocol msgtype merchant ordernumber cardnumber
68
+ expirationdate cvd cardtypelock description testmode
69
+ fraud_remote_addr fraud_http_accept fraud_http_accept_language
70
+ fraud_http_accept_encoding fraud_http_accept_charset
71
+ fraud_http_referer fraud_http_user_agent apikey),
72
72
 
73
- :recurring => %w(protocol msgtype merchant ordernumber amount currency
74
- autocapture transaction apikey),
73
+ recurring: %w(protocol msgtype merchant ordernumber amount currency
74
+ autocapture transaction apikey),
75
75
 
76
- :status => %w(protocol msgtype merchant transaction apikey),
76
+ status: %w(protocol msgtype merchant transaction apikey),
77
77
 
78
- :chstatus => %w(protocol msgtype merchant apikey)
78
+ chstatus: %w(protocol msgtype merchant apikey)
79
79
  },
80
80
 
81
81
  6 => {
82
- :authorize => %w(protocol msgtype merchant ordernumber amount
83
- currency autocapture cardnumber expirationdate cvd
84
- cardtypelock testmode fraud_remote_addr
85
- fraud_http_accept fraud_http_accept_language
86
- fraud_http_accept_encoding fraud_http_accept_charset
87
- fraud_http_referer fraud_http_user_agent apikey),
82
+ authorize: %w(protocol msgtype merchant ordernumber amount
83
+ currency autocapture cardnumber expirationdate cvd
84
+ cardtypelock testmode fraud_remote_addr
85
+ fraud_http_accept fraud_http_accept_language
86
+ fraud_http_accept_encoding fraud_http_accept_charset
87
+ fraud_http_referer fraud_http_user_agent apikey),
88
88
 
89
- :capture => %w(protocol msgtype merchant amount finalize transaction
90
- apikey),
89
+ capture: %w(protocol msgtype merchant amount finalize transaction
90
+ apikey),
91
91
 
92
- :cancel => %w(protocol msgtype merchant transaction apikey),
92
+ cancel: %w(protocol msgtype merchant transaction apikey),
93
93
 
94
- :refund => %w(protocol msgtype merchant amount transaction apikey),
94
+ refund: %w(protocol msgtype merchant amount transaction apikey),
95
95
 
96
- :subscribe => %w(protocol msgtype merchant ordernumber cardnumber
97
- expirationdate cvd cardtypelock description testmode
98
- fraud_remote_addr fraud_http_accept fraud_http_accept_language
99
- fraud_http_accept_encoding fraud_http_accept_charset
100
- fraud_http_referer fraud_http_user_agent apikey),
96
+ subscribe: %w(protocol msgtype merchant ordernumber cardnumber
97
+ expirationdate cvd cardtypelock description testmode
98
+ fraud_remote_addr fraud_http_accept fraud_http_accept_language
99
+ fraud_http_accept_encoding fraud_http_accept_charset
100
+ fraud_http_referer fraud_http_user_agent apikey),
101
101
 
102
- :recurring => %w(protocol msgtype merchant ordernumber amount currency
103
- autocapture transaction apikey),
102
+ recurring: %w(protocol msgtype merchant ordernumber amount currency
103
+ autocapture transaction apikey),
104
104
 
105
- :status => %w(protocol msgtype merchant transaction apikey),
105
+ status: %w(protocol msgtype merchant transaction apikey),
106
106
 
107
- :chstatus => %w(protocol msgtype merchant apikey)
107
+ chstatus: %w(protocol msgtype merchant apikey)
108
108
  },
109
109
 
110
110
  7 => {
111
- :authorize => %w(protocol msgtype merchant ordernumber amount
112
- currency autocapture cardnumber expirationdate cvd
113
- acquirers cardtypelock testmode fraud_remote_addr
114
- fraud_http_accept fraud_http_accept_language
115
- fraud_http_accept_encoding fraud_http_accept_charset
116
- fraud_http_referer fraud_http_user_agent apikey),
111
+ authorize: %w(protocol msgtype merchant ordernumber amount
112
+ currency autocapture cardnumber expirationdate cvd
113
+ acquirers cardtypelock testmode fraud_remote_addr
114
+ fraud_http_accept fraud_http_accept_language
115
+ fraud_http_accept_encoding fraud_http_accept_charset
116
+ fraud_http_referer fraud_http_user_agent apikey),
117
117
 
118
- :capture => %w(protocol msgtype merchant amount finalize transaction
119
- apikey),
118
+ capture: %w(protocol msgtype merchant amount finalize transaction
119
+ apikey),
120
120
 
121
- :cancel => %w(protocol msgtype merchant transaction apikey),
121
+ cancel: %w(protocol msgtype merchant transaction apikey),
122
122
 
123
- :refund => %w(protocol msgtype merchant amount transaction apikey),
123
+ refund: %w(protocol msgtype merchant amount transaction apikey),
124
124
 
125
- :subscribe => %w(protocol msgtype merchant ordernumber amount currency
126
- cardnumber expirationdate cvd acquirers cardtypelock
127
- description testmode fraud_remote_addr fraud_http_accept
128
- fraud_http_accept_language fraud_http_accept_encoding
129
- fraud_http_accept_charset fraud_http_referer
130
- fraud_http_user_agent apikey),
125
+ subscribe: %w(protocol msgtype merchant ordernumber amount currency
126
+ cardnumber expirationdate cvd acquirers cardtypelock
127
+ description testmode fraud_remote_addr fraud_http_accept
128
+ fraud_http_accept_language fraud_http_accept_encoding
129
+ fraud_http_accept_charset fraud_http_referer
130
+ fraud_http_user_agent apikey),
131
131
 
132
- :recurring => %w(protocol msgtype merchant ordernumber amount currency
133
- autocapture transaction apikey),
132
+ recurring: %w(protocol msgtype merchant ordernumber amount currency
133
+ autocapture transaction apikey),
134
134
 
135
- :status => %w(protocol msgtype merchant transaction apikey),
135
+ status: %w(protocol msgtype merchant transaction apikey),
136
136
 
137
- :chstatus => %w(protocol msgtype merchant apikey)
137
+ chstatus: %w(protocol msgtype merchant apikey)
138
138
  },
139
139
 
140
140
  10 => {
141
- :authorize => %w(mobile_number acquirer autofee customer_id extras
142
- zero_auth customer_ip),
143
- :capture => %w(extras),
144
- :cancel => %w(extras),
145
- :refund => %w(extras),
146
- :subscribe => %w(variables branding_id),
147
- :authorize_subscription => %w(mobile_number acquirer customer_ip),
148
- :recurring => %w(auto_capture autofee zero_auth)
141
+ authorize: %w(mobile_number acquirer autofee customer_id extras
142
+ zero_auth customer_ip),
143
+ capture: %w(extras),
144
+ cancel: %w(extras),
145
+ refund: %w(extras),
146
+ subscribe: %w(variables branding_id),
147
+ authorize_subscription: %w(mobile_number acquirer customer_ip),
148
+ recurring: %w(auto_capture autofee zero_auth)
149
149
  }
150
150
  }
151
151
 
@@ -154,8 +154,8 @@ module ActiveMerchant
154
154
  end
155
155
 
156
156
  Response.new(success, message_from(success, response), response,
157
- :test => test?,
158
- :authorization => authorization_from(response)
157
+ test: test?,
158
+ authorization: authorization_from(response)
159
159
  )
160
160
  end
161
161
 
@@ -215,7 +215,7 @@ module ActiveMerchant
215
215
  end
216
216
 
217
217
  if options[:three_d_secure]
218
- post[:card][:cavv]= options.dig(:three_d_secure, :cavv)
218
+ post[:card][:cavv] = options.dig(:three_d_secure, :cavv)
219
219
  post[:card][:eci] = options.dig(:three_d_secure, :eci)
220
220
  post[:card][:xav] = options.dig(:three_d_secure, :xid)
221
221
  end
@@ -253,12 +253,12 @@ module ActiveMerchant
253
253
  requires!(address, :name, :address1, :city, :zip, :country)
254
254
  country = Country.find(address[:country])
255
255
  mapped = {
256
- :name => address[:name],
257
- :street => address[:address1],
258
- :city => address[:city],
259
- :region => address[:address2],
260
- :zip_code => address[:zip],
261
- :country_code => country.code(:alpha3).value
256
+ name: address[:name],
257
+ street: address[:address1],
258
+ city: address[:city],
259
+ region: address[:address2],
260
+ zip_code: address[:zip],
261
+ country_code: country.code(:alpha3).value
262
262
  }
263
263
  mapped
264
264
  end
@@ -165,8 +165,8 @@ module ActiveMerchant #:nodoc:
165
165
  response = parse(ssl_post(self.live_url, post_data(action, params)))
166
166
 
167
167
  Response.new(successful?(response), message_from(response), response,
168
- :test => test?,
169
- :authorization => response[:transaction]
168
+ test: test?,
169
+ authorization: response[:transaction]
170
170
  )
171
171
  end
172
172
 
@@ -230,7 +230,7 @@ module ActiveMerchant #:nodoc:
230
230
 
231
231
  def headers
232
232
  {
233
- 'Content-Type' => 'application/x-www-form-urlencoded'
233
+ 'Content-Type' => 'application/x-www-form-urlencoded'
234
234
  }
235
235
  end
236
236
 
@@ -107,8 +107,8 @@ module ActiveMerchant
107
107
  (response[:result] == '00'),
108
108
  message_from(response),
109
109
  response,
110
- :test => (response[:message] =~ %r{\[ test system \]}),
111
- :authorization => authorization_from(response),
110
+ test: (response[:message] =~ %r{\[ test system \]}),
111
+ authorization: authorization_from(response),
112
112
  avs_result: AVSResult.new(code: response[:avspostcoderesponse]),
113
113
  cvv_result: CVVResult.new(response[:cvnresult])
114
114
  )
@@ -138,7 +138,7 @@ module ActiveMerchant
138
138
 
139
139
  def build_purchase_or_authorization_request(action, money, credit_card, options)
140
140
  timestamp = new_timestamp
141
- xml = Builder::XmlMarkup.new :indent => 2
141
+ xml = Builder::XmlMarkup.new indent: 2
142
142
  xml.tag! 'request', 'timestamp' => timestamp, 'type' => 'auth' do
143
143
  add_merchant_details(xml, options)
144
144
  xml.tag! 'orderid', sanitize_order_id(options[:order_id])
@@ -159,7 +159,7 @@ module ActiveMerchant
159
159
 
160
160
  def build_capture_request(money, authorization, options)
161
161
  timestamp = new_timestamp
162
- xml = Builder::XmlMarkup.new :indent => 2
162
+ xml = Builder::XmlMarkup.new indent: 2
163
163
  xml.tag! 'request', 'timestamp' => timestamp, 'type' => 'settle' do
164
164
  add_merchant_details(xml, options)
165
165
  add_amount(xml, money, options)
@@ -172,7 +172,7 @@ module ActiveMerchant
172
172
 
173
173
  def build_refund_request(money, authorization, options)
174
174
  timestamp = new_timestamp
175
- xml = Builder::XmlMarkup.new :indent => 2
175
+ xml = Builder::XmlMarkup.new indent: 2
176
176
  xml.tag! 'request', 'timestamp' => timestamp, 'type' => 'rebate' do
177
177
  add_merchant_details(xml, options)
178
178
  add_transaction_identifiers(xml, authorization, options)
@@ -187,7 +187,7 @@ module ActiveMerchant
187
187
 
188
188
  def build_credit_request(money, credit_card, options)
189
189
  timestamp = new_timestamp
190
- xml = Builder::XmlMarkup.new :indent => 2
190
+ xml = Builder::XmlMarkup.new indent: 2
191
191
  xml.tag! 'request', 'timestamp' => timestamp, 'type' => 'credit' do
192
192
  add_merchant_details(xml, options)
193
193
  xml.tag! 'orderid', sanitize_order_id(options[:order_id])
@@ -203,7 +203,7 @@ module ActiveMerchant
203
203
 
204
204
  def build_void_request(authorization, options)
205
205
  timestamp = new_timestamp
206
- xml = Builder::XmlMarkup.new :indent => 2
206
+ xml = Builder::XmlMarkup.new indent: 2
207
207
  xml.tag! 'request', 'timestamp' => timestamp, 'type' => 'void' do
208
208
  add_merchant_details(xml, options)
209
209
  add_transaction_identifiers(xml, authorization, options)
@@ -216,7 +216,7 @@ module ActiveMerchant
216
216
  # Verify initiates an OTB (Open To Buy) request
217
217
  def build_verify_request(credit_card, options)
218
218
  timestamp = new_timestamp
219
- xml = Builder::XmlMarkup.new :indent => 2
219
+ xml = Builder::XmlMarkup.new indent: 2
220
220
  xml.tag! 'request', 'timestamp' => timestamp, 'type' => 'otb' do
221
221
  add_merchant_details(xml, options)
222
222
  xml.tag! 'orderid', sanitize_order_id(options[:order_id])
@@ -230,13 +230,14 @@ module ActiveMerchant
230
230
  def add_address_and_customer_info(xml, options)
231
231
  billing_address = options[:billing_address] || options[:address]
232
232
  shipping_address = options[:shipping_address]
233
+ ipv4_address = ipv4?(options[:ip]) ? options[:ip] : nil
233
234
 
234
- return unless billing_address || shipping_address || options[:customer] || options[:invoice] || options[:ip]
235
+ return unless billing_address || shipping_address || options[:customer] || options[:invoice] || ipv4_address
235
236
 
236
237
  xml.tag! 'tssinfo' do
237
238
  xml.tag! 'custnum', options[:customer] if options[:customer]
238
239
  xml.tag! 'prodid', options[:invoice] if options[:invoice]
239
- xml.tag! 'custipaddress', options[:ip] if options[:ip]
240
+ xml.tag! 'custipaddress', options[:ip] if ipv4_address
240
241
 
241
242
  if billing_address
242
243
  xml.tag! 'address', 'type' => 'billing' do
@@ -369,6 +370,12 @@ module ActiveMerchant
369
370
  def sanitize_order_id(order_id)
370
371
  order_id.to_s.gsub(/[^a-zA-Z0-9\-_]/, '')
371
372
  end
373
+
374
+ def ipv4?(ip_address)
375
+ return false if ip_address.nil?
376
+
377
+ !ip_address.match(/\A\d+\.\d+\.\d+\.\d+\z/).nil?
378
+ end
372
379
  end
373
380
  end
374
381
  end
@@ -91,11 +91,11 @@ module ActiveMerchant #:nodoc:
91
91
  # More operations are supported by the gateway itself, but
92
92
  # are not supported in this library.
93
93
  SUPPORTED_TRANSACTIONS = {
94
- :purchase => 'A',
95
- :authorize => '1',
96
- :capture => '2',
97
- :refund => '3',
98
- :cancel => '9'
94
+ purchase: 'A',
95
+ authorize: '1',
96
+ capture: '2',
97
+ refund: '3',
98
+ cancel: '9'
99
99
  }
100
100
 
101
101
  # These are the text meanings sent back by the acquirer when
@@ -236,7 +236,7 @@ module ActiveMerchant #:nodoc:
236
236
  data = {}
237
237
  add_action(data, :cancel)
238
238
  order_id, amount, currency = split_authorization(authorization)
239
- add_amount(data, amount, :currency => currency)
239
+ add_amount(data, amount, currency: currency)
240
240
  add_order(data, order_id)
241
241
  data[:description] = options[:description]
242
242
 
@@ -302,7 +302,7 @@ module ActiveMerchant #:nodoc:
302
302
  end
303
303
 
304
304
  def threeds_url
305
- test? ? 'https://sis-t.redsys.es:25443/sis/services/SerClsWSEntradaV2': 'https://sis.redsys.es/sis/services/SerClsWSEntradaV2'
305
+ test? ? 'https://sis-t.redsys.es:25443/sis/services/SerClsWSEntradaV2' : 'https://sis.redsys.es/sis/services/SerClsWSEntradaV2'
306
306
  end
307
307
 
308
308
  def add_payment(data, card)
@@ -313,10 +313,10 @@ module ActiveMerchant #:nodoc:
313
313
  year = sprintf('%.4i', card.year)
314
314
  month = sprintf('%.2i', card.month)
315
315
  data[:card] = {
316
- :name => name,
317
- :pan => card.number,
318
- :date => "#{year[2..3]}#{month}",
319
- :cvv => card.verification_value
316
+ name: name,
317
+ pan: card.number,
318
+ date: "#{year[2..3]}#{month}",
319
+ cvv: card.verification_value
320
320
  }
321
321
  end
322
322
  end
@@ -356,7 +356,7 @@ module ActiveMerchant #:nodoc:
356
356
  if action
357
357
  {
358
358
  'Content-Type' => 'text/xml',
359
- 'SOAPAction' => action
359
+ 'SOAPAction' => action
360
360
  }
361
361
  else
362
362
  {
@@ -407,7 +407,7 @@ module ActiveMerchant #:nodoc:
407
407
  end
408
408
 
409
409
  def build_sha1_xml_request(data, options = {})
410
- xml = Builder::XmlMarkup.new :indent => 2
410
+ xml = Builder::XmlMarkup.new indent: 2
411
411
  build_merchant_data(xml, data, options)
412
412
  xml.target!
413
413
  end
@@ -426,7 +426,11 @@ module ActiveMerchant #:nodoc:
426
426
  xml.DS_MERCHANT_AMOUNT data[:amount]
427
427
  xml.DS_MERCHANT_ORDER data[:order_id]
428
428
  xml.DS_MERCHANT_TRANSACTIONTYPE data[:action]
429
- xml.DS_MERCHANT_PRODUCTDESCRIPTION data[:description]
429
+ if data[:description] && data[:threeds]
430
+ xml.DS_MERCHANT_PRODUCTDESCRIPTION CGI.escape(data[:description])
431
+ else
432
+ xml.DS_MERCHANT_PRODUCTDESCRIPTION data[:description]
433
+ end
430
434
  xml.DS_MERCHANT_TERMINAL options[:terminal] || @options[:terminal]
431
435
  xml.DS_MERCHANT_MERCHANTCODE @options[:login]
432
436
  xml.DS_MERCHANT_MERCHANTSIGNATURE build_signature(data) unless sha256_authentication?
@@ -434,7 +438,11 @@ module ActiveMerchant #:nodoc:
434
438
 
435
439
  # Only when card is present
436
440
  if data[:card]
437
- xml.DS_MERCHANT_TITULAR data[:card][:name]
441
+ if data[:card][:name] && data[:threeds]
442
+ xml.DS_MERCHANT_TITULAR CGI.escape(data[:card][:name])
443
+ else
444
+ xml.DS_MERCHANT_TITULAR data[:card][:name]
445
+ end
438
446
  xml.DS_MERCHANT_PAN data[:card][:pan]
439
447
  xml.DS_MERCHANT_EXPIRYDATE data[:card][:date]
440
448
  xml.DS_MERCHANT_CVV2 data[:card][:cvv]
@@ -456,7 +464,7 @@ module ActiveMerchant #:nodoc:
456
464
  params = {}
457
465
  success = false
458
466
  message = ''
459
- options = @options.merge(:test => test?)
467
+ options = @options.merge(test: test?)
460
468
  xml = Nokogiri::XML(data)
461
469
  code = xml.xpath('//RETORNOXML/CODIGO').text
462
470