activemerchant 1.105.0 → 1.106.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +31 -1
  3. data/README.md +1 -1
  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 +17 -6
  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 +2 -2
  24. data/lib/active_merchant/billing/gateways/bpoint.rb +1 -1
  25. data/lib/active_merchant/billing/gateways/braintree_blue.rb +74 -74
  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 +1 -1
  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 +86 -72
  40. data/lib/active_merchant/billing/gateways/data_cash.rb +33 -33
  41. data/lib/active_merchant/billing/gateways/decidir.rb +2 -2
  42. data/lib/active_merchant/billing/gateways/ebanx.rb +1 -1
  43. data/lib/active_merchant/billing/gateways/efsnet.rb +23 -23
  44. data/lib/active_merchant/billing/gateways/elavon.rb +13 -13
  45. data/lib/active_merchant/billing/gateways/epay.rb +40 -40
  46. data/lib/active_merchant/billing/gateways/evo_ca.rb +11 -11
  47. data/lib/active_merchant/billing/gateways/eway.rb +3 -3
  48. data/lib/active_merchant/billing/gateways/eway_managed.rb +40 -40
  49. data/lib/active_merchant/billing/gateways/eway_rapid.rb +7 -7
  50. data/lib/active_merchant/billing/gateways/exact.rb +11 -11
  51. data/lib/active_merchant/billing/gateways/fat_zebra.rb +3 -2
  52. data/lib/active_merchant/billing/gateways/federated_canada.rb +5 -5
  53. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +20 -20
  54. data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +19 -19
  55. data/lib/active_merchant/billing/gateways/flo2cash.rb +4 -4
  56. data/lib/active_merchant/billing/gateways/forte.rb +1 -1
  57. data/lib/active_merchant/billing/gateways/garanti.rb +8 -8
  58. data/lib/active_merchant/billing/gateways/hdfc.rb +3 -3
  59. data/lib/active_merchant/billing/gateways/hps.rb +1 -1
  60. data/lib/active_merchant/billing/gateways/iats_payments.rb +1 -1
  61. data/lib/active_merchant/billing/gateways/inspire.rb +7 -7
  62. data/lib/active_merchant/billing/gateways/instapay.rb +3 -3
  63. data/lib/active_merchant/billing/gateways/ipp.rb +1 -1
  64. data/lib/active_merchant/billing/gateways/iridium.rb +8 -8
  65. data/lib/active_merchant/billing/gateways/itransact.rb +7 -7
  66. data/lib/active_merchant/billing/gateways/iveri.rb +2 -2
  67. data/lib/active_merchant/billing/gateways/ixopay.rb +21 -0
  68. data/lib/active_merchant/billing/gateways/jetpay.rb +4 -4
  69. data/lib/active_merchant/billing/gateways/jetpay_v2.rb +5 -5
  70. data/lib/active_merchant/billing/gateways/latitude19.rb +2 -2
  71. data/lib/active_merchant/billing/gateways/linkpoint.rb +62 -62
  72. data/lib/active_merchant/billing/gateways/litle.rb +2 -2
  73. data/lib/active_merchant/billing/gateways/mastercard.rb +2 -2
  74. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +5 -5
  75. data/lib/active_merchant/billing/gateways/merchant_one.rb +2 -2
  76. data/lib/active_merchant/billing/gateways/merchant_partners.rb +4 -4
  77. data/lib/active_merchant/billing/gateways/merchant_ware.rb +12 -12
  78. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +11 -11
  79. data/lib/active_merchant/billing/gateways/merchant_warrior.rb +12 -2
  80. data/lib/active_merchant/billing/gateways/mercury.rb +9 -9
  81. data/lib/active_merchant/billing/gateways/metrics_global.rb +15 -15
  82. data/lib/active_merchant/billing/gateways/migs.rb +13 -13
  83. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +7 -7
  84. data/lib/active_merchant/billing/gateways/monei.rb +19 -19
  85. data/lib/active_merchant/billing/gateways/moneris.rb +10 -10
  86. data/lib/active_merchant/billing/gateways/money_movers.rb +5 -5
  87. data/lib/active_merchant/billing/gateways/mundipagg.rb +1 -1
  88. data/lib/active_merchant/billing/gateways/nab_transact.rb +15 -15
  89. data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +1 -1
  90. data/lib/active_merchant/billing/gateways/net_registry.rb +6 -6
  91. data/lib/active_merchant/billing/gateways/netaxept.rb +4 -4
  92. data/lib/active_merchant/billing/gateways/netbanx.rb +14 -14
  93. data/lib/active_merchant/billing/gateways/netbilling.rb +12 -12
  94. data/lib/active_merchant/billing/gateways/netpay.rb +2 -2
  95. data/lib/active_merchant/billing/gateways/network_merchants.rb +5 -5
  96. data/lib/active_merchant/billing/gateways/ogone.rb +7 -7
  97. data/lib/active_merchant/billing/gateways/openpay.rb +2 -2
  98. data/lib/active_merchant/billing/gateways/opp.rb +1 -1
  99. data/lib/active_merchant/billing/gateways/optimal_payment.rb +9 -9
  100. data/lib/active_merchant/billing/gateways/orbital.rb +10 -10
  101. data/lib/active_merchant/billing/gateways/pac_net_raven.rb +7 -7
  102. data/lib/active_merchant/billing/gateways/pay_conex.rb +2 -2
  103. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +16 -16
  104. data/lib/active_merchant/billing/gateways/pay_junction.rb +16 -16
  105. data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +18 -2
  106. data/lib/active_merchant/billing/gateways/pay_secure.rb +6 -6
  107. data/lib/active_merchant/billing/gateways/paybox_direct.rb +36 -36
  108. data/lib/active_merchant/billing/gateways/payflow.rb +7 -7
  109. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +12 -12
  110. data/lib/active_merchant/billing/gateways/payflow_express.rb +4 -4
  111. data/lib/active_merchant/billing/gateways/payment_express.rb +7 -7
  112. data/lib/active_merchant/billing/gateways/paymill.rb +3 -3
  113. data/lib/active_merchant/billing/gateways/paypal.rb +1 -1
  114. data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +5 -5
  115. data/lib/active_merchant/billing/gateways/paypal_express_common.rb +1 -1
  116. data/lib/active_merchant/billing/gateways/payscout.rb +5 -5
  117. data/lib/active_merchant/billing/gateways/paystation.rb +2 -2
  118. data/lib/active_merchant/billing/gateways/payu_latam.rb +3 -3
  119. data/lib/active_merchant/billing/gateways/payway.rb +12 -12
  120. data/lib/active_merchant/billing/gateways/pin.rb +16 -16
  121. data/lib/active_merchant/billing/gateways/plugnpay.rb +10 -10
  122. data/lib/active_merchant/billing/gateways/psigate.rb +26 -26
  123. data/lib/active_merchant/billing/gateways/psl_card.rb +4 -4
  124. data/lib/active_merchant/billing/gateways/qbms.rb +23 -23
  125. data/lib/active_merchant/billing/gateways/quantum.rb +4 -4
  126. data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +95 -95
  127. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +9 -9
  128. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +2 -2
  129. data/lib/active_merchant/billing/gateways/qvalent.rb +1 -1
  130. data/lib/active_merchant/billing/gateways/realex.rb +8 -8
  131. data/lib/active_merchant/billing/gateways/redsys.rb +24 -16
  132. data/lib/active_merchant/billing/gateways/safe_charge.rb +1 -1
  133. data/lib/active_merchant/billing/gateways/sage.rb +10 -10
  134. data/lib/active_merchant/billing/gateways/sage_pay.rb +35 -35
  135. data/lib/active_merchant/billing/gateways/sallie_mae.rb +2 -2
  136. data/lib/active_merchant/billing/gateways/secure_net.rb +9 -9
  137. data/lib/active_merchant/billing/gateways/secure_pay.rb +13 -13
  138. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +15 -15
  139. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +2 -2
  140. data/lib/active_merchant/billing/gateways/skip_jack.rb +8 -8
  141. data/lib/active_merchant/billing/gateways/smart_ps.rb +16 -16
  142. data/lib/active_merchant/billing/gateways/so_easy_pay.rb +6 -6
  143. data/lib/active_merchant/billing/gateways/spreedly_core.rb +4 -4
  144. data/lib/active_merchant/billing/gateways/stripe.rb +8 -8
  145. data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +10 -3
  146. data/lib/active_merchant/billing/gateways/swipe_checkout.rb +2 -2
  147. data/lib/active_merchant/billing/gateways/trans_first.rb +4 -4
  148. data/lib/active_merchant/billing/gateways/trust_commerce.rb +19 -19
  149. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +110 -110
  150. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +29 -29
  151. data/lib/active_merchant/billing/gateways/verifi.rb +10 -10
  152. data/lib/active_merchant/billing/gateways/viaklix.rb +6 -6
  153. data/lib/active_merchant/billing/gateways/visanet_peru.rb +6 -6
  154. data/lib/active_merchant/billing/gateways/webpay.rb +2 -2
  155. data/lib/active_merchant/billing/gateways/wirecard.rb +6 -6
  156. data/lib/active_merchant/billing/gateways/worldpay.rb +15 -15
  157. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +32 -32
  158. data/lib/active_merchant/billing/gateways/worldpay_us.rb +2 -2
  159. data/lib/active_merchant/connection.rb +1 -1
  160. data/lib/active_merchant/network_connection_retries.rb +3 -3
  161. data/lib/active_merchant/post_data.rb +1 -1
  162. data/lib/active_merchant/version.rb +1 -1
  163. data/lib/certs/cacert.pem +75 -0
  164. data/lib/support/ssl_verify.rb +2 -2
  165. data/lib/support/ssl_version.rb +2 -2
  166. metadata +2 -3
  167. data/lib/active_merchant/billing/gateways/moneris_us.rb +0 -352
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ecb10bc188ad1b7d0286f0122d7c3643ba8c8b83aa2b3903ba2f582b1f43cad4
4
- data.tar.gz: 5e28f570774addd9001a555b861757b0bf41aecdaa8c918d3f2926e32d41a7a8
3
+ metadata.gz: f734d2204b43b893e645e5c47b9afe26506c0c383b355af486ac93cd6a8677ed
4
+ data.tar.gz: 611450e08256619a1d8aea5bc5795c47ff9220f0abde707f0facc82dd76e1661
5
5
  SHA512:
6
- metadata.gz: da6fcbbd82d25fc8563ee47ec292d2fe276b445fdfe0b1194fdff5c9dddd8c091774f9abb95427721891bac3646e60d6018c2cbf50895c41c1a7aff772792d9b
7
- data.tar.gz: d312d2bbdf0dc874a72519e8d4784c52bf0e663328ac4404ff6a1f92bdea1a9e9a50a0ae9732909275c4a177afce05370474cdef3fc0b02c5aa91ca0096164ff
6
+ metadata.gz: 98fa68d855a398089f9a088d8fa12edae2b34e8ed9fecab64511dc7e64b1ead409977adc00c3bc6aaf18f3f552f2b1fa3a38b8ceb5779d4a32a91e171a5556c8
7
+ data.tar.gz: 78a05f047cb7de339104b39785394b75ca51be7d33368ba44549006e2429e3d2a2796a10d30a18a38fae4aff34e6f4a605f862ec3103ad101c9805c09af586f7
data/CHANGELOG CHANGED
@@ -1,5 +1,35 @@
1
1
  = ActiveMerchant CHANGELOG
2
2
 
3
+ == HEAD
4
+
5
+ == Version 1.106.0 (Mar 10, 2020)
6
+ * PayJunctionV2: Send billing address in `auth` and `purchase` transactions [naashton] #3538
7
+ * Adyen: Fix some remote tests [curiousepic] #3541
8
+ * Redsys: Properly escape cardholder name and description fields in 3DS requests [britth] #3537
9
+ * RuboCop: Fix Style/HashSyntax [leila-alderman] #3540
10
+ * Paypal: Fix OrderTotal elements in `add_payment_details` [chinhle23] #3544
11
+ * Stripe Payment Intents: Add tests for "Idempotency-Key" header [fatcatt316] #3542
12
+ * Paypal: Fix RuboCop Style/HashSyntax violations [chinhle23] #3547
13
+ * Rubocop corrections for space around operators [cdmackeyfree] #3543
14
+ * Fat Zebra: Add `is_billing` in post for `store` call [chinhle23] #3551
15
+ * SafeCharge: Adds four supported countries [carrigan] #3550
16
+ * Ixopay: Support stored credentials [leila-alderman] #3549
17
+ * BlueSnap: Adds localized currency support [carrigan] #3552
18
+ * CheckoutV2: Use status as message for 3DS txns in progress [britth] #3545
19
+ * Stripe Payment Intents: Prevent idempotency key errors for compound actions [britth] #3554
20
+ * Adyen: Add tests for voiding with idempotency keys [jknipp] #3553
21
+ * Fat Zebra: Fix `store` call [chinhle23] #3556
22
+ * Update README to include Adyen [haolime] #3452
23
+ * PayJunctionv2: Fix billing address fields [leila-alderman] #3557
24
+ * Adyen: Fail unexpected 3DS responses [curiousepic] #3546
25
+ * Merchant Warrior: Add support for setting soft descriptors [daBayrus] #3558
26
+ * Adyen: Fix stored credentials [chinhle23] #3560
27
+ * Update BIN ranges for Alelo and Maestro cards [leila-alderman] #3559
28
+ * EBANX: Fix declines if order id is bigger than 40 chars [miguelxpn] #3563
29
+ * Moneris US: Remove gateway [chinhle23] #3561
30
+ * Decidir: Decidir: Improving the response message when encountering errors [naashton] #3564
31
+ * PayBox: Added USERTrust RSA Certification Authority and Sectigo RSA Organization Validation Secure Server CA [baldowl] #3567
32
+
3
33
  == Version 1.105.0 (Feb 20, 2020)
4
34
  * Credorax: Fix `3ds_transtype` setting in post [chinhle23] #3531
5
35
  * Bambora Apac: Send void amount in options [leila-alderman] #3532
@@ -12,7 +42,6 @@
12
42
  * Decidir: Add support for fraud_detection, site_id, and establishment_name [fatcatt316] #3527
13
43
  * HPS: support eCheck [therufs] #3500
14
44
  * EBANX: Add metadata information in post [miguelxpn] #3522
15
- * Paypal: Fix OrderTotal elements in `add_payment_details` [chinhle23] #3517
16
45
  * Worldpay: Add `riskData` GSF [fatcatt316] #3514
17
46
  * EBANX: Fix `scrub` [chinhle23] #3521
18
47
  * Worldpay: Remove unnecessary .tag! methods [leila-alderman] #3519
@@ -20,6 +49,7 @@
20
49
  * Authorize.net: Trim supported countries to AU, CA, US [fatcatt316] #3516
21
50
  * Credorax: Allow optional 3DS 2 fields [jeremywrowe] #3515
22
51
  * Stripe: Remove outdated 'customer options' deprecation [alexdunae] #3401
52
+ * Added support for fraud review in CyberSource gateway [greg-burgoon] #3536
23
53
 
24
54
  == Version 1.104.0 (Jan 29, 2020)
25
55
  * Adyen: add `recurring_contract_type` GSF [therufs] #3460
data/README.md CHANGED
@@ -91,6 +91,7 @@ guide and [Standardized 3DS Fields](https://github.com/activemerchant/active_mer
91
91
 
92
92
  The [ActiveMerchant Wiki](https://github.com/activemerchant/active_merchant/wikis) contains a [table of features supported by each gateway](https://github.com/activemerchant/active_merchant/wiki/Gateway-Feature-Matrix).
93
93
 
94
+ * [Adyen](https://www.adyen.com/) - US, AT, AU, BE, BG, BR, CH, CY, CZ, DE, DK, EE, ES, FI, FR, GB, GI, GR, HK, HU, IE, IS, IT, LI, LT, LU, LV, MC, MT, MX, NL, NO, PL, PT, RO, SE, SG, SK, SI
94
95
  * [Authorize.Net CIM](http://www.authorize.net/) - US
95
96
  * [Authorize.Net](http://www.authorize.net/) - AU, CA, US
96
97
  * [Axcess MS](http://www.axcessms.com/) - AD, AT, BE, BG, BR, CA, CH, CY, CZ, DE, DK, EE, ES, FI, FO, FR, GB, GI, GR, HR, HU, IE, IL, IM, IS, IT, LI, LT, LU, LV, MC, MT, MX, NL, NO, PL, PT, RO, RU, SE, SI, SK, TR, US, VA
@@ -159,7 +160,6 @@ The [ActiveMerchant Wiki](https://github.com/activemerchant/active_merchant/wiki
159
160
  * [Modern Payments](http://www.modpay.com) - US
160
161
  * [MONEI](http://www.monei.net/) - AD, AT, BE, BG, CA, CH, CY, CZ, DE, DK, EE, ES, FI, FO, FR, GB, GI, GR, HU, IE, IL, IS, IT, LI, LT, LU, LV, MT, NL, NO, PL, PT, RO, SE, SI, SK, TR, US, VA
161
162
  * [Moneris](http://www.moneris.com/) - CA
162
- * [Moneris (US)](http://www.monerisusa.com/) - US
163
163
  * [MoneyMovers](http://mmoa.us/) - US
164
164
  * [NAB Transact](http://transact.nab.com.au) - AU
165
165
  * [NELiX TransaX](https://www.nelixtransax.com/) - US
@@ -13,7 +13,12 @@ module ActiveMerchant #:nodoc:
13
13
  'diners_club' => ->(num) { num =~ /^3(0[0-5]|[68]\d)\d{11}$/ },
14
14
  'jcb' => ->(num) { num =~ /^35(28|29|[3-8]\d)\d{12}$/ },
15
15
  'dankort' => ->(num) { num =~ /^5019\d{12}$/ },
16
- 'maestro' => ->(num) { (12..19).cover?(num&.size) && in_bin_range?(num.slice(0, 6), MAESTRO_RANGES) },
16
+ 'maestro' => lambda { |num|
17
+ (12..19).cover?(num&.size) && (
18
+ in_bin_range?(num.slice(0, 6), MAESTRO_RANGES) ||
19
+ MAESTRO_BINS.any? { |bin| num.slice(0, bin.size) == bin }
20
+ )
21
+ },
17
22
  'forbrugsforeningen' => ->(num) { num =~ /^600722\d{10}$/ },
18
23
  'sodexo' => ->(num) { num =~ /^(606071|603389|606070|606069|606068|600818)\d{10}$/ },
19
24
  'vr' => ->(num) { num =~ /^(627416|637036)\d{10}$/ },
@@ -65,6 +70,10 @@ module ActiveMerchant #:nodoc:
65
70
  (510000..559999),
66
71
  ]
67
72
 
73
+ MAESTRO_BINS = Set.new(
74
+ ['500033', '581149']
75
+ )
76
+
68
77
  # https://www.mastercard.us/content/dam/mccom/global/documents/mastercard-rules.pdf, page 73
69
78
  MAESTRO_RANGES = [
70
79
  (561200..561269),
@@ -111,7 +120,7 @@ module ActiveMerchant #:nodoc:
111
120
  405886..405886, 430471..430471, 438061..438061, 438064..438064, 470063..470066,
112
121
  496067..496067, 506699..506704, 506706..506706, 506713..506714, 506716..506716,
113
122
  506749..506750, 506752..506752, 506754..506756, 506758..506762, 506764..506767,
114
- 506770..506771, 509015..509019, 509880..509882, 509884..509885, 509987..509988
123
+ 506770..506771, 509015..509019, 509880..509882, 509884..509885, 509987..509992
115
124
  ]
116
125
 
117
126
  CABAL_RANGES = [
@@ -344,7 +353,7 @@ module ActiveMerchant #:nodoc:
344
353
  def valid_naranja_algo?(numbers) #:nodoc:
345
354
  num_array = numbers.to_s.chars.map(&:to_i)
346
355
  multipliers = [4, 3, 2, 7, 6, 5, 4, 3, 2, 7, 6, 5, 4, 3, 2]
347
- num_sum = num_array[0..14].zip(multipliers).map { |a, b| a*b }.reduce(:+)
356
+ num_sum = num_array[0..14].zip(multipliers).map { |a, b| a * b }.reduce(:+)
348
357
  intermediate = 11 - (num_sum % 11)
349
358
  final_num = intermediate > 9 ? 0 : intermediate
350
359
  final_num == num_array[15]
@@ -80,22 +80,22 @@ module ActiveMerchant #:nodoc:
80
80
  # as network tokenization.
81
81
 
82
82
  STANDARD_ERROR_CODE = {
83
- :incorrect_number => 'incorrect_number',
84
- :invalid_number => 'invalid_number',
85
- :invalid_expiry_date => 'invalid_expiry_date',
86
- :invalid_cvc => 'invalid_cvc',
87
- :expired_card => 'expired_card',
88
- :incorrect_cvc => 'incorrect_cvc',
89
- :incorrect_zip => 'incorrect_zip',
90
- :incorrect_address => 'incorrect_address',
91
- :incorrect_pin => 'incorrect_pin',
92
- :card_declined => 'card_declined',
93
- :processing_error => 'processing_error',
94
- :call_issuer => 'call_issuer',
95
- :pickup_card => 'pick_up_card',
96
- :config_error => 'config_error',
97
- :test_mode_live_card => 'test_mode_live_card',
98
- :unsupported_feature => 'unsupported_feature',
83
+ incorrect_number: 'incorrect_number',
84
+ invalid_number: 'invalid_number',
85
+ invalid_expiry_date: 'invalid_expiry_date',
86
+ invalid_cvc: 'invalid_cvc',
87
+ expired_card: 'expired_card',
88
+ incorrect_cvc: 'incorrect_cvc',
89
+ incorrect_zip: 'incorrect_zip',
90
+ incorrect_address: 'incorrect_address',
91
+ incorrect_pin: 'incorrect_pin',
92
+ card_declined: 'card_declined',
93
+ processing_error: 'processing_error',
94
+ call_issuer: 'call_issuer',
95
+ pickup_card: 'pick_up_card',
96
+ config_error: 'config_error',
97
+ test_mode_live_card: 'test_mode_live_card',
98
+ unsupported_feature: 'unsupported_feature',
99
99
  }
100
100
 
101
101
  cattr_reader :implementations
@@ -223,11 +223,11 @@ module ActiveMerchant #:nodoc:
223
223
 
224
224
  def user_agent
225
225
  @@ua ||= JSON.dump({
226
- :bindings_version => ActiveMerchant::VERSION,
227
- :lang => 'ruby',
228
- :lang_version => "#{RUBY_VERSION} p#{RUBY_PATCHLEVEL} (#{RUBY_RELEASE_DATE})",
229
- :platform => RUBY_PLATFORM,
230
- :publisher => 'active_merchant'
226
+ bindings_version: ActiveMerchant::VERSION,
227
+ lang: 'ruby',
228
+ lang_version: "#{RUBY_VERSION} p#{RUBY_PATCHLEVEL} (#{RUBY_RELEASE_DATE})",
229
+ platform: RUBY_PLATFORM,
230
+ publisher: 'active_merchant'
231
231
  })
232
232
  end
233
233
 
@@ -320,7 +320,7 @@ module ActiveMerchant #:nodoc:
320
320
  raise ArgumentError.new("Missing required parameter: #{param.first}") unless hash.has_key?(param.first)
321
321
 
322
322
  valid_options = param[1..-1]
323
- raise ArgumentError.new("Parameter: #{param.first} must be one of #{valid_options.to_sentence(:words_connector => 'or')}") unless valid_options.include?(hash[param.first])
323
+ raise ArgumentError.new("Parameter: #{param.first} must be one of #{valid_options.to_sentence(words_connector: 'or')}") unless valid_options.include?(hash[param.first])
324
324
  else
325
325
  raise ArgumentError.new("Missing required parameter: #{param}") unless hash.has_key?(param)
326
326
  end
@@ -261,7 +261,9 @@ module ActiveMerchant #:nodoc:
261
261
  end
262
262
 
263
263
  def add_shopper_interaction(post, payment, options={})
264
- if options.dig(:stored_credential, :initial_transaction) || (payment.respond_to?(:verification_value) && payment.verification_value) || payment.is_a?(NetworkTokenizationCreditCard)
264
+ if (options.dig(:stored_credential, :initial_transaction) && options.dig(:stored_credential, :initiator) == 'cardholder') ||
265
+ (payment.respond_to?(:verification_value) && payment.verification_value && options.dig(:stored_credential, :initial_transaction).nil?) ||
266
+ payment.is_a?(NetworkTokenizationCreditCard)
265
267
  shopper_interaction = 'Ecommerce'
266
268
  else
267
269
  shopper_interaction = 'ContAuth'
@@ -273,8 +275,12 @@ module ActiveMerchant #:nodoc:
273
275
  def add_recurring_processing_model(post, options)
274
276
  return unless options.dig(:stored_credential, :reason_type) || options[:recurring_processing_model]
275
277
 
276
- if options.dig(:stored_credential, :reason_type) && options[:stored_credential][:reason_type] == 'unscheduled'
277
- recurring_processing_model = 'CardOnFile'
278
+ if options.dig(:stored_credential, :reason_type) == 'unscheduled'
279
+ if options.dig(:stored_credential, :initiator) == 'merchant'
280
+ recurring_processing_model = 'UnscheduledCardOnFile'
281
+ else
282
+ recurring_processing_model = 'CardOnFile'
283
+ end
278
284
  else
279
285
  recurring_processing_model = 'Subscription'
280
286
  end
@@ -471,7 +477,7 @@ module ActiveMerchant #:nodoc:
471
477
  raw_response = e.response.body
472
478
  response = parse(raw_response)
473
479
  end
474
- success = success_from(action, response)
480
+ success = success_from(action, response, options)
475
481
  Response.new(
476
482
  success,
477
483
  message_from(action, response),
@@ -479,7 +485,7 @@ module ActiveMerchant #:nodoc:
479
485
  authorization: authorization_from(action, parameters, response),
480
486
  test: test?,
481
487
  error_code: success ? nil : error_code_from(response),
482
- avs_result: AVSResult.new(:code => avs_code_from(response)),
488
+ avs_result: AVSResult.new(code: avs_code_from(response)),
483
489
  cvv_result: CVVResult.new(cvv_result_from(response))
484
490
  )
485
491
  end
@@ -520,7 +526,12 @@ module ActiveMerchant #:nodoc:
520
526
  headers
521
527
  end
522
528
 
523
- def success_from(action, response)
529
+ def success_from(action, response, options)
530
+ if ['RedirectShopper', 'ChallengeShopper'].include?(response.dig('resultCode')) && !options[:execute_threed] && !options[:threed_dynamic]
531
+ response['refusalReason'] = 'Received unexpected 3DS authentication response. Use the execute_threed and/or threed_dynamic options to initiate a proper 3DS flow.'
532
+ return false
533
+ end
534
+
524
535
  case action.to_s
525
536
  when 'authorise', 'authorise3d'
526
537
  ['Authorised', 'Received', 'RedirectShopper'].include?(response['resultCode'])
@@ -152,8 +152,8 @@ module ActiveMerchant #:nodoc:
152
152
  message_from(succeeded, response),
153
153
  response,
154
154
  authorization: response['id'],
155
- :avs_result => AVSResult.new(code: response['avs_response']),
156
- :cvv_result => CVVResult.new(response['cvv2_response']),
155
+ avs_result: AVSResult.new(code: response['avs_response']),
156
+ cvv_result: CVVResult.new(response['cvv2_response']),
157
157
  test: test?
158
158
  )
159
159
  rescue JSON::ParserError
@@ -58,21 +58,21 @@ module ActiveMerchant
58
58
  }
59
59
 
60
60
  MARKET_TYPE = {
61
- :moto => '1',
62
- :retail => '2'
61
+ moto: '1',
62
+ retail: '2'
63
63
  }
64
64
 
65
65
  DEVICE_TYPE = {
66
- :unknown => '1',
67
- :unattended_terminal => '2',
68
- :self_service_terminal => '3',
69
- :electronic_cash_register => '4',
70
- :personal_computer_terminal => '5',
71
- :airpay => '6',
72
- :wireless_pos => '7',
73
- :website => '8',
74
- :dial_terminal => '9',
75
- :virtual_terminal => '10'
66
+ unknown: '1',
67
+ unattended_terminal: '2',
68
+ self_service_terminal: '3',
69
+ electronic_cash_register: '4',
70
+ personal_computer_terminal: '5',
71
+ airpay: '6',
72
+ wireless_pos: '7',
73
+ website: '8',
74
+ dial_terminal: '9',
75
+ virtual_terminal: '10'
76
76
  }
77
77
 
78
78
  class_attribute :duplicate_window
@@ -221,13 +221,13 @@ module ActiveMerchant
221
221
 
222
222
  def supports_network_tokenization?
223
223
  card = Billing::NetworkTokenizationCreditCard.new({
224
- :number => '4111111111111111',
225
- :month => 12,
226
- :year => 20,
227
- :first_name => 'John',
228
- :last_name => 'Smith',
229
- :brand => 'visa',
230
- :payment_cryptogram => 'EHuWW9PiBkWvqE5juRwDzAUFBAk='
224
+ number: '4111111111111111',
225
+ month: 12,
226
+ year: 20,
227
+ first_name: 'John',
228
+ last_name: 'Smith',
229
+ brand: 'visa',
230
+ payment_cryptogram: 'EHuWW9PiBkWvqE5juRwDzAUFBAk='
231
231
  })
232
232
 
233
233
  request = post_data(:authorize) do |xml|
@@ -39,10 +39,10 @@ module ActiveMerchant #:nodoc:
39
39
  AUTHORIZE_NET_ARB_NAMESPACE = 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'
40
40
 
41
41
  RECURRING_ACTIONS = {
42
- :create => 'ARBCreateSubscription',
43
- :update => 'ARBUpdateSubscription',
44
- :cancel => 'ARBCancelSubscription',
45
- :status => 'ARBGetSubscriptionStatus'
42
+ create: 'ARBCreateSubscription',
43
+ update: 'ARBUpdateSubscription',
44
+ cancel: 'ARBCancelSubscription',
45
+ status: 'ARBGetSubscriptionStatus'
46
46
  }
47
47
 
48
48
  # Creates a new AuthorizeNetArbGateway
@@ -126,7 +126,7 @@ module ActiveMerchant #:nodoc:
126
126
  # * <tt>subscription_id</tt> -- A string containing the +subscription_id+ of the recurring payment already in place
127
127
  # for a given credit card. (REQUIRED)
128
128
  def cancel_recurring(subscription_id)
129
- request = build_recurring_request(:cancel, :subscription_id => subscription_id)
129
+ request = build_recurring_request(:cancel, subscription_id: subscription_id)
130
130
  recurring_commit(:cancel, request)
131
131
  end
132
132
 
@@ -139,7 +139,7 @@ module ActiveMerchant #:nodoc:
139
139
  # * <tt>subscription_id</tt> -- A string containing the +subscription_id+ of the recurring payment already in place
140
140
  # for a given credit card. (REQUIRED)
141
141
  def status_recurring(subscription_id)
142
- request = build_recurring_request(:status, :subscription_id => subscription_id)
142
+ request = build_recurring_request(:status, subscription_id: subscription_id)
143
143
  recurring_commit(:status, request)
144
144
  end
145
145
 
@@ -149,9 +149,9 @@ module ActiveMerchant #:nodoc:
149
149
  def build_recurring_request(action, options = {})
150
150
  raise StandardError, "Invalid Automated Recurring Billing Action: #{action}" unless RECURRING_ACTIONS.include?(action)
151
151
 
152
- xml = Builder::XmlMarkup.new(:indent => 2)
153
- xml.instruct!(:xml, :version => '1.0', :encoding => 'utf-8')
154
- xml.tag!("#{RECURRING_ACTIONS[action]}Request", :xmlns => AUTHORIZE_NET_ARB_NAMESPACE) do
152
+ xml = Builder::XmlMarkup.new(indent: 2)
153
+ xml.instruct!(:xml, version: '1.0', encoding: 'utf-8')
154
+ xml.tag!("#{RECURRING_ACTIONS[action]}Request", xmlns: AUTHORIZE_NET_ARB_NAMESPACE) do
155
155
  add_merchant_authentication(xml)
156
156
  # Merchant-assigned reference ID for the request
157
157
  xml.tag!('refId', options[:ref_id]) if options[:ref_id]
@@ -394,8 +394,8 @@ module ActiveMerchant #:nodoc:
394
394
  success = response[:result_code] == 'Ok'
395
395
 
396
396
  Response.new(success, message, response,
397
- :test => test_mode,
398
- :authorization => response[:subscription_id]
397
+ test: test_mode,
398
+ authorization: response[:subscription_id]
399
399
  )
400
400
  end
401
401
 
@@ -33,49 +33,49 @@ module ActiveMerchant #:nodoc:
33
33
  AUTHORIZE_NET_CIM_NAMESPACE = 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'
34
34
 
35
35
  CIM_ACTIONS = {
36
- :create_customer_profile => 'createCustomerProfile',
37
- :create_customer_payment_profile => 'createCustomerPaymentProfile',
38
- :create_customer_shipping_address => 'createCustomerShippingAddress',
39
- :get_customer_profile => 'getCustomerProfile',
40
- :get_customer_profile_ids => 'getCustomerProfileIds',
41
- :get_customer_payment_profile => 'getCustomerPaymentProfile',
42
- :get_customer_shipping_address => 'getCustomerShippingAddress',
43
- :delete_customer_profile => 'deleteCustomerProfile',
44
- :delete_customer_payment_profile => 'deleteCustomerPaymentProfile',
45
- :delete_customer_shipping_address => 'deleteCustomerShippingAddress',
46
- :update_customer_profile => 'updateCustomerProfile',
47
- :update_customer_payment_profile => 'updateCustomerPaymentProfile',
48
- :update_customer_shipping_address => 'updateCustomerShippingAddress',
49
- :create_customer_profile_transaction => 'createCustomerProfileTransaction',
50
- :validate_customer_payment_profile => 'validateCustomerPaymentProfile'
36
+ create_customer_profile: 'createCustomerProfile',
37
+ create_customer_payment_profile: 'createCustomerPaymentProfile',
38
+ create_customer_shipping_address: 'createCustomerShippingAddress',
39
+ get_customer_profile: 'getCustomerProfile',
40
+ get_customer_profile_ids: 'getCustomerProfileIds',
41
+ get_customer_payment_profile: 'getCustomerPaymentProfile',
42
+ get_customer_shipping_address: 'getCustomerShippingAddress',
43
+ delete_customer_profile: 'deleteCustomerProfile',
44
+ delete_customer_payment_profile: 'deleteCustomerPaymentProfile',
45
+ delete_customer_shipping_address: 'deleteCustomerShippingAddress',
46
+ update_customer_profile: 'updateCustomerProfile',
47
+ update_customer_payment_profile: 'updateCustomerPaymentProfile',
48
+ update_customer_shipping_address: 'updateCustomerShippingAddress',
49
+ create_customer_profile_transaction: 'createCustomerProfileTransaction',
50
+ validate_customer_payment_profile: 'validateCustomerPaymentProfile'
51
51
  }
52
52
 
53
53
  CIM_TRANSACTION_TYPES = {
54
- :auth_capture => 'profileTransAuthCapture',
55
- :auth_only => 'profileTransAuthOnly',
56
- :capture_only => 'profileTransCaptureOnly',
57
- :prior_auth_capture => 'profileTransPriorAuthCapture',
58
- :refund => 'profileTransRefund',
59
- :void => 'profileTransVoid'
54
+ auth_capture: 'profileTransAuthCapture',
55
+ auth_only: 'profileTransAuthOnly',
56
+ capture_only: 'profileTransCaptureOnly',
57
+ prior_auth_capture: 'profileTransPriorAuthCapture',
58
+ refund: 'profileTransRefund',
59
+ void: 'profileTransVoid'
60
60
  }
61
61
 
62
62
  CIM_VALIDATION_MODES = {
63
- :none => 'none',
64
- :test => 'testMode',
65
- :live => 'liveMode',
66
- :old => 'oldLiveMode'
63
+ none: 'none',
64
+ test: 'testMode',
65
+ live: 'liveMode',
66
+ old: 'oldLiveMode'
67
67
  }
68
68
 
69
69
  BANK_ACCOUNT_TYPES = {
70
- :checking => 'checking',
71
- :savings => 'savings',
72
- :business_checking => 'businessChecking'
70
+ checking: 'checking',
71
+ savings: 'savings',
72
+ business_checking: 'businessChecking'
73
73
  }
74
74
 
75
75
  ECHECK_TYPES = {
76
- :ccd => 'CCD',
77
- :ppd => 'PPD',
78
- :web => 'WEB'
76
+ ccd: 'CCD',
77
+ ppd: 'PPD',
78
+ web: 'WEB'
79
79
  }
80
80
 
81
81
  self.homepage_url = 'http://www.authorize.net/'
@@ -487,9 +487,9 @@ module ActiveMerchant #:nodoc:
487
487
  def build_request(action, options = {})
488
488
  raise StandardError, "Invalid Customer Information Manager Action: #{action}" unless CIM_ACTIONS.include?(action)
489
489
 
490
- xml = Builder::XmlMarkup.new(:indent => 2)
491
- xml.instruct!(:xml, :version => '1.0', :encoding => 'utf-8')
492
- xml.tag!("#{CIM_ACTIONS[action]}Request", :xmlns => AUTHORIZE_NET_CIM_NAMESPACE) do
490
+ xml = Builder::XmlMarkup.new(indent: 2)
491
+ xml.instruct!(:xml, version: '1.0', encoding: 'utf-8')
492
+ xml.tag!("#{CIM_ACTIONS[action]}Request", xmlns: AUTHORIZE_NET_CIM_NAMESPACE) do
493
493
  add_merchant_authentication(xml)
494
494
  # Merchant-assigned reference ID for the request
495
495
  xml.tag!('refId', options[:ref_id]) if options[:ref_id]
@@ -852,7 +852,7 @@ module ActiveMerchant #:nodoc:
852
852
 
853
853
  response_params = parse(action, xml)
854
854
 
855
- message_element= response_params['messages']['message']
855
+ message_element = response_params['messages']['message']
856
856
  first_error = message_element.is_a?(Array) ? message_element.first : message_element
857
857
  message = first_error['text']
858
858
  test_mode = @options[:test_requests] || message =~ /Test Mode/