activemerchant 1.126.0 → 1.130.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +263 -0
  3. data/lib/active_merchant/billing/check.rb +40 -8
  4. data/lib/active_merchant/billing/credit_card.rb +28 -1
  5. data/lib/active_merchant/billing/credit_card_methods.rb +80 -24
  6. data/lib/active_merchant/billing/gateways/adyen.rb +69 -10
  7. data/lib/active_merchant/billing/gateways/airwallex.rb +40 -11
  8. data/lib/active_merchant/billing/gateways/alelo.rb +256 -0
  9. data/lib/active_merchant/billing/gateways/authorize_net.rb +23 -5
  10. data/lib/active_merchant/billing/gateways/beanstream.rb +18 -0
  11. data/lib/active_merchant/billing/gateways/blue_snap.rb +22 -1
  12. data/lib/active_merchant/billing/gateways/bogus.rb +4 -0
  13. data/lib/active_merchant/billing/gateways/borgun.rb +57 -16
  14. data/lib/active_merchant/billing/gateways/braintree_blue.rb +72 -24
  15. data/lib/active_merchant/billing/gateways/card_connect.rb +27 -9
  16. data/lib/active_merchant/billing/gateways/card_stream.rb +23 -0
  17. data/lib/active_merchant/billing/gateways/checkout_v2.rb +228 -57
  18. data/lib/active_merchant/billing/gateways/commerce_hub.rb +366 -0
  19. data/lib/active_merchant/billing/gateways/credorax.rb +47 -27
  20. data/lib/active_merchant/billing/gateways/cyber_source/cyber_source_common.rb +36 -0
  21. data/lib/active_merchant/billing/gateways/cyber_source.rb +119 -33
  22. data/lib/active_merchant/billing/gateways/cyber_source_rest.rb +454 -0
  23. data/lib/active_merchant/billing/gateways/d_local.rb +45 -5
  24. data/lib/active_merchant/billing/gateways/decidir.rb +15 -4
  25. data/lib/active_merchant/billing/gateways/ebanx.rb +36 -24
  26. data/lib/active_merchant/billing/gateways/element.rb +21 -1
  27. data/lib/active_merchant/billing/gateways/global_collect.rb +113 -40
  28. data/lib/active_merchant/billing/gateways/ipg.rb +13 -8
  29. data/lib/active_merchant/billing/gateways/iveri.rb +39 -3
  30. data/lib/active_merchant/billing/gateways/kushki.rb +21 -1
  31. data/lib/active_merchant/billing/gateways/litle.rb +25 -5
  32. data/lib/active_merchant/billing/gateways/mastercard.rb +1 -8
  33. data/lib/active_merchant/billing/gateways/mercado_pago.rb +17 -0
  34. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +44 -10
  35. data/lib/active_merchant/billing/gateways/monei.rb +2 -0
  36. data/lib/active_merchant/billing/gateways/moneris.rb +20 -5
  37. data/lib/active_merchant/billing/gateways/mundipagg.rb +3 -0
  38. data/lib/active_merchant/billing/gateways/ogone.rb +35 -7
  39. data/lib/active_merchant/billing/gateways/openpay.rb +20 -3
  40. data/lib/active_merchant/billing/gateways/orbital.rb +43 -22
  41. data/lib/active_merchant/billing/gateways/pay_trace.rb +64 -18
  42. data/lib/active_merchant/billing/gateways/payeezy.rb +59 -4
  43. data/lib/active_merchant/billing/gateways/paymentez.rb +18 -6
  44. data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +4 -0
  45. data/lib/active_merchant/billing/gateways/paypal_express.rb +2 -0
  46. data/lib/active_merchant/billing/gateways/paysafe.rb +22 -14
  47. data/lib/active_merchant/billing/gateways/payu_latam.rb +4 -1
  48. data/lib/active_merchant/billing/gateways/plexo.rb +308 -0
  49. data/lib/active_merchant/billing/gateways/priority.rb +29 -6
  50. data/lib/active_merchant/billing/gateways/rapyd.rb +110 -49
  51. data/lib/active_merchant/billing/gateways/reach.rb +277 -0
  52. data/lib/active_merchant/billing/gateways/redsys.rb +10 -5
  53. data/lib/active_merchant/billing/gateways/sage_pay.rb +1 -1
  54. data/lib/active_merchant/billing/gateways/securion_pay.rb +40 -0
  55. data/lib/active_merchant/billing/gateways/shift4.rb +345 -0
  56. data/lib/active_merchant/billing/gateways/simetrik.rb +28 -22
  57. data/lib/active_merchant/billing/gateways/stripe.rb +30 -6
  58. data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +62 -22
  59. data/lib/active_merchant/billing/gateways/tns.rb +2 -5
  60. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +1 -1
  61. data/lib/active_merchant/billing/gateways/trust_commerce.rb +14 -3
  62. data/lib/active_merchant/billing/gateways/vanco.rb +12 -3
  63. data/lib/active_merchant/billing/gateways/visanet_peru.rb +1 -1
  64. data/lib/active_merchant/billing/gateways/vpos.rb +7 -4
  65. data/lib/active_merchant/billing/gateways/wompi.rb +8 -4
  66. data/lib/active_merchant/billing/gateways/worldpay.rb +122 -13
  67. data/lib/active_merchant/billing/response.rb +15 -1
  68. data/lib/active_merchant/connection.rb +0 -2
  69. data/lib/active_merchant/country.rb +1 -0
  70. data/lib/active_merchant/errors.rb +4 -1
  71. data/lib/active_merchant/version.rb +1 -1
  72. metadata +24 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5bd1687aa128f1fce724fd39276bdb068552dc55e5dadeeab08a127781d54b31
4
- data.tar.gz: 9519db6995b762487012de3fb0e47ef2f89587d26889fb6c2bbc0e1a74a88713
3
+ metadata.gz: 68d19e25c325eedb9f632b67713bd61ec67f09794560add0c22ba7b45c33cda6
4
+ data.tar.gz: 3c9405afcad2c9d066b76f1ad055d264e55569c14d9b9e322e2c6d3d83867b29
5
5
  SHA512:
6
- metadata.gz: af5c8f0f3d87e24ab864c880bde2be9374a60ebb47fdb57feafd0e80e790f585a18be65e331d07b2029c8679e1d35fb7f3baa482590da5bb4959828d5e7f5526
7
- data.tar.gz: e2584e54260092929898ef7af600eecdb28d9641b7de50519eab20e1ad7929c67aada43ab93166af057e18f1f408fc9c9d45b36c010650d840b187661318f962
6
+ metadata.gz: e5c803983440bd24cbadd24fc5c689061ece449436010f3ad2f328dd3bdbaf2cc3c68c43dae86482f4fee84de454d2e626b89bacf54ad67468285410d8860610
7
+ data.tar.gz: 77458ab3d685b3ea7b7f3f1a26617d201eb071ef540414e6934677a1541166bbd68b132bc5f980dbf60656058d97877e70c907ab950b2314a2cfcf205e9e2de3
data/CHANGELOG CHANGED
@@ -3,6 +3,266 @@
3
3
 
4
4
  == HEAD
5
5
 
6
+ == Version 1.130.0 (June 13th, 2023)
7
+ * Payu Latam - Update error code method to surface network code [yunnydang] #4773
8
+ * CyberSource: Handling Canadian bank accounts [heavyblade] #4764
9
+ * CyberSource Rest: Fixing currency detection [heavyblade] #4777
10
+ * CyberSource: Allow business rules for requests with network tokens [aenand] #4764
11
+ * Adyen: Update Mastercard error messaging [kylene-spreedly] #4770
12
+ * Authorize.net: Update mapping for billing address phone number [jcreiff] #4778
13
+ * Braintree: Update mapping for billing address phone number [jcreiff] #4779
14
+ * CommerceHub: Enabling multi-use public key encryption [jherreraa] #4771
15
+ * Ogone: Enable 3ds Global for Ogone Gateway [javierpedrozaing] #4776
16
+ * Worldpay: Fix Google Pay [almalee24] #4774
17
+ * Borgun change default TrCurrencyExponent and MerchantReturnUrl [naashton] #4788
18
+ * Borgun: support for GBP currency [naashton] #4789
19
+ * CyberSource: Enable auto void on r230 [aenand] #4794
20
+ * Redsys: Set appropriate request fields for stored credentials with CITs and MITs [BritneyS] #4784
21
+ * Stripe & Stripe PI: Validate API Key [almalee24] #4801
22
+ * Add BIN for Maestro [jcreiff] #4799
23
+ * D_Local: Add save field on card object [yunnydang] #4805
24
+ * PayPal Express: Adds support for MsgSubID property on DoReferenceTransaction and DoExpressCheckoutPayment [wikiti] #4798
25
+ * Checkout_v2: use credit_card?, not case equality with CreditCard [bbraschi] #4803
26
+ * Shift4: Enable general credit feature [jherreraa] #4790
27
+
28
+ == Version 1.129.0 (May 3rd, 2023)
29
+ * Adyen: Update selectedBrand mapping for Google Pay [jcreiff] #4763
30
+ * Shift4: Add vendorReference field [jcreiff] #4762
31
+ * Shift4: Add OAuth error [aenand] #4760
32
+ * Stripe PI: Add billing address details to Apple Pay and Google Pay tokenization request [BritneyS] #4761
33
+ * Make gem compatible with Ruby 3+ [pi3r] #4768
34
+
35
+ == Version 1.128.0 (April 24th, 2023)
36
+ * CheckoutV2: Add support for Shipping Address [nicolas-maalouf-cko] #4755
37
+ * Element: Include Apple Pay - Google pay methods [jherrera] #4647
38
+ * dLocal: Add transaction query API(s) request [almalee24] #4584
39
+ * MercadoPago: Add transaction inquire request [molbrown] #4588
40
+ * Worldpay: Add transaction inquire request [molbrown] #4592
41
+ * Alelo: Adding homologation changes [heavyblade] #4590
42
+ * Adyen: Map standard error codes for `processing_error`, `config_error`, `invalid_amount`, and `incorrect_address` [ajawadmirza] #4593
43
+ * MerchantE: Add support for recurring transactions [naashton] #4594
44
+ * CyberSource: Add support for `discount_management_indicator`, `purchase_tax_amount`, `installment_total_amount`, and `installment_annual_interest_rate` fields. [rachelkirk] #4595
45
+ * Shift4: Remove `customer` from refund and `clerk` from store requests [ajawadmirza] #4596
46
+ * TransFirst Transaction Express: Update xml prefixing to be compatible with Nokogiri 1.13.4 [dsmcclain] #4582
47
+ * Iveri: Adding support for external MPI 3DS2 [heavyblade] #4598
48
+ * Credorax: Pass Network Transaction ID on MIT [jherreraa] #4600
49
+ * iVeri: Remove schema validation on Live requests [curiousepic] #4606
50
+ * Beanstream: Adding Third Party 3DS fields [heavyblade] #4602
51
+ * Borgun: Add support for 3DS preauth [ajawadmirza] #4603
52
+ * Cardstream: Add third party 3ds2 support [sainterman] #4570
53
+ * Accept both formats of Canadian routing numbers [molbrown] #4568
54
+ * DLocal: Add support for `original_order_id` [rachelkirk] #4605
55
+ * CheckoutV2: Add support for `merchant_initiated_transaction_id` [rachelkirk] #4611
56
+ * CardConnect: Add stored credential & pass any valid `ecomind` field [ajawadmirza] #4609
57
+ * Alelo: Trigger access token refresh on 404 [curiousepic] #4614
58
+ * DLocal: Add Network Tokens [gasb150] #4608
59
+ * Redsys: enable NTID generation with zero-value verify [jcreiff] #4615
60
+ * IPG: Add support for passing in `store_id` on transactions [aenand] #4619
61
+ * Adyen: Field support for Level 2 and level 3 information [sainterman] #4617
62
+ * Add alternate alpha2 country code for Kosovo [jcreiff] #4622
63
+ * CyberSource: Add support for several fields [rachelkirk] #4623
64
+ * Reach: adding gateway [cristian] #4618
65
+ * Orbital: integration improvements [molbrown] #4626
66
+ * iVeri: add new url [almalee24] #4630
67
+ * Payeezy: Enable Apple Pay support [naashton] #4631
68
+ * Payeezy: Scrub Cryptogram [naashton] #4633
69
+ * Checkout: Fix for `[:source][:stored]` in stored credentials [marioarranzr] #4629
70
+ * Mundipagg: send authorization_secret_key on all transaction types [edgarv09] #4635
71
+ * CommerceHub: Add new gateway [naashton] #4640
72
+ * CyberSource: Update installment data method [rachelkirk] #4642
73
+ * Element: fix bug with billing address email [jcreiff] #4644
74
+ * Openpay: set URL by merchant country [edgarv09] #4637
75
+ * Alelo: Improving credentials refresh process [heavyblade] #4616
76
+ * Decidir: Add transaction inquire request [almalee24] #4649
77
+ * EBANX: add soft_descriptor field [jcreiff] #4658
78
+ * CommerceHub: Add Apple Pay and Google Pay [gasb150] #4648
79
+ * Global Collect & Alelo: Fixing year dependent failing tests [heavyblade] #4665
80
+ * Moneris: Add Google Pay [sinourain] #4666
81
+ * Global Collect: Add transaction inquire request [almalee24] #4669
82
+ * Stripe PI: Add Level 3 support [almalee24] #4673
83
+ * Braintree: return additional processor response [jcreiff] #4653
84
+ * Payeezy: name from `billing_address` on `purchase` [naashton] #4674
85
+ * Stripe: add reverse_transfer to void transactions [jcreiff] #4668
86
+ * Global Collect: fix bug on transaction inquire request [almalee24] #4676
87
+ * Credorax: Support google pay and apple pay [edgarv09] #4661
88
+ * Plexo: Add support for 5 new credit card brands (passcard, edenred, anda, tarjeta-d, sodexo) [edgarv09] #4652
89
+ * Authorize.net: Google pay token support [sainterman] #4659
90
+ * Credorax: Add support for Network Tokens [jherreraa] #4679
91
+ * Stripe PI: use MultiResponse in create_setup_intent [jcreiff] #4683
92
+ * Credorax: Correct NTID logic for MIT transactions [aenand] #4686
93
+ * Adyen: Add support for `skip_mpi_data` flag [rachelkirk] #4654
94
+ * Add Canadian Institution Numbers [jcreiff] #4687
95
+ * Tns: update test URL [almalee24] #4698
96
+ * TrustCommerce: Update `authorization_from` to handle `store` response [jherreraa] #4691
97
+ * TrustCommerce: Verify feature added [jherreraa] #4692
98
+ * Rapyd: Add customer object to transactions [javierpedrozaing] #4664
99
+ * CybersourceRest: Add new gateway with authorize and purchase [heavyblade] #4690
100
+ * Litle: Add prelive_url option [aenand] #4710
101
+ * CommerceHub: Fixing verify status and prevent tokenization [heavyblade] #4716
102
+ * Payeezy: Update Stored Credentials [almalee24] #4711
103
+ * CheckoutV2: Add store/unstore [gasb150] #4712
104
+ * CybersourceREST - Refund | Credit [sinourain] #4700
105
+ * Braintree - Add Paypal custom fields [yunnydang] #4713
106
+ * BlueSnap - Add descriptor phone number field [yunnydang] #4717
107
+ * Braintree - Update transaction hash to include processor_authorization_code [yunnydang] #4718
108
+ * CyberSourceRest: Add apple pay, google pay [gasb150] #4708
109
+ * CybersourceREST - Void | Verify [sinourain] #4695
110
+ * Credorax: Set default ECI values for token transactions [sainterman] #4693
111
+ * CyberSourceRest: Add ACH Support [edgarv09] #4722
112
+ * CybersourceREST: Add capture request [heavyblade] #4726
113
+ * Paymentez: Add transaction inquire request [aenand] #4729
114
+ * Ebanx: Add transaction inquire request [almalee24] #4725
115
+ * Ebanx: Add support for Elo & Hipercard [almalee24] #4702
116
+ * CheckoutV2: Add Idempotency key support [yunnydang] #4728
117
+ * Adyen: Add support for shopper_statement field for capture [yunnydang] #4736
118
+ * CheckoutV2: Update idempotency_key name [yunnydang] #4737
119
+ * Payeezy: Enable external 3DS [jherreraa] #4715
120
+ * Ebanx: Remove default email [aenand] #4747
121
+ * CyberSourceRest: Add stored credentials support [jherreraa] #4707
122
+ * Payeezy: Add `last_name` for `add_network_tokenization` [naashton] #4743
123
+ * Stripe PI: Tokenize payment method at Stripe for `verify` [aenand] #4748
124
+ * Kushki: Add support for the months and deferred fields [yunnydang] #4752
125
+ * Borgun: Update TrCurrencyExponent for 3DS transactions with `ISK` [aenand] #4751
126
+ * CyberSourceRest: Add gateway specific fields handling [jherreraa] #4746
127
+ * IPG: Improve error handling [heavyblade] #4753
128
+ * Shift4: Handle access token failed calls [heavyblade] #4745
129
+ * Bogus: Add verify functionality [willemk] #4749
130
+ * Litle: Update successful_from method [almalee24] #4765
131
+
132
+ == Version 1.127.0 (September 20th, 2022)
133
+ * BraintreeBlue: Add venmo profile_id [molbrown] #4512
134
+ * Maestro: Adding missing BIN ranges [bradbroge] #4423
135
+ * Simetrik: Fix integer and float types, update scrub method [rachelkirk] #4405
136
+ * Credorax: Convert country codes for `recipient_country_code` field [ajawadmirza] #4408
137
+ * BlueSnap: Correctly parse `refund-transaction-id` [dsmcclain] #4411
138
+ * Worldpay: Add level II and level III data [javierpedrozaing] #4393
139
+ * Worldpay: extract `issuer_response_code` and `issuer_response_description` from gateway response [dsmcclain] #4412
140
+ * Vantiv: Support `duplicate` field read from saleResponse.duplicate attr [mashton] #4413
141
+ * Ogone: Add support for 3dsv2 [gasb150] #4410
142
+ * BlueSnap: Add support for stored credentials [ajawadmirza] #4414
143
+ * Monei: Add support for `lang` field [drkjc] #4421
144
+ * Wompi: Redirect `refund` to `void` [drkjc] #4424
145
+ * Rapyd: 3DS Support [naashton] #4422
146
+ * Adyen: Update API version [jherreraa] #4418
147
+ * Ogone: Updated home gateway URL [gasb150] #4419
148
+ * Credorax: Update url gateway and credit cards [javierpedrozaing] #4417
149
+ * Kushki: Pass extra_taxes with USD [therufs] #4426
150
+ * DLocal: fix bug with `X-Idempotency-Key` header [dsmcclain] #4431
151
+ * DLocal: Mark support for additional countries [gasb150] #4427
152
+ * Rapyd: Additional Fields [naashton] #4434
153
+ * Braintree: Return generated client token [BritneyS] #4416
154
+ * Simetrik: Update `audience` field [simetrik-frank] #4433
155
+ * CyberSource: Add bank account payment method support [heavyblade] #4428
156
+ * Rapyd: Zero Dollar Auth [naashton] #4435
157
+ * Rapyd: Scrub ACH [naashton] #4436
158
+ * VisaNet Peru: Update `purchase_number` [rachelkirk] #4437
159
+ * CardConnect: Add support for 3ds V2 [javierpedrozaing] #4429
160
+ * Rapyd: Support `store` and `unstore` [naashton] #4439
161
+ * Orbital: Update API version to 9.0 [gasb150] #4440
162
+ * Plexo: Add `meta_data` fields and reorder amount object in response [ajawadmirza] #4441
163
+ * Plexo: Change field name from `meta_data` to `metadata` [ajawadmirza] #4443
164
+ * Simetrik: Update `vat` to be in cents [simetrik-frank] #4425
165
+ * Cybersource: Handle Amex cryptograms [heavyblade] #4445
166
+ * Rapyd: Pass fields to `refund` and `store` [naashton] #4449
167
+ * VPOS: Allow reuse of encryption key [therufs] #4450
168
+ * Orbital: Add `payment_action_ind` field and refund through credit card to support tandem implementation [ajawadmirza] #4420
169
+ * Airwallex: Send `referrer_data` on setup transactions [drkjc] #4453
170
+ * Adyen and StripPI: Updated error messaging [mbreenlyles] #4454
171
+ * Airwallex: Update `referrer_data` field [drkjc] #4455
172
+ * Simetrik: Update `order_id` and `description` to be top level fields [simetrik-frank] #4451
173
+ * Plexo: Update `ip`, `description`, and `email` fields request format and scrub method to not filter cardholder name and reference id [ajawadmirza] #4457
174
+ * Plexo: Update `verify` implementation and add `verify_amount` field [ajawadmirza] #4462
175
+ * Vanco: Update `purchase` to complete a purchase transaction with an existing session id [BritneyS] #4461
176
+ * Authorize.net: Allow custom verify_amount and validate it [jherreraa] #4464
177
+ * Shift4: Add gateway adapter [ali-hassan] #4415
178
+ * Rapyd: Correctly add `billing_address` [naashton] #4465
179
+ * Credorax: Update processor response messages [jcreiff] #4466
180
+ * Shift4: add `customer_reference`, `destination_postal_code`, `product_descriptors` fields and core refactoring [ajawadmirza] #4469
181
+ * Paypal Express: Add checkout status to response object [mbreenlyles] #4467
182
+ * Shift4: Scrub security code [naashton] #4470
183
+ * Shift4: Update `cardOnFile` transaction requests [ajawadmirza] #4471
184
+ * Plexo: Update `success_from` definition [ajawadmirza] #4468
185
+ * Rapyd: Un-nest the payment urls [naashton] #4472
186
+ * Paypal Express: Correct naming mistake for accessor [mbreenlyles] #4473
187
+ * GlobalCollect: Enable Google Pay and Apple Pay [gasb150] #4388
188
+ * Shift4: $0 auth [naashton] #4474
189
+ * CyberSource: Updatie API version to 1.198 and fix 3DS test [cristian] #4456
190
+ * Shift4: add `store` method, `present` field in card, and to pass amount in cents [ajawadmirza] #4475
191
+ * Shift4: add `3ds2` implementation [ajawadmirza] #4476
192
+ * Shift4: update `success_from` definition to consider response code [ajawadmirza] #4477
193
+ * Rapyd: Customer Object [naashton] #4478
194
+ * Shift4: Verify Endopint Fix [naashton] #4479
195
+ * CheckoutV2: Scrub cryptogram and credit card number [ajawadmirza] #4488
196
+ * CheckoutV2: Add `3ds.status` field to send status of 3DS flow of all 3DS transactions [BritneyS] #4492
197
+ * CheckoutV2: Add `challenge_indicator`, `exemption`, `authorization_type`, `processing_channel_id`, and `capture_type` fields [ajawadmirza] #4482
198
+ * Add `mada` card type and associated BINs; add support for `mada` in CheckoutV2 gateway [dsmcclain] #4486
199
+ * Authorize.net: Refactor custom verify amount handling [jherreraa] #4485
200
+ * EBANX: Change amount for Colombia [flaaviaa] #4481
201
+ * Worldpay: Update `required_status_message` and `message_from` methods for response. [rachelkirk] #4493
202
+ * CheckoutV2: Add support for transactions through OAuth [ajawadmirza] #4483
203
+ * Vanco: Update unit test to remove remote call to gateway [ajawadmirza] #4497
204
+ * Shift4: remove support for 3ds2 [ajawadmirza] #4503
205
+ * Rapyd: Add support for stored credential [ajawadmirza] #4487
206
+ * MerchantE: Update `store` and add `verify` method [ajawadmirza] #4507
207
+ * Shift4: Add default `numericId`, add `InterfaceVersion`, `InterfaceName`, and `CompanyName` header fields, change date time format and allow merchant time zone [ajawadmirza] #4509
208
+ * BraintreeBlue: Add support for partial capture [aenand] #4515
209
+ * Rapyd: Change key name to `network_transaction_id` [ajawadmirza] #4514
210
+ * CyberSource: Handle unsupported Network Token brands [heavyblade] #4500
211
+ * Ingenico(Global Collect): Add support for `payment_product_id` [rachelkirk] #4521
212
+ * Adyen: Add network transaction id to store call [jcreiff] #4522
213
+ * Worldpay: Add machine cookie to subsequent calls during 3DS challenge [mbreenlyles] #4513*
214
+ * Shift4: Scrub `securityCode` fix [naashton] #4524
215
+ * Credorax: Update `OpCode` for credit transactions [dsmcclain] #4279
216
+ * CheckoutV2: Add `credit` method [ajawadmirza] #4490
217
+ * Stripe Payment Intents: Add `options` for retrieve_setup_intent [aenand] #4529
218
+ * CheckoutV2: Send payment id via `incremental_authorization` field [ajawadmirza] #4518
219
+ * Shift4: Add card `present` field, use previous transaction authorization for capture, and hardcode header values [ajawadmirza] #4528
220
+ * Orbital: Remove `DPANInd` field for RC transactions [ajawadmirza] #4502
221
+ * EBANX: Add Spreedly tag to payment body [flaaviaa] #4527
222
+ * Shift4: Add `expiration_date` field for refund transactions [ajawadmirza] #4532
223
+ * Improve handling of AVS and CVV Results in Multiresponses [gasb150] #4516
224
+ * Airwallex: Add `skip_3ds` field for create payment transactions [ajawadmirza] #4534
225
+ * Shift4: Typo correction for `initial_transaction` [ajawadmirza] #4537
226
+ * Rapyd: Pass Customer ID and fix `add_token` method [naashton] #4538
227
+ * Shift4: If no timezone is sent on transactions, the code uses the hours and minutes as a timezone offset [ali-hassan] #4536
228
+ * Priority: Add support for general credit and updating cvv and zip [priorityspreedly] #4517
229
+ * Worldpay: Update actions for generated message in `required_status_message` method [rachelkirk] #4530
230
+ * Adyen: Modify handling of countryCode for ACH [jcreiff] #4543
231
+ * CardConnect: update api end-point urls [heavyblade] #4541
232
+ * Vantiv(Litle): Add support for `fraudFilterOverride` field [rachelkirk] #4544
233
+ * Stripe: Add shipping address [jcreiff] #4539
234
+ * PayuLatam: Add extra1, extra2, extra3 fields [jcreiff] #4550
235
+ * Paysafe: Add fundingTransaction object [jcreiff] #4552
236
+ * MerchantE: Add tests for `moto_ecommerce_ind` field [ajawadmirza] #4554
237
+ * Plexo: Update `purchase` method, add flags for header fields, add new fields `billing_address`, `identification_type`, `identification_value`, and `cardholder_birthdate` [ajawadmirza] #4540
238
+ * Rapyd: Remove `BR`, `MX`, and `US` from supported countries [ajawadmirza] #4558
239
+ * Stripe Payment Intents: fix bug with billing address email [jcreiff] #4556
240
+ * Shift4: Add customer to `purchase` & `store` and remove transaction from `store` [ajawadmirza] #4557
241
+ * MerchantE: only add `moto_commerce_ind` to request if it is present [ajawadmirza] #4560
242
+ * Add BpPlus card type along with custom validation logic [dsmcclain] #4559
243
+ * PayTrace: Support ACH implementation for new endpoints and request body [ajawadmirza] #4545
244
+ * Rapyd: No force capture for ACH [naashton] #4562
245
+ * Shift4: Applied checks on Shift4 Time/Timezone offset [ali-hassan] #4561
246
+ * Alelo: Add gateway [heavyblade] #4555
247
+ * Wompi: Allow partial refund amount on void_sync [jcreiff] #4535
248
+ * Shift4: Timezone Offset [naashton] #4566
249
+ * MerchantE: `recurring_pmt_num` and `recurring_pmt_count` fields [ali-hassan] #4553
250
+ * Orbital: Add South African Rand to supported currencies [molbrown] #4569
251
+ * Orbital: Fix CardSecValInd [molbrown] #4563
252
+ * Shift4: Add `usage_indicator`, `indicator`, `scheduled_indicator`, and `transaction_id` fields [ajawadmirza] #4564
253
+ * Shift4: Retrieve `access_token` once [naashton] #4572
254
+ * Redsys: Update Base64 encryption handling for secret key [jcreiff] #4565
255
+ * Shift4: refuse `postalCode` when its null [ajawadmirza] #4574
256
+ * Plexo: Update param key to `refund_type` [ajawadmirza] #4575
257
+ * Shift4: Update request params for `verify`, `capture`, and `refund` [ajawadmirza] #4577
258
+ * CyberSource: Add support for `sec_code` [rachelkirk] #4581
259
+ * BraintreeBlue: Correctly vault payment method token for PayPal Checkout with Vault [almalee24] #4579
260
+ * BpPlus: Allow spaces in card number [ajawadmirza] #4585
261
+ * Shift4: Decline referral transactions and parse message for internal server errors [ajawadmirza] #4583
262
+ * Litle: Update homepage_url [gasb150] #4491
263
+ * Priority: Update credential handling [therufs] #4571
264
+ * Shift4: Fix authorization and remove `entryMode` from verify and store transactions [ajawadmirza] #4589
265
+
6
266
  == Version 1.126.0 (April 15th, 2022)
7
267
  * Moneris: Add 3DS MPI field support [esmitperez] #4373
8
268
  * StripePI: Add ability to change payment_method_type to confirm_intent [aenand] #4300
@@ -75,6 +335,9 @@
75
335
  * Multiple Gateways: Resolve when/case bug [naashton] #4399
76
336
  * Airwallex: Add 3DS MPI support [drkjc] #4395
77
337
  * Add Cartes Bancaires card bin ranges [leahriffell] #4398
338
+ * Airwallex: Add support for `original_transaction_id` field [drkjc] #4401
339
+ * Securion Pay: Pass external 3DS data [jherreraa] #4404
340
+ * Airwallex: Update Stored Credentials testing, remove support for `original_transaction_id` field [drkjc] 4407
78
341
 
79
342
  == Version 1.125.0 (January 20, 2022)
80
343
  * Wompi: support gateway [therufs] #4173
@@ -20,7 +20,7 @@ module ActiveMerchant #:nodoc:
20
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 890
23
+ 376 378 807 853 890 618 842
24
24
  )
25
25
 
26
26
  def name
@@ -60,20 +60,52 @@ module ActiveMerchant #:nodoc:
60
60
  false
61
61
  end
62
62
 
63
+ def valid_routing_number?
64
+ digits = routing_number.to_s.split('').map(&:to_i).select { |d| (0..9).cover?(d) }
65
+ case digits.size
66
+ when 9
67
+ return checksum(digits) == 0 || CAN_INSTITUTION_NUMBERS.include?(routing_number[1..3])
68
+ when 8
69
+ return CAN_INSTITUTION_NUMBERS.include?(routing_number[5..7])
70
+ end
71
+
72
+ false
73
+ end
74
+
63
75
  # Routing numbers may be validated by calculating a checksum and dividing it by 10. The
64
76
  # formula is:
65
77
  # (3(d1 + d4 + d7) + 7(d2 + d5 + d8) + 1(d3 + d6 + d9))mod 10 = 0
66
78
  # See http://en.wikipedia.org/wiki/Routing_transit_number#Internal_checksums
67
- def valid_routing_number?
79
+ def checksum(digits)
80
+ ((3 * (digits[0] + digits[3] + digits[6])) +
81
+ (7 * (digits[1] + digits[4] + digits[7])) +
82
+ (digits[2] + digits[5] + digits[8])) % 10
83
+ end
84
+
85
+ # Always return MICR-formatted routing number for Canadian routing numbers, US routing numbers unchanged
86
+ def micr_format_routing_number
68
87
  digits = routing_number.to_s.split('').map(&:to_i).select { |d| (0..9).cover?(d) }
69
- if digits.size == 9
70
- checksum = ((3 * (digits[0] + digits[3] + digits[6])) +
71
- (7 * (digits[1] + digits[4] + digits[7])) +
72
- (digits[2] + digits[5] + digits[8])) % 10
88
+ case digits.size
89
+ when 9
90
+ if checksum(digits) == 0
91
+ return routing_number
92
+ else
93
+ return routing_number[4..8] + routing_number[1..3]
94
+ end
95
+ when 8
96
+ return routing_number
97
+ end
98
+ end
73
99
 
74
- return checksum == 0 || CAN_INSTITUTION_NUMBERS.include?(routing_number[1..3])
100
+ # Always return electronic-formatted routing number for Canadian routing numbers, US routing numbers unchanged
101
+ def electronic_format_routing_number
102
+ digits = routing_number.to_s.split('').map(&:to_i).select { |d| (0..9).cover?(d) }
103
+ case digits.size
104
+ when 9
105
+ return routing_number
106
+ when 8
107
+ return '0' + routing_number[5..7] + routing_number[0..4]
75
108
  end
76
- false
77
109
  end
78
110
  end
79
111
  end
@@ -32,6 +32,12 @@ module ActiveMerchant #:nodoc:
32
32
  # * Olimpica
33
33
  # * Creditel
34
34
  # * Confiable
35
+ # * Mada
36
+ # * BpPlus
37
+ # * Passcard
38
+ # * Edenred
39
+ # * Anda
40
+ # * Creditos directos (Tarjeta D)
35
41
  #
36
42
  # For testing purposes, use the 'bogus' credit card brand. This skips the vast majority of
37
43
  # validations, allowing you to focus on your core concerns until you're ready to be more concerned
@@ -61,6 +67,8 @@ module ActiveMerchant #:nodoc:
61
67
  class CreditCard < Model
62
68
  include CreditCardMethods
63
69
 
70
+ BRANDS_WITH_SPACES_IN_NUMBER = %w(bp_plus)
71
+
64
72
  class << self
65
73
  # Inherited, but can be overridden w/o changing parent's value
66
74
  attr_accessor :require_verification_value
@@ -76,7 +84,7 @@ module ActiveMerchant #:nodoc:
76
84
  attr_reader :number
77
85
 
78
86
  def number=(value)
79
- @number = (empty?(value) ? value : value.to_s.gsub(/[^\d]/, ''))
87
+ @number = (empty?(value) ? value : filter_number(value))
80
88
  end
81
89
 
82
90
  # Returns or sets the expiry month for the card.
@@ -116,6 +124,12 @@ module ActiveMerchant #:nodoc:
116
124
  # * +'olimpica'+
117
125
  # * +'creditel'+
118
126
  # * +'confiable'+
127
+ # * +'mada'+
128
+ # * +'bp_plus'+
129
+ # * +'passcard'+
130
+ # * +'edenred'+
131
+ # * +'anda'+
132
+ # * +'tarjeta-d'+
119
133
  #
120
134
  # Or, if you wish to test your implementation, +'bogus'+.
121
135
  #
@@ -337,8 +351,21 @@ module ActiveMerchant #:nodoc:
337
351
  icc_data.present?
338
352
  end
339
353
 
354
+ def allow_spaces_in_card?(number = nil)
355
+ BRANDS_WITH_SPACES_IN_NUMBER.include?(self.class.brand?(self.number || number))
356
+ end
357
+
340
358
  private
341
359
 
360
+ def filter_number(value)
361
+ regex = if allow_spaces_in_card?(value)
362
+ /[^\d ]/
363
+ else
364
+ /[^\d]/
365
+ end
366
+ value.to_s.gsub(regex, '')
367
+ end
368
+
342
369
  def validate_essential_attributes #:nodoc:
343
370
  errors = []
344
371
 
@@ -8,6 +8,7 @@ module ActiveMerchant #:nodoc:
8
8
  'visa' => ->(num) { num =~ /^4\d{12}(\d{3})?(\d{3})?$/ },
9
9
  'master' => ->(num) { num&.size == 16 && in_bin_range?(num.slice(0, 6), MASTERCARD_RANGES) },
10
10
  'elo' => ->(num) { num&.size == 16 && in_bin_range?(num.slice(0, 6), ELO_RANGES) },
11
+ 'cabal' => ->(num) { num&.size == 16 && in_bin_range?(num.slice(0, 8), CABAL_RANGES) },
11
12
  'alelo' => ->(num) { num&.size == 16 && in_bin_range?(num.slice(0, 6), ALELO_RANGES) },
12
13
  'discover' => ->(num) { num =~ /^(6011|65\d{2}|64[4-9]\d)\d{12,15}$/ },
13
14
  'american_express' => ->(num) { num =~ /^3[47]\d{13}$/ },
@@ -23,10 +24,9 @@ module ActiveMerchant #:nodoc:
23
24
  },
24
25
  'maestro_no_luhn' => ->(num) { num =~ /^(501080|501081|501082)\d{6,13}$/ },
25
26
  'forbrugsforeningen' => ->(num) { num =~ /^600722\d{10}$/ },
26
- 'sodexo' => ->(num) { num =~ /^(606071|603389|606070|606069|606068|600818)\d{10}$/ },
27
+ 'sodexo' => ->(num) { num =~ /^(606071|603389|606070|606069|606068|600818|505864|505865)\d{10}$/ },
27
28
  'alia' => ->(num) { num =~ /^(504997|505878|601030|601073|505874)\d{10}$/ },
28
29
  'vr' => ->(num) { num =~ /^(627416|637036)\d{10}$/ },
29
- 'cabal' => ->(num) { num&.size == 16 && in_bin_range?(num.slice(0, 8), CABAL_RANGES) },
30
30
  'unionpay' => ->(num) { (16..19).cover?(num&.size) && in_bin_range?(num.slice(0, 8), UNIONPAY_RANGES) },
31
31
  'carnet' => lambda { |num|
32
32
  num&.size == 16 && (
@@ -39,9 +39,18 @@ module ActiveMerchant #:nodoc:
39
39
  'creditel' => ->(num) { num =~ /^601933\d{10}$/ },
40
40
  'confiable' => ->(num) { num =~ /^560718\d{10}$/ },
41
41
  'synchrony' => ->(num) { num =~ /^700600\d{10}$/ },
42
- 'routex' => ->(num) { num =~ /^(700676|700678)\d{13}$/ }
42
+ 'routex' => ->(num) { num =~ /^(700676|700678)\d{13}$/ },
43
+ 'mada' => ->(num) { num&.size == 16 && in_bin_range?(num.slice(0, 6), MADA_RANGES) },
44
+ 'bp_plus' => ->(num) { num =~ /^(7050\d\s\d{9}\s\d{3}$|705\d\s\d{8}\s\d{5}$)/ },
45
+ 'passcard' => ->(num) { num =~ /^628026\d{10}$/ },
46
+ 'edenred' => ->(num) { num =~ /^637483\d{10}$/ },
47
+ 'anda' => ->(num) { num =~ /^603199\d{10}$/ },
48
+ 'tarjeta-d' => ->(num) { num =~ /^601828\d{10}$/ },
49
+ 'hipercard' => ->(num) { num&.size == 16 && in_bin_range?(num.slice(0, 6), HIPERCARD_RANGES) }
43
50
  }
44
51
 
52
+ SODEXO_NO_LUHN = ->(num) { num =~ /^(505864|505865)\d{10}$/ }
53
+
45
54
  # http://www.barclaycard.co.uk/business/files/bin_rules.pdf
46
55
  ELECTRON_RANGES = [
47
56
  [400115],
@@ -100,9 +109,9 @@ module ActiveMerchant #:nodoc:
100
109
  MAESTRO_BINS = Set.new(
101
110
  %w[ 500057
102
111
  501018 501043 501045 501047 501049 501051 501072 501075 501083 501087 501089 501095
103
- 501500
104
- 501879 502113 502301 503175
105
- 503645 503670
112
+ 501500 501623
113
+ 501879 502113 502120 502121 502301
114
+ 503175 503337 503645 503670
106
115
  504310 504338 504363 504533 504587 504620 504639 504656 504738 504781 504910
107
116
  507001 507002 507004 507082 507090
108
117
  560014 560565 561033
@@ -113,7 +122,7 @@ module ActiveMerchant #:nodoc:
113
122
  585274 585697
114
123
  586509
115
124
  588729 588792
116
- 589244 589407 589471 589605 589633 589647 589671
125
+ 589244 589407 589471 589605 589633 589647 589671 589916
117
126
  590043 590206 590263 590265 590278 590361 590362 590379 590393 590590
118
127
  591235 591420 591481 591620 591770 591948 591994
119
128
  592024 592161 592184 592186 592201 592384 592393 592528 592566 592704 592735 592879 592884
@@ -124,12 +133,16 @@ module ActiveMerchant #:nodoc:
124
133
  597077 597094 597143 597370 597410 597765 597855 597862
125
134
  598053 598054 598395 598585 598793 598794 598815 598835 598838 598880 598889
126
135
  599000 599069 599089 599148 599191 599310 599741 599742 599867
127
- 601070 601638
136
+ 601070 601452 601628 601638
137
+ 602648
138
+ 603326 603450 603689
128
139
  604983
129
140
  606126
130
- 636380 636422 636502 636639
131
- 637046 637756
132
- 639130 639229
141
+ 608710
142
+ 627339 627453 627454 627973
143
+ 636117 636380 636422 636502 636639
144
+ 637046 637529 637568 637600 637756
145
+ 639130 639229 639350
133
146
  690032]
134
147
  )
135
148
 
@@ -181,10 +194,10 @@ module ActiveMerchant #:nodoc:
181
194
  506745..506747, 506753..506753, 506774..506778, 509000..509007, 509009..509014,
182
195
  509020..509030, 509035..509042, 509044..509089, 509091..509101, 509104..509807,
183
196
  509831..509877, 509897..509900, 509918..509964, 509971..509986, 509995..509999,
184
- 627780..627780, 636368..636368, 650031..650033, 650035..650051, 650057..650081,
185
- 650406..650439, 650485..650504, 650506..650538, 650552..650598, 650720..650727,
186
- 650901..650922, 650928..650928, 650938..650939, 650946..650978, 651652..651704,
187
- 655000..655019, 655021..655057
197
+ 627780..627780, 636297..636298, 636368..636368, 650031..650033, 650035..650051,
198
+ 650057..650081, 650406..650439, 650485..650504, 650506..650538, 650552..650598,
199
+ 650720..650727, 650901..650922, 650928..650928, 650938..650939, 650946..650978,
200
+ 651652..651704, 655000..655019, 655021..655057
188
201
  ]
189
202
 
190
203
  # Alelo provides BIN ranges by e-mailing them out periodically.
@@ -204,7 +217,15 @@ module ActiveMerchant #:nodoc:
204
217
  CABAL_RANGES = [
205
218
  60420100..60440099,
206
219
  58965700..58965799,
207
- 60352200..60352299
220
+ 60352200..60352299,
221
+ 65027200..65027299,
222
+ 65008700..65008700
223
+ ]
224
+
225
+ MADA_RANGES = [
226
+ 504300..504300, 506968..506968, 508160..508160, 585265..585265, 588848..588848,
227
+ 588850..588850, 588982..588983, 589005..589005, 589206..589206, 604906..604906,
228
+ 605141..605141, 636120..636120, 968201..968209, 968211..968211
208
229
  ]
209
230
 
210
231
  NARANJA_RANGES = [
@@ -221,6 +242,11 @@ module ActiveMerchant #:nodoc:
221
242
  3528..3589, 3088..3094, 3096..3102, 3112..3120, 3158..3159, 3337..3349
222
243
  ]
223
244
 
245
+ HIPERCARD_RANGES = [
246
+ 384100..384100, 384140..384140, 384160..384160, 606282..606282, 637095..637095,
247
+ 637568..637568, 637599..637599, 637609..637609, 637612..637612
248
+ ]
249
+
224
250
  def self.included(base)
225
251
  base.extend(ClassMethods)
226
252
  end
@@ -295,7 +321,7 @@ module ActiveMerchant #:nodoc:
295
321
  def valid_number?(number)
296
322
  valid_test_mode_card_number?(number) ||
297
323
  valid_card_number_length?(number) &&
298
- valid_card_number_characters?(number) &&
324
+ valid_card_number_characters?(brand?(number), number) &&
299
325
  valid_by_algorithm?(brand?(number), number)
300
326
  end
301
327
 
@@ -362,8 +388,9 @@ module ActiveMerchant #:nodoc:
362
388
  number.length >= 12
363
389
  end
364
390
 
365
- def valid_card_number_characters?(number) #:nodoc:
391
+ def valid_card_number_characters?(brand, number) #:nodoc:
366
392
  return false if number.nil?
393
+ return number =~ /\A[0-9 ]+\Z/ if brand == 'bp_plus'
367
394
 
368
395
  !number.match(/\D/)
369
396
  end
@@ -373,20 +400,28 @@ module ActiveMerchant #:nodoc:
373
400
  %w[1 2 3 success failure error].include?(number)
374
401
  end
375
402
 
403
+ def sodexo_no_luhn?(numbers)
404
+ SODEXO_NO_LUHN.call(numbers)
405
+ end
406
+
376
407
  def valid_by_algorithm?(brand, numbers) #:nodoc:
377
408
  case brand
378
409
  when 'naranja'
379
410
  valid_naranja_algo?(numbers)
380
411
  when 'creditel'
381
412
  valid_creditel_algo?(numbers)
382
- when 'alia', 'confiable', 'maestro_no_luhn'
413
+ when 'alia', 'confiable', 'maestro_no_luhn', 'anda', 'tarjeta-d', 'hipercard'
383
414
  true
415
+ when 'sodexo'
416
+ sodexo_no_luhn?(numbers) ? true : valid_luhn?(numbers)
417
+ when 'bp_plus', 'passcard', 'edenred'
418
+ valid_luhn_non_zero_check_digit?(numbers)
384
419
  else
385
420
  valid_luhn?(numbers)
386
421
  end
387
422
  end
388
423
 
389
- ODD_LUHN_VALUE = {
424
+ BYTES_TO_DIGITS = {
390
425
  48 => 0,
391
426
  49 => 1,
392
427
  50 => 2,
@@ -400,7 +435,7 @@ module ActiveMerchant #:nodoc:
400
435
  nil => 0
401
436
  }.freeze
402
437
 
403
- EVEN_LUHN_VALUE = {
438
+ BYTES_TO_DIGITS_DOUBLED = {
404
439
  48 => 0, # 0 * 2
405
440
  49 => 2, # 1 * 2
406
441
  50 => 4, # 2 * 2
@@ -420,19 +455,40 @@ module ActiveMerchant #:nodoc:
420
455
  sum = 0
421
456
 
422
457
  odd = true
423
- numbers.reverse.bytes.each do |number|
458
+ numbers.reverse.bytes.each do |bytes|
424
459
  if odd
425
460
  odd = false
426
- sum += ODD_LUHN_VALUE[number]
461
+ sum += BYTES_TO_DIGITS[bytes]
427
462
  else
428
463
  odd = true
429
- sum += EVEN_LUHN_VALUE[number]
464
+ sum += BYTES_TO_DIGITS_DOUBLED[bytes]
430
465
  end
431
466
  end
432
467
 
433
468
  sum % 10 == 0
434
469
  end
435
470
 
471
+ def valid_luhn_with_check_digit?(numbers, check_digit)
472
+ sum = 0
473
+
474
+ doubler = true
475
+
476
+ numbers.reverse.bytes.each do |bytes|
477
+ doubler ? sum += BYTES_TO_DIGITS_DOUBLED[bytes] : sum += BYTES_TO_DIGITS[bytes]
478
+ doubler = !doubler
479
+ end
480
+
481
+ (10 - (sum % 10)) % 10 == check_digit.to_i
482
+ end
483
+
484
+ def valid_luhn_non_zero_check_digit?(numbers)
485
+ return valid_luhn?(numbers.delete(' ')) if numbers[5] == ' '
486
+
487
+ check_digit = numbers[-1]
488
+ luhn_payload = numbers.delete(' ').chop
489
+ valid_luhn_with_check_digit?(luhn_payload, check_digit)
490
+ end
491
+
436
492
  # Checks the validity of a card number by use of specific algorithms
437
493
  def valid_naranja_algo?(numbers) #:nodoc:
438
494
  num_array = numbers.to_s.chars.map(&:to_i)