activemerchant 1.123.0 → 1.126.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +206 -0
  3. data/lib/active_merchant/billing/check.rb +5 -8
  4. data/lib/active_merchant/billing/credit_card.rb +10 -0
  5. data/lib/active_merchant/billing/credit_card_methods.rb +18 -3
  6. data/lib/active_merchant/billing/gateway.rb +3 -2
  7. data/lib/active_merchant/billing/gateways/adyen.rb +66 -11
  8. data/lib/active_merchant/billing/gateways/airwallex.rb +341 -0
  9. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +2 -1
  10. data/lib/active_merchant/billing/gateways/blue_pay.rb +1 -1
  11. data/lib/active_merchant/billing/gateways/blue_snap.rb +31 -21
  12. data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +6 -1
  13. data/lib/active_merchant/billing/gateways/braintree/token_nonce.rb +113 -0
  14. data/lib/active_merchant/billing/gateways/braintree_blue.rb +87 -15
  15. data/lib/active_merchant/billing/gateways/card_connect.rb +1 -1
  16. data/lib/active_merchant/billing/gateways/card_stream.rb +17 -13
  17. data/lib/active_merchant/billing/gateways/cashnet.rb +15 -5
  18. data/lib/active_merchant/billing/gateways/checkout_v2.rb +34 -5
  19. data/lib/active_merchant/billing/gateways/credorax.rb +10 -0
  20. data/lib/active_merchant/billing/gateways/cyber_source.rb +24 -36
  21. data/lib/active_merchant/billing/gateways/d_local.rb +61 -6
  22. data/lib/active_merchant/billing/gateways/decidir.rb +17 -1
  23. data/lib/active_merchant/billing/gateways/decidir_plus.rb +344 -0
  24. data/lib/active_merchant/billing/gateways/ebanx.rb +19 -3
  25. data/lib/active_merchant/billing/gateways/elavon.rb +6 -3
  26. data/lib/active_merchant/billing/gateways/element.rb +20 -2
  27. data/lib/active_merchant/billing/gateways/global_collect.rb +137 -32
  28. data/lib/active_merchant/billing/gateways/ipg.rb +415 -0
  29. data/lib/active_merchant/billing/gateways/kushki.rb +7 -0
  30. data/lib/active_merchant/billing/gateways/litle.rb +93 -1
  31. data/lib/active_merchant/billing/gateways/mercado_pago.rb +3 -1
  32. data/lib/active_merchant/billing/gateways/mit.rb +260 -0
  33. data/lib/active_merchant/billing/gateways/moka.rb +24 -11
  34. data/lib/active_merchant/billing/gateways/moneris.rb +35 -8
  35. data/lib/active_merchant/billing/gateways/mundipagg.rb +8 -6
  36. data/lib/active_merchant/billing/gateways/nmi.rb +27 -8
  37. data/lib/active_merchant/billing/gateways/orbital.rb +357 -319
  38. data/lib/active_merchant/billing/gateways/pay_arc.rb +9 -7
  39. data/lib/active_merchant/billing/gateways/pay_conex.rb +3 -1
  40. data/lib/active_merchant/billing/gateways/pay_trace.rb +1 -1
  41. data/lib/active_merchant/billing/gateways/payflow.rb +76 -6
  42. data/lib/active_merchant/billing/gateways/paymentez.rb +35 -9
  43. data/lib/active_merchant/billing/gateways/paysafe.rb +155 -34
  44. data/lib/active_merchant/billing/gateways/payu_latam.rb +31 -16
  45. data/lib/active_merchant/billing/gateways/payway_dot_com.rb +3 -3
  46. data/lib/active_merchant/billing/gateways/pin.rb +31 -4
  47. data/lib/active_merchant/billing/gateways/priority.rb +369 -0
  48. data/lib/active_merchant/billing/gateways/rapyd.rb +258 -0
  49. data/lib/active_merchant/billing/gateways/realex.rb +18 -0
  50. data/lib/active_merchant/billing/gateways/safe_charge.rb +7 -6
  51. data/lib/active_merchant/billing/gateways/simetrik.rb +362 -0
  52. data/lib/active_merchant/billing/gateways/stripe.rb +30 -8
  53. data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +175 -72
  54. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +2 -1
  55. data/lib/active_merchant/billing/gateways/trust_commerce.rb +2 -1
  56. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +20 -6
  57. data/lib/active_merchant/billing/gateways/visanet_peru.rb +6 -2
  58. data/lib/active_merchant/billing/gateways/wompi.rb +193 -0
  59. data/lib/active_merchant/billing/gateways/worldpay.rb +196 -64
  60. data/lib/active_merchant/billing/network_tokenization_credit_card.rb +1 -1
  61. data/lib/active_merchant/billing/response.rb +4 -0
  62. data/lib/active_merchant/version.rb +1 -1
  63. metadata +11 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ce71317ac7aa50f5b0bcbfb6fe301f804eea7919153b9ade64cbd0d34ea7a25c
4
- data.tar.gz: a62776247abfdb56c2a0cb36e336242191b3809d989999aebb7a906f8b7afa9b
3
+ metadata.gz: 5bd1687aa128f1fce724fd39276bdb068552dc55e5dadeeab08a127781d54b31
4
+ data.tar.gz: 9519db6995b762487012de3fb0e47ef2f89587d26889fb6c2bbc0e1a74a88713
5
5
  SHA512:
6
- metadata.gz: 83869085801337d35208b4c41cfebe89e315a9ea9590acb8b168402ab3acf398df011a201dcafd85139af7d01c3b75b35e278b18cd5bc7198655606181fd17ea
7
- data.tar.gz: 60a54eae2330f8d00959931d933025cd32f302144c37e17a5d11d35ebd3f3356bb80fc8cfb15f3b060410782a667bdae985f07442bd9af4d9a9f03e5df2faa88
6
+ metadata.gz: af5c8f0f3d87e24ab864c880bde2be9374a60ebb47fdb57feafd0e80e790f585a18be65e331d07b2029c8679e1d35fb7f3baa482590da5bb4959828d5e7f5526
7
+ data.tar.gz: e2584e54260092929898ef7af600eecdb28d9641b7de50519eab20e1ad7929c67aada43ab93166af057e18f1f408fc9c9d45b36c010650d840b187661318f962
data/CHANGELOG CHANGED
@@ -1,7 +1,213 @@
1
+
1
2
  = ActiveMerchant CHANGELOG
2
3
 
3
4
  == HEAD
4
5
 
6
+ == Version 1.126.0 (April 15th, 2022)
7
+ * Moneris: Add 3DS MPI field support [esmitperez] #4373
8
+ * StripePI: Add ability to change payment_method_type to confirm_intent [aenand] #4300
9
+ * GlobalCollect: Improve support for Naranja and Cabal card types [dsmcclain] #4286
10
+ * Payflow: Add support for stored credentials [ajawadmirza] #4277
11
+ * Orbital: Don't void $0 auths for Verify [javierpedrozaing] #2487
12
+ * StripePI: Enable Apple Pay and Google Pay payment methods [gasb150] #4252
13
+ * PaySafe: Update `unstore` method and authorization for redact [ajawadmirza] #4294
14
+ * CyberSource: Add `national_tax_indicator` fields in authorize and purchase [ajawadmirza] #4299
15
+ * NMI: Update gateway credentials to accept security_key [javierpedrozaing] #4302
16
+ * PaySafe: Fix commit for `unstore` method [ajawadmirza] #4303
17
+ * Ebanx: Add support for `order_number` field [ali-hassan] #4304
18
+ * BlueSnap: Add support for `idempotency_key` field [drkjc] #4305
19
+ * Paymentez: Update `capture` method to verify by otp for pending transactions [ajawadmirza] #4267
20
+ * BlueSnap: Update refund request and endpoint along with merchant transaction support [ajawadmirza] #4307
21
+ * DecidirPlus: Added `authorize`, `capture`, `void`, and `verify` methods [ajawadmirza] #4284
22
+ * Paymentez: Fix `authorize` to call `purchase` for otp flow [ajawadmirza] #4310
23
+ * Orbital: Indicate support for network tokenization [dsmcclain] #4309
24
+ * IPG: remove `uruguay` from supported countries [ajawadmirza] #4311
25
+ * Decidir: Add sub_payments sub-fields to gateway [meagabeth] #4315
26
+ * Priority: Add additional fields to purchase and capture requests [dsmcclain] #4301
27
+ * DecidirPlus: Added `unstore` method [ajawadmirza] #4317
28
+ * Decidir & Decidir Plus: Revise handling of `sub_payment` sub-fields [meagabeth] #4318
29
+ * DecidirPlus: Update `unstore` implementation to get token from params [ajawadmirza] #4320
30
+ * CyberSource: Add option for zero amount verify [gasb150] #4313
31
+ * PayU Latam: Refactor `message_from` method, fix failing remote tests [rachelkirk] #4326
32
+ * Adyen: Add currencies with three decimals places [gasb150] #4322
33
+ * GlobalCollect: Stregthen success criteria for void action [peteroas] #4324
34
+ * Priority Payment Systems - Clean up/refactor gateway file and tests [ali-hassan] #4327
35
+ * SafeCharge: change `verify` to send 0 amount [dsmcclain] #4332
36
+ * DLocal: add support for `force_type` field [dsmcclain] #4336
37
+ * Barclaycard SmartPay: Support more nonstandard currencies [jherreraa] #4335
38
+ * DecidirPlus: `name_override` option on `store` [naashton] #4338
39
+ * Priority: Update `add_purchases_data` to return if `options[:purchases]` is empty [drkjc] #4349
40
+ * Stripe PI: update `shipping` field to `shipping_address` [ajawadmirza] #4347
41
+ * DecidirPlus: Handle `payment_method_id` by `card_brand` [naashton] #4350
42
+ * DecidirPlus: `debit` and `payment_method_id` fields [naashton] #4351
43
+ * Adyen: Include Application ID in adyen authorize and purchase transactions [peteroas] #4343
44
+ * Priority: Add support for `replay_id` field [drkjc] #4352
45
+ * Stripe PI: standardize `shipping_address` fields [dsmcclain] #4355
46
+ * Airwallex: support gateway [therufs] #4342
47
+ * Litle: Translate google_pay as android_pay [javierpedrozaing] #4331
48
+ * Braintree: Add ACH support for store [cristian] #4285
49
+ * Simetrik: Add support for Simetrik gateway [simetrik-frank] #4339
50
+ * EBANX: Change amount for Mexico and Chile [flaaviaa] #4337
51
+ * DecidirPlus: Add `establishment_name`, `aggregate_data`, `sub_payments`, `card_holder_identification_type`, `card_holder_identification_number`, `card_door_number`, and `card_holder_birthday` fields [ajawadmirza] #4361
52
+ * DecidirPlus: Update `error_code_from` to get error reason id [ajawadmirza] #4364
53
+ * Dlocal: Add three_ds mpi support [cristian] #4345
54
+ * Stripe PI: Add `request_three_d_secure` field for `create_setup_intent` [aenand] #4365
55
+ * Adyen: Add `verify_amount` field for verify [ajawadmirza] #4369
56
+ * Stripe PI: Pass options for tokenizing Apple/Google Pay [gasb150] #4368
57
+ * Dlocal: Format 3DS mpi enrollment data correctly [cristian] #4371
58
+ * Airwallex: QA fixes for option handling [therufs] #4367
59
+ * CardConnect: Fixed duplicate(concat) Address sent - card_connect is concat. address1 and 2 causing a AVS error [ahmirza] #4362
60
+ * CyberSource: Remove Pinless Debit Transaction Functionality [peteroas] #4370
61
+ * Litle: Add support for Level 2 and 3 enhanced data [curiousepic] #4360
62
+ * Rapyd: Add gateway support [meagabeth] #4372
63
+ * CyberSource: Update and fix test coverage [peteroas] #4374
64
+ * Airwallex: QA fixes for address and create_setup_intent handling [therufs] #4377
65
+ * Airwallex: add `descriptor` field and update logic for sending `request_id` and `merchant_order_id` [dsmcclain] #4379
66
+ * Visanet Peru: use timestamp instead of random for purchaseNumber [therufs] #4093
67
+ * Orbital: add `verify_amount` field [ajawadmirza] #4376
68
+ * Credorax: add `recipient_street_address`, `recipient_city`, `recipient_province_code`, and `recipient_country_code` fields [ajawadmirza] #4384
69
+ * Airwallex: add support for stored credentials [drkjc] #4382
70
+ * Rapyd: Add metadata and ewallet_id options [naashton] #4387
71
+ * Priority: Add additional fields to request and refactor gateway integration [dsmcclain] #4383
72
+ * Rapyd: Update `type` option to `pm_type` [naashton] #4391
73
+ * Conekta: Fix remote test [javierpedrozaing] #4386
74
+ * NMI: Update post URL [jherreraa] #4380
75
+ * Multiple Gateways: Resolve when/case bug [naashton] #4399
76
+ * Airwallex: Add 3DS MPI support [drkjc] #4395
77
+ * Add Cartes Bancaires card bin ranges [leahriffell] #4398
78
+
79
+ == Version 1.125.0 (January 20, 2022)
80
+ * Wompi: support gateway [therufs] #4173
81
+ * Stripe Payment Intents: Add setup_purchase [aenand] #4178
82
+ * Ipg: Add new gateway [ajawadmirza] #4171
83
+ * Worldpay: Adding support for google pay and apple pay [cristian] #4180
84
+ * Worldpay: Adding scrubbing for network token transactions [cristian] #4181
85
+ * SafeCharge: Add sg_NotUseCVV field [ajawadmirza] #4177
86
+ * PayULatam: Correctly map maestro and condensa card types [dsmcclain] #4182
87
+ * StripePaymentIntents: Refactor response for setup_purchase [aenand] #4183
88
+ * Wompi: cast error messages to JSON [therufs] #4186
89
+ * NMI: Omit initial_transaction_id for CIT [aenand] #4189
90
+ * Priority: Support Priority Payment Systems gateway [jessiagee] #4166
91
+ * GlobalCollect: Support for Lodging Data [naashton] #4190
92
+ * IPG: Add support for sub-merchant and recurring type fields [ajawadmirza] # 4188
93
+ * Wompi: Support `installments` option [therufs] #4192
94
+ * Stripe PI: add support for `fulfillment_date` and `event_type` [dsmcclain] #4193
95
+ * Paysafe: Adjust logic for sending 3DS field [meagabeth] #4194
96
+ * Priority: Fix unit test cases [ajawadmirza] #4195
97
+ * EBANX: New Gateway Specific Receiver [spreedly-kledoux] #4198
98
+ * Wompi: Don't send CVV field if no CVV provided [therufs] #4199
99
+ * Worldpay: cleaning order_id according to worldpay rules [cristian] #4197
100
+ * Paysafe: Concatenate credentials for headers [meagabeth] #4201
101
+ * Stripe Payment Intents: Add metadata to setup_purchase [aenand] #4202
102
+ * Priority: Add gateway standard changes [ajawadmirza] #4200
103
+ * IPG: Add support for payment by token [ajawadmirza] #4191
104
+ * Element (Vantiv Express): Add support for general credit [dsmcclain] #4203
105
+ * Worldpay: Update supported countries list, currencies [jherreraa] #4207
106
+ * StripePI: Adding countries available. [gasb150] #4208
107
+ * Orbital: Adding google pay payment tests for Orbital. [ajawadmirza] #4205
108
+ * Bug: Fixing supported countries method when there is inheritance involved [cristian] #4211
109
+ * Mundipagg: Update success method [ajawadmirza] #4210
110
+ * Worldpay: Add support for Visa Direct Fast Funds Credit [dsmcclain] #4212
111
+ * Paysafe: Add support for stored credentials [meagabeth] #4214
112
+ * Worldpay: Adding missing countries to supported countries [cristian] #4213
113
+ * Update institution numbers for Canadian banks [therufs] #4216
114
+ * Worldpay: Set default eCommerce indicator for EMVCO network tokens [shasum] #4215
115
+ * Update handling routing numbers for Canadian banks [therufs] #4217
116
+ * Stripe: API version updated [jherreraa] #4209
117
+ * Mercado Pago: Update verify method [ajawadmirza] #4219
118
+ * DLocal: Set API Version [gasb150] #4222
119
+ * Wompi: Add support for Authorize and Capture [rachelkirk] #4218
120
+ * Priority: Update source and billing address checks [jessiagee] #4220
121
+ * Pin Payments: Add support for `diners_club`, `discover`, and `jcb` cardtypes [montdidier] #4142
122
+ * USA ePay: Add store method [ajawadmirza] #4224
123
+ * IPG: Quick fix to remove warning [ajawadmirza] #4225
124
+ * Remove YAML warning on load_fixtures_method [jherreraa] #4226
125
+ * Worldpay: Add support for tokenizing payment methods with transaction identifiers [dsmcclain] #4227
126
+ * USA ePay: Update implementation to send valid authorization [ajawadmirza] #4231
127
+ * USA ePay: Add store test, update authorize param [jessiagee] #4232
128
+ * Stripe: Update destination test account [jherreraa] #4234
129
+ * Add skip_response option on request check for commit stubs [cristian] #4223
130
+ * Pin Payments: Add support for `void` and New Zealand to supported countries. [montdidier] #4144
131
+ * Wompi: Update authorization in `capture` method. [rachelkirk] #4238
132
+ * IPG: Update authorization to support `store` method token. [ajawadmirza] #4233
133
+ * Paymentez: Update card mappings [ajawadmirza] #4237
134
+ * Priority: Update parsing for error messages [jessiagee] #4245
135
+ * GlobalCollect: Support for Airline Data [naashton] #4187
136
+ * IPG: Add `tpv_error_code` and `tpv_error_msg` fields [ajawadmirza] #4241
137
+ * StripePI: Set restriction for Apple/Google Pay [jherreraa] #4247
138
+ * Cashnet: support multiple itemcodes and amounts [peteroas] #4243
139
+ * IPG: Send default currency in `verify` and two digit `ExpMonth` [ajawadmirza] #4244
140
+ * Stripe: Add remote tests set up to avoid exceed the max external accounts limit [jherreraa] #4239
141
+ * Stripe: Add support for `radar_options: skip_rules` [dsmcclain] #4250
142
+ * CyberSource: Add `user_po`, `taxable`, `national_tax_indicator`, `tax_amount`, and `national_tax` fields [ajawadmirza] #4251
143
+ * Kushki: Add support for `metadata` [rachelkirk] #4253
144
+ * IPG: Add `redact` operation [ajawadmirza] #4254
145
+ * Wompi: Update sandbox and production endpoints [rachelkirk] #4255
146
+ * Orbital: Add `sca_merchant_initiated` operation [ajawadmirza] #4256
147
+ * Cashnet: convert amounts to integers for proper gateway handling [peteroas] #2207
148
+ * PayTrace: Add `unstore` operation [ajawadmirza] #4262
149
+ * Decidir Plus: Add gateway adapter [naashton] #4264
150
+ * CheckoutV2: Add support for Apple Pay and Google Pay tokens [AMHOL] #4235
151
+ * Decidir Plus: Update payment reference [naashton] #4271
152
+ * Paysafe: Update redact method [meagabeth] #4269
153
+ * CyberSource: Add `line_items` field in authorize method [ajawadmirza] #4268
154
+ * CheckoutV2: Support processing channel and marketplace sub entity ID [AMHOL] #4236
155
+ * Elavon: `third_party_token` bug fix [rachelkirk] #4273
156
+ * Decidir Plus: Add `sub_payments` field [naashton] #4274
157
+ * Pin Payments: Add `unstore` support [montdidier] #4276
158
+ * Orbital: Add support for $0 verify [javierpedrozaing] #4275
159
+ * Update inline documentation with all supported cardtypes [ali-hassan] #4283
160
+ * PayWay: Update endpoints, response code [jessiagee] #4281
161
+ * CyberSource: Add `line_items` for purchase [ajawadmirza] #4282
162
+ * Payflow Pro: Add `stored_credential` fields [ajawadmirza] #4277
163
+ * Decidir Plus: Add `fraud_detection` fields [naashton] #4289
164
+
165
+ == Version 1.124.0 (October 28th, 2021)
166
+ * Worldpay: Add Support for Submerchant Data on Worldpay [almalee24] #4147
167
+ * dlocal: Add device_id and ip to payer object and add additional_data [aenand] #4116
168
+ * Adyen: Add network tokenization support to Adyen gateway [mymir] #4101
169
+ * Adyen: Add ACH Support [almalee24] #4105
170
+ * Moka: Support 3DS endpoint and update test url [dsmcclain] #4110
171
+ * Paysafe: Adjust profile data [meagabeth] #4112
172
+ * Stripe Payment Intents: Add support for claim_without_transaction_id field [BritneyS] #4111
173
+ * Mit: Add New Gateway [EsporaInfra] #3820
174
+ * Routex: add card type [rachelkirk] #4115
175
+ * Orbital: Scrub Payment Cryptogram [naashton] #4121
176
+ * Paysafe: Add support for airline fields [meagabeth] #4120
177
+ * Stripe and Stripe PI: Add Radar Session Option [tatsianaclifton] #4119
178
+ * PayArc: Fix billing address nil and phone_number issues [dsmcclain] #4114
179
+ * Routex: Update BIN numbers [rachelkirk] #4123
180
+ * UnionPay: Add Stripe's UnionPay test card to UnionPay BIN range #4122
181
+ * GlobalCollect: Support URL override [naashton] #4127
182
+ * PayConex: scrub bank account info from transcripts [mbreenlyles] #4128
183
+ * Moka: Remove additional transaction data from subsequent calls [naashton] #4129
184
+ * Moka: Ensure CvcNumber can be an empty string [jessiagee] #4130
185
+ * Maestro: Allow more card lengths for Luhnless bins [therufs] #4131
186
+ * Paysafe: Update supported countries [meagabeth] #4135
187
+ * Paysafe: Update field mapping for split_pay [meagabeth] #4136
188
+ * SafeCharge: Add handling for non-fractional currencies [dsmcclain] #4137
189
+ * CardStream: Support passing country_code in request [dsmcclain] #4139
190
+ * Adyen: Adjust phone number mapping [aenand] #4138
191
+ * Mit: Change how parameters are converted to JSON [tatsianaclifton] #4140
192
+ * Stripe: Add account_number to scrubbing [aenand] #4145
193
+ * Stripe PI: add name on card to billing_details [dsmcclain] #4146
194
+ * TrustCommerce: Scrub bank account info [mbreenlyles] #4149
195
+ * TransFirst: Scrub account number [aenand] #4152
196
+ * Paysafe: Update supported countries list [meagabeth] #4154
197
+ * dLocal: Update supported countries list [mbreenlyles] #4155
198
+ * SafeCharge: Add support for email field in capture [rachelkirk] #4153
199
+ * Paysafe: Remove invalid code [meagabeth] #4156
200
+ * NMI: Add descriptor fields [ajawadmirza] #4157
201
+ * Authorize.net: Add tests for scrubbing banking account info (in addition to BluePay, BridgePay, Forte, HPS, and Vanco Gateways)[aenand] #4159
202
+ * Moka: Send refund amount with decimal [dsmcclain] #4160
203
+ * GlobalCollect: Append URI to the URL [naashton] #4162
204
+ * Adyen: Add application info fields [aenand] #4163
205
+ * Adyen: Send NTID from stored cred hash [curiousepic] #4164
206
+ * Payflow: use proper case for 3DS 2.x element names [bbraschi] #4113
207
+ * Realex: Add support for stored credentials [dsmcclain] #4170
208
+ * Moka: Add support for InstallmentNumber field [dsmcclain] #4172
209
+ * Payflow: include AuthenticationStatus for 3DS 2.x [bbraschi] #4168
210
+
5
211
  == Version 1.123.0 (September 10th, 2021)
6
212
  * Paysafe: Add gateway integration [meagabeth] #4085
7
213
  * Elavon: Support recurring transactions with stored credentials [cdmackeyfree] #4086
@@ -14,13 +14,13 @@ module ActiveMerchant #:nodoc:
14
14
  attr_accessor :institution_number, :transit_number
15
15
 
16
16
  # Canadian Institution Numbers
17
- # Found here: https://en.wikipedia.org/wiki/Routing_number_(Canada)
17
+ # Partial list found here: https://en.wikipedia.org/wiki/Routing_number_(Canada)
18
18
  CAN_INSTITUTION_NUMBERS = %w(
19
- 001 002 003 004 006 010 016 030 039 117 127 177 219 245 260 269 270 308
20
- 309 310 315 320 338 340 509 540 608 614 623 809 815 819 828 829 837 839
19
+ 001 002 003 004 006 010 016 030 039 117 127 177 219 245 260 269 270 308
20
+ 309 310 315 320 338 340 509 540 608 614 623 809 815 819 828 829 837 839
21
21
  865 879 889 899 241 242 248 250 265 275 277 290 294 301 303 307 311 314
22
22
  321 323 327 328 330 332 334 335 342 343 346 352 355 361 362 366 370 372
23
- 376 378 807 853
23
+ 376 378 807 853 890
24
24
  )
25
25
 
26
26
  def name
@@ -71,11 +71,8 @@ module ActiveMerchant #:nodoc:
71
71
  (7 * (digits[1] + digits[4] + digits[7])) +
72
72
  (digits[2] + digits[5] + digits[8])) % 10
73
73
 
74
- return checksum == 0
74
+ return checksum == 0 || CAN_INSTITUTION_NUMBERS.include?(routing_number[1..3])
75
75
  end
76
-
77
- return CAN_INSTITUTION_NUMBERS.include?(routing_number[0..2]) if digits.size == 8
78
-
79
76
  false
80
77
  end
81
78
  end
@@ -18,6 +18,11 @@ module ActiveMerchant #:nodoc:
18
18
  # * Dankort
19
19
  # * Maestro
20
20
  # * Forbrugsforeningen
21
+ # * Sodexo
22
+ # * Vr
23
+ # * Carnet
24
+ # * Synchrony
25
+ # * Routex
21
26
  # * Elo
22
27
  # * Alelo
23
28
  # * Cabal
@@ -97,6 +102,11 @@ module ActiveMerchant #:nodoc:
97
102
  # * +'dankort'+
98
103
  # * +'maestro'+
99
104
  # * +'forbrugsforeningen'+
105
+ # * +'sodexo'+
106
+ # * +'vr'+
107
+ # * +'carnet'+
108
+ # * +'synchrony'+
109
+ # * +'routex'+
100
110
  # * +'elo'+
101
111
  # * +'alelo'+
102
112
  # * +'cabal'+
@@ -1,3 +1,5 @@
1
+ require 'set'
2
+
1
3
  module ActiveMerchant #:nodoc:
2
4
  module Billing #:nodoc:
3
5
  # Convenience methods that can be included into a custom Credit Card object, such as an ActiveRecord based Credit Card object.
@@ -19,7 +21,7 @@ module ActiveMerchant #:nodoc:
19
21
  MAESTRO_BINS.any? { |bin| num.slice(0, bin.size) == bin }
20
22
  )
21
23
  },
22
- 'maestro_no_luhn' => ->(num) { num =~ /^(501080|501081|501082)\d{10}$/ },
24
+ 'maestro_no_luhn' => ->(num) { num =~ /^(501080|501081|501082)\d{6,13}$/ },
23
25
  'forbrugsforeningen' => ->(num) { num =~ /^600722\d{10}$/ },
24
26
  'sodexo' => ->(num) { num =~ /^(606071|603389|606070|606069|606068|600818)\d{10}$/ },
25
27
  'alia' => ->(num) { num =~ /^(504997|505878|601030|601073|505874)\d{10}$/ },
@@ -32,10 +34,12 @@ module ActiveMerchant #:nodoc:
32
34
  CARNET_BINS.any? { |bin| num.slice(0, bin.size) == bin }
33
35
  )
34
36
  },
37
+ 'cartes_bancaires' => ->(num) { num&.size == 16 && in_bin_range?(num.slice(0, 6), CARTES_BANCAIRES_RANGES) },
35
38
  'olimpica' => ->(num) { num =~ /^636853\d{10}$/ },
36
39
  'creditel' => ->(num) { num =~ /^601933\d{10}$/ },
37
40
  'confiable' => ->(num) { num =~ /^560718\d{10}$/ },
38
- 'synchrony' => ->(num) { num =~ /^700600\d{10}$/ }
41
+ 'synchrony' => ->(num) { num =~ /^700600\d{10}$/ },
42
+ 'routex' => ->(num) { num =~ /^(700676|700678)\d{13}$/ }
39
43
  }
40
44
 
41
45
  # http://www.barclaycard.co.uk/business/files/bin_rules.pdf
@@ -70,6 +74,17 @@ module ActiveMerchant #:nodoc:
70
74
  ]
71
75
  )
72
76
 
77
+ CARTES_BANCAIRES_RANGES = [
78
+ (507589..507590),
79
+ (507593..507595),
80
+ [507597],
81
+ [560408],
82
+ [581752],
83
+ (585402..585405),
84
+ (585501..585505),
85
+ (585577..585582)
86
+ ]
87
+
73
88
  # https://www.mastercard.us/content/dam/mccom/global/documents/mastercard-rules.pdf, page 73
74
89
  MASTERCARD_RANGES = [
75
90
  (222100..272099),
@@ -198,7 +213,7 @@ module ActiveMerchant #:nodoc:
198
213
 
199
214
  # https://www.discoverglobalnetwork.com/content/dam/discover/en_us/dgn/pdfs/IPP-VAR-Enabler-Compliance.pdf
200
215
  UNIONPAY_RANGES = [
201
- 62212600..62379699, 62400000..62699999, 62820000..62889999,
216
+ 62000000..62000000, 62212600..62379699, 62400000..62699999, 62820000..62889999,
202
217
  81000000..81099999, 81100000..81319999, 81320000..81519999, 81520000..81639999, 81640000..81719999
203
218
  ]
204
219
 
@@ -95,7 +95,8 @@ module ActiveMerchant #:nodoc:
95
95
  pickup_card: 'pick_up_card',
96
96
  config_error: 'config_error',
97
97
  test_mode_live_card: 'test_mode_live_card',
98
- unsupported_feature: 'unsupported_feature'
98
+ unsupported_feature: 'unsupported_feature',
99
+ invalid_amount: 'invalid_amount'
99
100
  }
100
101
 
101
102
  cattr_reader :implementations
@@ -162,7 +163,7 @@ module ActiveMerchant #:nodoc:
162
163
  end
163
164
 
164
165
  def self.supported_countries
165
- @supported_countries ||= []
166
+ @supported_countries ||= (self.superclass.supported_countries || [])
166
167
  end
167
168
 
168
169
  def supported_countries
@@ -9,6 +9,7 @@ module ActiveMerchant #:nodoc:
9
9
  self.supported_countries = %w(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 US)
10
10
  self.default_currency = 'USD'
11
11
  self.currencies_without_fractions = %w(CVE DJF GNF IDR JPY KMF KRW PYG RWF UGX VND VUV XAF XOF XPF)
12
+ self.currencies_with_three_decimal_places = %w(BHD IQD JOD KWD LYD OMR TND)
12
13
  self.supported_cardtypes = %i[visa master american_express diners_club jcb dankort maestro discover elo naranja cabal unionpay]
13
14
 
14
15
  self.money_format = :cents
@@ -60,6 +61,7 @@ module ActiveMerchant #:nodoc:
60
61
  add_splits(post, options)
61
62
  add_recurring_contract(post, options)
62
63
  add_network_transaction_reference(post, options)
64
+ add_application_info(post, options)
63
65
  commit('authorise', post, options)
64
66
  end
65
67
 
@@ -82,12 +84,13 @@ module ActiveMerchant #:nodoc:
82
84
  end
83
85
 
84
86
  def credit(money, payment, options = {})
87
+ action = 'refundWithData'
85
88
  post = init_post(options)
86
89
  add_invoice(post, money, options)
87
- add_payment(post, payment, options)
90
+ add_payment(post, payment, options, action)
88
91
  add_shopper_reference(post, options)
89
92
  add_network_transaction_reference(post, options)
90
- commit('refundWithData', post, options)
93
+ commit(action, post, options)
91
94
  end
92
95
 
93
96
  def void(authorization, options = {})
@@ -141,8 +144,9 @@ module ActiveMerchant #:nodoc:
141
144
  end
142
145
 
143
146
  def verify(credit_card, options = {})
147
+ amount = options[:verify_amount]&.to_i || 0
144
148
  MultiResponse.run(:use_first_response) do |r|
145
- r.process { authorize(0, credit_card, options) }
149
+ r.process { authorize(amount, credit_card, options) }
146
150
  options[:idempotency_key] = nil
147
151
  r.process(:ignore_result) { void(r.authorization, options) }
148
152
  end
@@ -152,12 +156,19 @@ module ActiveMerchant #:nodoc:
152
156
  true
153
157
  end
154
158
 
159
+ def supports_network_tokenization?
160
+ true
161
+ end
162
+
155
163
  def scrub(transcript)
156
164
  transcript.
157
165
  gsub(%r((Authorization: Basic )\w+), '\1[FILTERED]').
158
- gsub(%r(("number\\?":\\?")[^"]*)i, '\1[FILTERED]').
159
- gsub(%r(("cvc\\?":\\?")[^"]*)i, '\1[FILTERED]').
160
- gsub(%r(("cavv\\?":\\?")[^"]*)i, '\1[FILTERED]')
166
+ gsub(%r(("number\\?"\s*:\s*\\?")[^"]*)i, '\1[FILTERED]').
167
+ gsub(%r(("cvc\\?"\s*:\s*\\?")[^"]*)i, '\1[FILTERED]').
168
+ gsub(%r(("cavv\\?"\s*:\s*\\?")[^"]*)i, '\1[FILTERED]').
169
+ gsub(%r(("bankLocationId\\?"\s*:\s*\\?")[^"]*)i, '\1[FILTERED]').
170
+ gsub(%r(("iban\\?"\s*:\s*\\?")[^"]*)i, '\1[FILTERED]').
171
+ gsub(%r(("bankAccountNumber\\?"\s*:\s*\\?")[^"]*)i, '\1[FILTERED]')
161
172
  end
162
173
 
163
174
  private
@@ -209,7 +220,7 @@ module ActiveMerchant #:nodoc:
209
220
  }
210
221
 
211
222
  def add_extra_data(post, payment, options)
212
- post[:telephoneNumber] = options[:billing_address][:phone] if options.dig(:billing_address, :phone)
223
+ post[:telephoneNumber] = (options[:billing_address][:phone_number] if options.dig(:billing_address, :phone_number)) || (options[:billing_address][:phone] if options.dig(:billing_address, :phone)) || ''
213
224
  post[:fraudOffset] = options[:fraud_offset] if options[:fraud_offset]
214
225
  post[:selectedBrand] = options[:selected_brand] if options[:selected_brand]
215
226
  post[:selectedBrand] ||= NETWORK_TOKENIZATION_CARD_SOURCE[payment.source.to_s] if payment.is_a?(NetworkTokenizationCreditCard)
@@ -332,7 +343,7 @@ module ActiveMerchant #:nodoc:
332
343
  post[:deliveryAddress][:stateOrProvince] = get_state(address)
333
344
  post[:deliveryAddress][:country] = address[:country] if address[:country]
334
345
  end
335
- return unless post[:card]&.kind_of?(Hash)
346
+ return unless post[:bankAccount]&.kind_of?(Hash) || post[:card]&.kind_of?(Hash)
336
347
 
337
348
  if (address = options[:billing_address] || options[:address]) && address[:country]
338
349
  post[:billingAddress] = {}
@@ -355,6 +366,7 @@ module ActiveMerchant #:nodoc:
355
366
  value: localized_amount(money, currency),
356
367
  currency: currency
357
368
  }
369
+
358
370
  post[:amount] = amount
359
371
  end
360
372
 
@@ -367,17 +379,32 @@ module ActiveMerchant #:nodoc:
367
379
  post[:modificationAmount] = amount
368
380
  end
369
381
 
370
- def add_payment(post, payment, options)
382
+ def add_payment(post, payment, options, action = nil)
371
383
  if payment.is_a?(String)
372
384
  _, _, recurring_detail_reference = payment.split('#')
373
385
  post[:selectedRecurringDetailReference] = recurring_detail_reference
374
386
  options[:recurring_contract_type] ||= 'RECURRING'
387
+ elsif payment.is_a?(Check)
388
+ add_bank_account(post, payment, options, action)
375
389
  else
376
390
  add_mpi_data_for_network_tokenization_card(post, payment) if payment.is_a?(NetworkTokenizationCreditCard)
377
391
  add_card(post, payment)
378
392
  end
379
393
  end
380
394
 
395
+ def add_bank_account(post, bank_account, options, action)
396
+ bank = {
397
+ bankAccountNumber: bank_account.account_number,
398
+ ownerName: bank_account.name,
399
+ countryCode: options[:billing_address][:country]
400
+ }
401
+
402
+ action == 'refundWithData' ? bank[:iban] = bank_account.routing_number : bank[:bankLocationId] = bank_account.routing_number
403
+
404
+ requires!(bank, :bankAccountNumber, :ownerName, :countryCode)
405
+ post[:bankAccount] = bank
406
+ end
407
+
381
408
  def add_card(post, credit_card)
382
409
  card = {
383
410
  expiryMonth: credit_card.month,
@@ -400,8 +427,10 @@ module ActiveMerchant #:nodoc:
400
427
  end
401
428
 
402
429
  def add_network_transaction_reference(post, options)
430
+ return unless ntid = options[:network_transaction_id] || options.dig(:stored_credential, :network_transaction_id)
431
+
403
432
  post[:additionalData] = {} unless post[:additionalData]
404
- post[:additionalData][:networkTxReference] = options[:network_transaction_id] if options[:network_transaction_id]
433
+ post[:additionalData][:networkTxReference] = ntid
405
434
  end
406
435
 
407
436
  def add_reference(post, authorization, options = {})
@@ -427,6 +456,32 @@ module ActiveMerchant #:nodoc:
427
456
  post[:recurring] = recurring
428
457
  end
429
458
 
459
+ def add_application_info(post, options)
460
+ post[:applicationInfo] ||= {}
461
+ add_external_platform(post, options)
462
+ add_merchant_application(post, options)
463
+ end
464
+
465
+ def add_external_platform(post, options)
466
+ options.update(externalPlatform: application_id) if application_id
467
+
468
+ return unless options[:externalPlatform]
469
+
470
+ post[:applicationInfo][:externalPlatform] = {
471
+ name: options[:externalPlatform][:name],
472
+ version: options[:externalPlatform][:version]
473
+ }
474
+ end
475
+
476
+ def add_merchant_application(post, options)
477
+ return unless options[:merchantApplication]
478
+
479
+ post[:applicationInfo][:merchantApplication] = {
480
+ name: options[:merchantApplication][:name],
481
+ version: options[:merchantApplication][:version]
482
+ }
483
+ end
484
+
430
485
  def add_installments(post, options)
431
486
  post[:installments] = {
432
487
  value: options[:installments]
@@ -617,7 +672,7 @@ module ActiveMerchant #:nodoc:
617
672
  end
618
673
 
619
674
  def error_code_from(response)
620
- STANDARD_ERROR_CODE_MAPPING[response['errorCode']]
675
+ STANDARD_ERROR_CODE_MAPPING[response['errorCode']] || response['errorCode']
621
676
  end
622
677
 
623
678
  def network_transaction_id_from(response)