activemerchant 1.121.0 → 1.125.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +217 -0
  3. data/README.md +1 -1
  4. data/lib/active_merchant/billing/check.rb +13 -19
  5. data/lib/active_merchant/billing/credit_card.rb +13 -0
  6. data/lib/active_merchant/billing/credit_card_formatting.rb +1 -0
  7. data/lib/active_merchant/billing/credit_card_methods.rb +24 -12
  8. data/lib/active_merchant/billing/gateway.rb +1 -1
  9. data/lib/active_merchant/billing/gateways/adyen.rb +75 -27
  10. data/lib/active_merchant/billing/gateways/authorize_net.rb +10 -8
  11. data/lib/active_merchant/billing/gateways/blue_pay.rb +29 -0
  12. data/lib/active_merchant/billing/gateways/blue_snap.rb +2 -2
  13. data/lib/active_merchant/billing/gateways/braintree_blue.rb +6 -3
  14. data/lib/active_merchant/billing/gateways/card_stream.rb +17 -13
  15. data/lib/active_merchant/billing/gateways/cashnet.rb +15 -5
  16. data/lib/active_merchant/billing/gateways/checkout_v2.rb +33 -4
  17. data/lib/active_merchant/billing/gateways/credorax.rb +2 -1
  18. data/lib/active_merchant/billing/gateways/cyber_source.rb +41 -6
  19. data/lib/active_merchant/billing/gateways/d_local.rb +12 -6
  20. data/lib/active_merchant/billing/gateways/decidir.rb +7 -1
  21. data/lib/active_merchant/billing/gateways/decidir_plus.rb +173 -0
  22. data/lib/active_merchant/billing/gateways/ebanx.rb +16 -1
  23. data/lib/active_merchant/billing/gateways/elavon.rb +65 -30
  24. data/lib/active_merchant/billing/gateways/element.rb +22 -2
  25. data/lib/active_merchant/billing/gateways/global_collect.rb +130 -26
  26. data/lib/active_merchant/billing/gateways/ipg.rb +416 -0
  27. data/lib/active_merchant/billing/gateways/kushki.rb +30 -0
  28. data/lib/active_merchant/billing/gateways/mercado_pago.rb +6 -3
  29. data/lib/active_merchant/billing/gateways/merchant_warrior.rb +2 -0
  30. data/lib/active_merchant/billing/gateways/mit.rb +260 -0
  31. data/lib/active_merchant/billing/gateways/moka.rb +290 -0
  32. data/lib/active_merchant/billing/gateways/monei.rb +228 -144
  33. data/lib/active_merchant/billing/gateways/mundipagg.rb +22 -11
  34. data/lib/active_merchant/billing/gateways/nmi.rb +29 -10
  35. data/lib/active_merchant/billing/gateways/orbital.rb +46 -8
  36. data/lib/active_merchant/billing/gateways/pay_arc.rb +392 -0
  37. data/lib/active_merchant/billing/gateways/pay_conex.rb +3 -1
  38. data/lib/active_merchant/billing/gateways/pay_trace.rb +404 -0
  39. data/lib/active_merchant/billing/gateways/payeezy.rb +4 -0
  40. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +1 -0
  41. data/lib/active_merchant/billing/gateways/payflow.rb +21 -4
  42. data/lib/active_merchant/billing/gateways/payment_express.rb +2 -2
  43. data/lib/active_merchant/billing/gateways/paymentez.rb +14 -2
  44. data/lib/active_merchant/billing/gateways/paysafe.rb +412 -0
  45. data/lib/active_merchant/billing/gateways/payu_latam.rb +9 -4
  46. data/lib/active_merchant/billing/gateways/payway_dot_com.rb +3 -3
  47. data/lib/active_merchant/billing/gateways/pin.rb +31 -4
  48. data/lib/active_merchant/billing/gateways/priority.rb +347 -0
  49. data/lib/active_merchant/billing/gateways/realex.rb +18 -0
  50. data/lib/active_merchant/billing/gateways/redsys.rb +35 -32
  51. data/lib/active_merchant/billing/gateways/safe_charge.rb +8 -2
  52. data/lib/active_merchant/billing/gateways/spreedly_core.rb +13 -4
  53. data/lib/active_merchant/billing/gateways/stripe.rb +27 -7
  54. data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +115 -39
  55. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +2 -1
  56. data/lib/active_merchant/billing/gateways/trust_commerce.rb +2 -1
  57. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +21 -7
  58. data/lib/active_merchant/billing/gateways/vpos.rb +49 -6
  59. data/lib/active_merchant/billing/gateways/wompi.rb +193 -0
  60. data/lib/active_merchant/billing/gateways/worldpay.rb +226 -62
  61. data/lib/active_merchant/billing/network_tokenization_credit_card.rb +1 -1
  62. data/lib/active_merchant/billing/response.rb +4 -0
  63. data/lib/active_merchant/billing/three_d_secure_eci_mapper.rb +27 -0
  64. data/lib/active_merchant/billing.rb +1 -0
  65. data/lib/active_merchant/version.rb +1 -1
  66. metadata +13 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d8bbedca7a5cfd13a87cfcfc7dd7b2eb59a73e6407e5e4df0d0247e9c7e70e0c
4
- data.tar.gz: 8ca081c01c837adae8a76bdc357c28753cd899cae9b4467b1c390048c4a2794f
3
+ metadata.gz: 9f8d0ad7bb54e228b44738e6cf324034467970e6709047a7f799dd7d3276998c
4
+ data.tar.gz: 96ab0828793d536f7df925fe962444c1cc0c48d129de54c19d40c81145ed1d11
5
5
  SHA512:
6
- metadata.gz: 2115a9d6a83597cef54510ce37cb4f3fbf7afecfc9c3662462c554b16e221fec07c1b6ffd622d2f103daf6b2eea7b03899b7a705d04118579833e1c548bb82ed
7
- data.tar.gz: 2c8c426554798d1f91ece60ea4de4013ba79283a0f2171c4e54976d2c561ad9e0f74ade0ca3af144f24596151ba82910f83ab42bf6c943acca32d97f366e8517
6
+ metadata.gz: 1a31f43e0702edeb5727c61285c54afeecc5accc6c9f89134966228fe9c08369f9918890ff25cda85ec863f3cda2bd1e2e6dde8f4eed1254ed6d520f37067dcd
7
+ data.tar.gz: 144dc89e223d28ceed1399b50d15116d169dc056f878bb9ba9ed477e4c141fde2c2bc25a882610e4295fa3a25fc8f63800034352b77eb3a370718ea64d017665
data/CHANGELOG CHANGED
@@ -1,7 +1,224 @@
1
+
1
2
  = ActiveMerchant CHANGELOG
2
3
 
3
4
  == HEAD
4
5
 
6
+ == Version 1.125.0 (January 20, 2022)
7
+ * Wompi: support gateway [therufs] #4173
8
+ * Stripe Payment Intents: Add setup_purchase [aenand] #4178
9
+ * Ipg: Add new gateway [ajawadmirza] #4171
10
+ * Worldpay: Adding support for google pay and apple pay [cristian] #4180
11
+ * Worldpay: Adding scrubbing for network token transactions [cristian] #4181
12
+ * SafeCharge: Add sg_NotUseCVV field [ajawadmirza] #4177
13
+ * PayULatam: Correctly map maestro and condensa card types [dsmcclain] #4182
14
+ * StripePaymentIntents: Refactor response for setup_purchase [aenand] #4183
15
+ * Wompi: cast error messages to JSON [therufs] #4186
16
+ * NMI: Omit initial_transaction_id for CIT [aenand] #4189
17
+ * Priority: Support Priority Payment Systems gateway [jessiagee] #4166
18
+ * GlobalCollect: Support for Lodging Data [naashton] #4190
19
+ * IPG: Add support for sub-merchant and recurring type fields [ajawadmirza] # 4188
20
+ * Wompi: Support `installments` option [therufs] #4192
21
+ * Stripe PI: add support for `fulfillment_date` and `event_type` [dsmcclain] #4193
22
+ * Paysafe: Adjust logic for sending 3DS field [meagabeth] #4194
23
+ * Priority: Fix unit test cases [ajawadmirza] #4195
24
+ * EBANX: New Gateway Specific Receiver [spreedly-kledoux] #4198
25
+ * Wompi: Don't send CVV field if no CVV provided [therufs] #4199
26
+ * Worldpay: cleaning order_id according to worldpay rules [cristian] #4197
27
+ * Paysafe: Concatenate credentials for headers [meagabeth] #4201
28
+ * Stripe Payment Intents: Add metadata to setup_purchase [aenand] #4202
29
+ * Priority: Add gateway standard changes [ajawadmirza] #4200
30
+ * IPG: Add support for payment by token [ajawadmirza] #4191
31
+ * Element (Vantiv Express): Add support for general credit [dsmcclain] #4203
32
+ * Worldpay: Update supported countries list, currencies [jherreraa] #4207
33
+ * StripePI: Adding countries available. [gasb150] #4208
34
+ * Orbital: Adding google pay payment tests for Orbital. [ajawadmirza] #4205
35
+ * Bug: Fixing supported countries method when there is inheritance involved [cristian] #4211
36
+ * Mundipagg: Update success method [ajawadmirza] #4210
37
+ * Worldpay: Add support for Visa Direct Fast Funds Credit [dsmcclain] #4212
38
+ * Paysafe: Add support for stored credentials [meagabeth] #4214
39
+ * Worldpay: Adding missing countries to supported countries [cristian] #4213
40
+ * Update institution numbers for Canadian banks [therufs] #4216
41
+ * Worldpay: Set default eCommerce indicator for EMVCO network tokens [shasum] #4215
42
+ * Update handling routing numbers for Canadian banks [therufs] #4217
43
+ * Stripe: API version updated [jherreraa] #4209
44
+ * Mercado Pago: Update verify method [ajawadmirza] #4219
45
+ * DLocal: Set API Version [gasb150] #4222
46
+ * Wompi: Add support for Authorize and Capture [rachelkirk] #4218
47
+ * Priority: Update source and billing address checks [jessiagee] #4220
48
+ * Pin Payments: Add support for `diners_club`, `discover`, and `jcb` cardtypes [montdidier] #4142
49
+ * USA ePay: Add store method [ajawadmirza] #4224
50
+ * IPG: Quick fix to remove warning [ajawadmirza] #4225
51
+ * Remove YAML warning on load_fixtures_method [jherreraa] #4226
52
+ * Worldpay: Add support for tokenizing payment methods with transaction identifiers [dsmcclain] #4227
53
+ * USA ePay: Update implementation to send valid authorization [ajawadmirza] #4231
54
+ * USA ePay: Add store test, update authorize param [jessiagee] #4232
55
+ * Stripe: Update destination test account [jherreraa] #4234
56
+ * Add skip_response option on request check for commit stubs [cristian] #4223
57
+ * Pin Payments: Add support for `void` and New Zealand to supported countries. [montdidier] #4144
58
+ * Wompi: Update authorization in `capture` method. [rachelkirk] #4238
59
+ * IPG: Update authorization to support `store` method token. [ajawadmirza] #4233
60
+ * Paymentez: Update card mappings [ajawadmirza] #4237
61
+ * Priority: Update parsing for error messages [jessiagee] #4245
62
+ * GlobalCollect: Support for Airline Data [naashton] #4187
63
+ * IPG: Add `tpv_error_code` and `tpv_error_msg` fields [ajawadmirza] #4241
64
+ * StripePI: Set restriction for Apple/Google Pay [jherreraa] #4247
65
+ * Cashnet: support multiple itemcodes and amounts [peteroas] #4243
66
+ * IPG: Send default currency in `verify` and two digit `ExpMonth` [ajawadmirza] #4244
67
+ * Stripe: Add remote tests set up to avoid exceed the max external accounts limit [jherreraa] #4239
68
+ * Stripe: Add support for `radar_options: skip_rules` [dsmcclain] #4250
69
+ * CyberSource: Add `user_po`, `taxable`, `national_tax_indicator`, `tax_amount`, and `national_tax` fields [ajawadmirza] #4251
70
+ * Kushki: Add support for `metadata` [rachelkirk] #4253
71
+ * IPG: Add `redact` operation [ajawadmirza] #4254
72
+ * Wompi: Update sandbox and production endpoints [rachelkirk] #4255
73
+ * Orbital: Add `sca_merchant_initiated` operation [ajawadmirza] #4256
74
+ * Cashnet: convert amounts to integers for proper gateway handling [peteroas] #2207
75
+ * PayTrace: Add `unstore` operation [ajawadmirza] #4262
76
+ * Decidir Plus: Add gateway adapter [naashton] #4264
77
+ * CheckoutV2: Add support for Apple Pay and Google Pay tokens [AMHOL] #4235
78
+ * Decidir Plus: Update payment reference [naashton] #4271
79
+ * Paysafe: Update redact method [meagabeth] #4269
80
+ * CyberSource: Add `line_items` field in authorize method [ajawadmirza] #4268
81
+ * CheckoutV2: Support processing channel and marketplace sub entity ID [AMHOL] #4236
82
+ * Elavon: `third_party_token` bug fix [rachelkirk] #4273
83
+ * Decidir Plus: Add `sub_payments` field [naashton] #4274
84
+ * Pin Payments: Add `unstore` support [montdidier] #4276
85
+ * Orbital: Add support for $0 verify [javierpedrozaing] #4275
86
+ * Update inline documentation with all supported cardtypes [ali-hassan] #4283
87
+ * PayWay: Update endpoints, response code [jessiagee] #4281
88
+ * CyberSource: Add `line_items` for purchase [ajawadmirza] #4282
89
+
90
+ == Version 1.124.0 (October 28th, 2021)
91
+ * Worldpay: Add Support for Submerchant Data on Worldpay [almalee24] #4147
92
+ * dlocal: Add device_id and ip to payer object and add additional_data [aenand] #4116
93
+ * Adyen: Add network tokenization support to Adyen gateway [mymir] #4101
94
+ * Adyen: Add ACH Support [almalee24] #4105
95
+ * Moka: Support 3DS endpoint and update test url [dsmcclain] #4110
96
+ * Paysafe: Adjust profile data [meagabeth] #4112
97
+ * Stripe Payment Intents: Add support for claim_without_transaction_id field [BritneyS] #4111
98
+ * Mit: Add New Gateway [EsporaInfra] #3820
99
+ * Routex: add card type [rachelkirk] #4115
100
+ * Orbital: Scrub Payment Cryptogram [naashton] #4121
101
+ * Paysafe: Add support for airline fields [meagabeth] #4120
102
+ * Stripe and Stripe PI: Add Radar Session Option [tatsianaclifton] #4119
103
+ * PayArc: Fix billing address nil and phone_number issues [dsmcclain] #4114
104
+ * Routex: Update BIN numbers [rachelkirk] #4123
105
+ * UnionPay: Add Stripe's UnionPay test card to UnionPay BIN range #4122
106
+ * GlobalCollect: Support URL override [naashton] #4127
107
+ * PayConex: scrub bank account info from transcripts [mbreenlyles] #4128
108
+ * Moka: Remove additional transaction data from subsequent calls [naashton] #4129
109
+ * Moka: Ensure CvcNumber can be an empty string [jessiagee] #4130
110
+ * Maestro: Allow more card lengths for Luhnless bins [therufs] #4131
111
+ * Paysafe: Update supported countries [meagabeth] #4135
112
+ * Paysafe: Update field mapping for split_pay [meagabeth] #4136
113
+ * SafeCharge: Add handling for non-fractional currencies [dsmcclain] #4137
114
+ * CardStream: Support passing country_code in request [dsmcclain] #4139
115
+ * Adyen: Adjust phone number mapping [aenand] #4138
116
+ * Mit: Change how parameters are converted to JSON [tatsianaclifton] #4140
117
+ * Stripe: Add account_number to scrubbing [aenand] #4145
118
+ * Stripe PI: add name on card to billing_details [dsmcclain] #4146
119
+ * TrustCommerce: Scrub bank account info [mbreenlyles] #4149
120
+ * TransFirst: Scrub account number [aenand] #4152
121
+ * Paysafe: Update supported countries list [meagabeth] #4154
122
+ * dLocal: Update supported countries list [mbreenlyles] #4155
123
+ * SafeCharge: Add support for email field in capture [rachelkirk] #4153
124
+ * Paysafe: Remove invalid code [meagabeth] #4156
125
+ * NMI: Add descriptor fields [ajawadmirza] #4157
126
+ * Authorize.net: Add tests for scrubbing banking account info (in addition to BluePay, BridgePay, Forte, HPS, and Vanco Gateways)[aenand] #4159
127
+ * Moka: Send refund amount with decimal [dsmcclain] #4160
128
+ * GlobalCollect: Append URI to the URL [naashton] #4162
129
+ * Adyen: Add application info fields [aenand] #4163
130
+ * Adyen: Send NTID from stored cred hash [curiousepic] #4164
131
+ * Payflow: use proper case for 3DS 2.x element names [bbraschi] #4113
132
+ * Realex: Add support for stored credentials [dsmcclain] #4170
133
+ * Moka: Add support for InstallmentNumber field [dsmcclain] #4172
134
+ * Payflow: include AuthenticationStatus for 3DS 2.x [bbraschi] #4168
135
+
136
+ == Version 1.123.0 (September 10th, 2021)
137
+ * Paysafe: Add gateway integration [meagabeth] #4085
138
+ * Elavon: Support recurring transactions with stored credentials [cdmackeyfree] #4086
139
+ * Orbital: Truncate three_d_secure[:version] [carrigan] #4087
140
+ * Credorax: Determine ISK decimal by datetime [curiousepic] #4088
141
+ * Moka: support new gateway type [dsmcclain] #4089
142
+ * Paymentez: Add more_info field [reblevins] #4091
143
+ * Worldpay: Support $0 auth [therufs] #4092
144
+ * Elavon: Support recurring transactions with token, revert stored credentials recurring [cdmackeyfree] #4089
145
+ * SafeCharge(Nuvei): Add support for product_id [rachelkirk] #4095
146
+ * NMI: Change cardholder_auth 3DS field population [carrigan] #4094
147
+ * Synchrony: add card type [therufs] #4096
148
+ * Maestro: support BINs without Luhn check [therufs] #4097
149
+ * Maestro: support BINs [therufs] #4098
150
+ * Redsys: Route MIT Exemptions to webservice endpoint [curiousepic] #4081
151
+ * Adyen: Update Classic Integration API to v64 and Recurring API to v49 [almalee24] #4090
152
+ * Payeezy: support soft_descriptor and merchant_ref [cdmackeyfree] #4099
153
+ * Elavon: add ssl_token field [cdmackeyfree] #4100
154
+ * Credorax: Remove special logic for ISK [curiousepic] #4102
155
+ * UnionPay: Pull UnionPay's 62* BIN ranges out of Discover's #4103
156
+ * Monei: Update Creation of Billing Details [tatsianaclifton] #4107
157
+ * Monei: Typo Correction on Billing Details [tatsianaclifton] #4108
158
+ * Paysafe: Add support for 3DS [meagabeth] #4109
159
+
160
+ == Version 1.122.0 (August 3rd, 2021)
161
+ * Orbital: Correct success logic for refund [tatsianaclifton] #4014
162
+ * usaepay: Added pin gateway setting [DustinHaefele] #4026
163
+ * MercadoPago: Added external_reference, more payer object options, and metadata field [DustinHaefele] #4020
164
+ * Element: Add duplicate_override_flag [almalee24] #4012
165
+ * PayTrace: Support gateway [meagabeth] #3985
166
+ * vPOS: Support credit + refund [therufs] #3998
167
+ * PayArc: Support gateway [senthil-code] #3974
168
+ * NMI: Support cardholder_auth field for 3DS2 [cdmackeyfree] #4002
169
+ * Confiable: Support cardtype [therufs] #4004
170
+ * Maestro: Add BIN [therufs] #4003
171
+ * PayULatam: Ensure phone number is pulled from shipping_address correctly [dsmcclain] #4005
172
+ * SafeCharge: Add challenge_preference for 3DS [klaiv] #3999
173
+ * Adyen: Pass networkTxReference in all transactions [naashton] #4006
174
+ * Adyen: Ensure correct transaction reference is selected [dsmcclain] #4007
175
+ * PayTrace: Support level_3_data fields [meagabeth] #4008
176
+ * BluePay: Add support for Stored Credentials [dsmcclain] #4009
177
+ * Orbital: Add support for SCARecurringPayment [jessiagee] #4010
178
+ * Braintree: Support recurring_first and moto reasons [curiousepic] #4013
179
+ * PayTrace: Adjust capture method [meagabeth] #4015
180
+ * BarclaysEpdqExtraPlus: updated custom_eci test + remote tests [yyapuncich] #4022
181
+ * CyberSource: Add customerID field [deemeyers] #4025
182
+ * CyberSource: Adjust Auth [naashton] #3956
183
+ * Valid Canadian Institution Numbers [naashton] #4024
184
+ * PayTrace: Adjust purchase and capture methods to handle MultiResponse scenarios [meagabeth] #4027
185
+ * Payflow: Add support for MERCHDESCR field [rachelkirk] #4028
186
+ * PayTrace: Support $0 authorize in verify method [meagabeth] #4030
187
+ * PayArc: Add error_code in response [cdm-83] #4021
188
+ * Update bank routing account validation check [jessiagee] #4029
189
+ * Kushki: Add 'contactDetails' fields [mbreenlyles] #4033
190
+ * Adyen: Truncating order_id and remote test [yyapuncich] #4036
191
+ * CyberSource: Allow string content for Ignore AVS/CVV flags [curiousepic] #4043
192
+ * Decidir: Update validation error message handling [arbianchi] #4042
193
+ * Authorize.net: Remove cardholderAuthentication for non-3DS transactions [BritneyS] #4045
194
+ * BlueSnap: Handle 429 errors [britth] #4044
195
+ * Orbital: Update unit test files [meagabeth] #4046
196
+ * Orbital: Strip null characters from responses [britth] #4041
197
+ * Merchant Warrior: Handle invalid XML responses [arbianchi] #4047
198
+ * Braintree: Fix NoMethodError for failed card verification [molbrown] #4048
199
+ * Worldpay: Accepting 3DS1 and 3DS2 authentication data from external MPI [chandan-PS] #4017
200
+ * PayArc: Currency and parameters updates [jessiagee] #4051
201
+ * Elavon: Add support for special characters [mbreenlyles] #4049
202
+ * PayArc: Formatting CC month, adding tax_rate, removing default void reason [jessiagee] #4053
203
+ * Kushki: Add support for fullResponse field [rachelkirk] #4057
204
+ * Element: Add support for `MerchantDescriptor` field [BritneyS] #4058
205
+ * PayArc: Added email and phone to credit and charge [jessiagee] #4056
206
+ * Mundipagg: Added support for 'authentication_secret_key' for 'api_key' overwrite [DustinHaefele] #4059
207
+ * Payflow: Raise an error if store method is called [dsmcclain] #4066
208
+ * Monei: JSON API implementation [jimmyn] #3613
209
+ * Maestro: Update BINs [therufs] #4067
210
+ * Monei: Change domain to monei.com [jimmyn] #4068
211
+ * Spreedly: Support gateway_specific_response_fields in response params [abarrak] #4064
212
+ * Payeezy: Add support for `add_soft_descriptors` [rachelkirk] #4069
213
+ * Stripe Payment Intents: Add support for network_transaction_id field [cdmackeyfree] #4060
214
+ * Worldpay: Support 'CAPTURED' response for authorize transactions [naashton] #4070
215
+ * Ingenico (Global Collect): New idempotence key header [BritneyS] #4073
216
+ * PayTrace: Adjust handling of line_items subfields [meagabeth] #4074
217
+ * Worldpay: Correct Expiration Year Format [tatsianaclifton] #4076
218
+ * Monei: Improve Scrub Regex [tatsianaclifton] #4072
219
+ * Payflow: add THREEDSVERSION and DSTRANSACTIONID when present [bbraschi] #4075
220
+ * CT Payments: update remote tests [cdmackeyfree] #3947
221
+ * Orbital: Ensure full e-check scrubbing [mbreenlyles] #4079
5
222
 
6
223
  == Version 1.121 (June 8th, 2021)
7
224
  * Braintree: Lift restriction on gem version to allow for backwards compatibility [naashton] #3993
data/README.md CHANGED
@@ -160,7 +160,7 @@ The [ActiveMerchant Wiki](https://github.com/activemerchant/active_merchant/wiki
160
160
  * [Metrics Global](http://www.metricsglobal.com) - US
161
161
  * [MasterCard Internet Gateway Service (MiGS)](http://mastercard.com/mastercardsps) - AU, AE, BD, BN, EG, HK, ID, IN, JO, KW, LB, LK, MU, MV, MY, NZ, OM, PH, QA, SA, SG, TT, VN
162
162
  * [Modern Payments](http://www.modpay.com) - US
163
- * [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
163
+ * [MONEI](http://www.monei.com/) - 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
164
164
  * [Moneris](http://www.moneris.com/) - CA
165
165
  * [MoneyMovers](http://mmoa.us/) - US
166
166
  * [NAB Transact](http://transact.nab.com.au) - AU
@@ -14,11 +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)
18
- 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
21
- 865 879 889 899
17
+ # Partial list found here: https://en.wikipedia.org/wiki/Routing_number_(Canada)
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
21
+ 865 879 889 899 241 242 248 250 265 275 277 290 294 301 303 307 311 314
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
22
24
  )
23
25
 
24
26
  def name
@@ -64,22 +66,14 @@ module ActiveMerchant #:nodoc:
64
66
  # See http://en.wikipedia.org/wiki/Routing_transit_number#Internal_checksums
65
67
  def valid_routing_number?
66
68
  digits = routing_number.to_s.split('').map(&:to_i).select { |d| (0..9).cover?(d) }
67
- case digits.size
68
- when 9
69
+ if digits.size == 9
69
70
  checksum = ((3 * (digits[0] + digits[3] + digits[6])) +
70
- (7 * (digits[1] + digits[4] + digits[7])) +
71
- (digits[2] + digits[5] + digits[8])) % 10
72
- case checksum
73
- when 0
74
- true
75
- else
76
- false
77
- end
78
- when 8
79
- true if INSTITUTION_NUMBERS.include?(routing_number[0..2].to_s)
80
- else
81
- false
71
+ (7 * (digits[1] + digits[4] + digits[7])) +
72
+ (digits[2] + digits[5] + digits[8])) % 10
73
+
74
+ return checksum == 0 || CAN_INSTITUTION_NUMBERS.include?(routing_number[1..3])
82
75
  end
76
+ false
83
77
  end
84
78
  end
85
79
  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
@@ -25,6 +30,8 @@ module ActiveMerchant #:nodoc:
25
30
  # * UnionPay
26
31
  # * Alia
27
32
  # * Olimpica
33
+ # * Creditel
34
+ # * Confiable
28
35
  #
29
36
  # For testing purposes, use the 'bogus' credit card brand. This skips the vast majority of
30
37
  # validations, allowing you to focus on your core concerns until you're ready to be more concerned
@@ -95,6 +102,11 @@ module ActiveMerchant #:nodoc:
95
102
  # * +'dankort'+
96
103
  # * +'maestro'+
97
104
  # * +'forbrugsforeningen'+
105
+ # * +'sodexo'+
106
+ # * +'vr'+
107
+ # * +'carnet'+
108
+ # * +'synchrony'+
109
+ # * +'routex'+
98
110
  # * +'elo'+
99
111
  # * +'alelo'+
100
112
  # * +'cabal'+
@@ -103,6 +115,7 @@ module ActiveMerchant #:nodoc:
103
115
  # * +'alia'+
104
116
  # * +'olimpica'+
105
117
  # * +'creditel'+
118
+ # * +'confiable'+
106
119
  #
107
120
  # Or, if you wish to test your implementation, +'bogus'+.
108
121
  #
@@ -15,6 +15,7 @@ module ActiveMerchant #:nodoc:
15
15
  case option
16
16
  when :two_digits then sprintf('%.2i', number.to_i)[-2..-1]
17
17
  when :four_digits then sprintf('%.4i', number.to_i)[-4..-1]
18
+ when :four_digits_year then number.to_s.length == 2 ? '20' + number.to_s : format(number, :four_digits)
18
19
  else number
19
20
  end
20
21
  end
@@ -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.
@@ -7,11 +9,11 @@ module ActiveMerchant #:nodoc:
7
9
  'master' => ->(num) { num&.size == 16 && in_bin_range?(num.slice(0, 6), MASTERCARD_RANGES) },
8
10
  'elo' => ->(num) { num&.size == 16 && in_bin_range?(num.slice(0, 6), ELO_RANGES) },
9
11
  'alelo' => ->(num) { num&.size == 16 && in_bin_range?(num.slice(0, 6), ALELO_RANGES) },
10
- 'discover' => ->(num) { num =~ /^(6011|65\d{2}|64[4-9]\d)\d{12,15}|(62\d{14,17})$/ },
12
+ 'discover' => ->(num) { num =~ /^(6011|65\d{2}|64[4-9]\d)\d{12,15}$/ },
11
13
  'american_express' => ->(num) { num =~ /^3[47]\d{13}$/ },
12
14
  'naranja' => ->(num) { num&.size == 16 && in_bin_range?(num.slice(0, 6), NARANJA_RANGES) },
13
15
  'diners_club' => ->(num) { num =~ /^3(0[0-5]|[68]\d)\d{11,16}$/ },
14
- 'jcb' => ->(num) { num =~ /^(35(28|29|[3-8]\d)\d{12}|308800\d{10})$/ },
16
+ 'jcb' => ->(num) { num&.size == 16 && in_bin_range?(num.slice(0, 4), JCB_RANGES) },
15
17
  'dankort' => ->(num) { num =~ /^5019\d{12}$/ },
16
18
  'maestro' => lambda { |num|
17
19
  (12..19).cover?(num&.size) && (
@@ -19,6 +21,7 @@ module ActiveMerchant #:nodoc:
19
21
  MAESTRO_BINS.any? { |bin| num.slice(0, bin.size) == bin }
20
22
  )
21
23
  },
24
+ 'maestro_no_luhn' => ->(num) { num =~ /^(501080|501081|501082)\d{6,13}$/ },
22
25
  'forbrugsforeningen' => ->(num) { num =~ /^600722\d{10}$/ },
23
26
  'sodexo' => ->(num) { num =~ /^(606071|603389|606070|606069|606068|600818)\d{10}$/ },
24
27
  'alia' => ->(num) { num =~ /^(504997|505878|601030|601073|505874)\d{10}$/ },
@@ -32,7 +35,10 @@ module ActiveMerchant #:nodoc:
32
35
  )
33
36
  },
34
37
  'olimpica' => ->(num) { num =~ /^636853\d{10}$/ },
35
- 'creditel' => ->(num) { num =~ /^601933\d{10}$/ }
38
+ 'creditel' => ->(num) { num =~ /^601933\d{10}$/ },
39
+ 'confiable' => ->(num) { num =~ /^560718\d{10}$/ },
40
+ 'synchrony' => ->(num) { num =~ /^700600\d{10}$/ },
41
+ 'routex' => ->(num) { num =~ /^(700676|700678)\d{13}$/ }
36
42
  }
37
43
 
38
44
  # http://www.barclaycard.co.uk/business/files/bin_rules.pdf
@@ -81,7 +87,7 @@ module ActiveMerchant #:nodoc:
81
87
 
82
88
  MAESTRO_BINS = Set.new(
83
89
  %w[ 500057
84
- 501018 501043 501045 501047 501049 501051 501072 501075 501087 501089 501095
90
+ 501018 501043 501045 501047 501049 501051 501072 501075 501083 501087 501089 501095
85
91
  501500
86
92
  501879 502113 502301 503175
87
93
  503645 503670
@@ -106,7 +112,7 @@ module ActiveMerchant #:nodoc:
106
112
  597077 597094 597143 597370 597410 597765 597855 597862
107
113
  598053 598054 598395 598585 598793 598794 598815 598835 598838 598880 598889
108
114
  599000 599069 599089 599148 599191 599310 599741 599742 599867
109
- 601070
115
+ 601070 601638
110
116
  604983
111
117
  606126
112
118
  636380 636422 636502 636639
@@ -115,7 +121,7 @@ module ActiveMerchant #:nodoc:
115
121
  690032]
116
122
  )
117
123
 
118
- # https://www.mastercard.us/content/dam/mccom/global/documents/mastercard-rules.pdf, page 73
124
+ # https://www.mastercard.us/content/dam/mccom/global/documents/mastercard-rules.pdf, page 79
119
125
  MAESTRO_RANGES = [
120
126
  (500032..500033),
121
127
  (501015..501016),
@@ -125,17 +131,20 @@ module ActiveMerchant #:nodoc:
125
131
  (501053..501058),
126
132
  (501060..501063),
127
133
  (501066..501067),
128
- (501080..501083),
129
134
  (501091..501092),
130
135
  (501104..501105),
131
136
  (501107..501108),
132
137
  (501104..501105),
133
138
  (501107..501108),
139
+ (501800..501899),
140
+ (502000..502099),
141
+ (503800..503899),
134
142
  (561200..561269),
135
143
  (561271..561299),
136
144
  (561320..561356),
137
145
  (581700..581751),
138
146
  (581753..581800),
147
+ (589300..589399),
139
148
  (589998..591259),
140
149
  (591261..596770),
141
150
  (596772..598744),
@@ -149,6 +158,7 @@ module ActiveMerchant #:nodoc:
149
158
  (601640..601652),
150
159
  (601689..601700),
151
160
  (602011..602050),
161
+ (630400..630499),
152
162
  (639000..639099),
153
163
  (670000..679999),
154
164
  ]
@@ -189,14 +199,16 @@ module ActiveMerchant #:nodoc:
189
199
  589562..589562
190
200
  ]
191
201
 
192
- # In addition to the BIN ranges listed here that all begin with 81, UnionPay cards
193
- # include many ranges that start with 62.
194
- # Prior to adding UnionPay, cards that start with 62 were all classified as Discover.
195
- # Because UnionPay cards are able to run on Discover rails, this was kept the same.
202
+ # https://www.discoverglobalnetwork.com/content/dam/discover/en_us/dgn/pdfs/IPP-VAR-Enabler-Compliance.pdf
196
203
  UNIONPAY_RANGES = [
204
+ 62000000..62000000, 62212600..62379699, 62400000..62699999, 62820000..62889999,
197
205
  81000000..81099999, 81100000..81319999, 81320000..81519999, 81520000..81639999, 81640000..81719999
198
206
  ]
199
207
 
208
+ JCB_RANGES = [
209
+ 3528..3589, 3088..3094, 3096..3102, 3112..3120, 3158..3159, 3337..3349
210
+ ]
211
+
200
212
  def self.included(base)
201
213
  base.extend(ClassMethods)
202
214
  end
@@ -355,7 +367,7 @@ module ActiveMerchant #:nodoc:
355
367
  valid_naranja_algo?(numbers)
356
368
  when 'creditel'
357
369
  valid_creditel_algo?(numbers)
358
- when 'alia'
370
+ when 'alia', 'confiable', 'maestro_no_luhn'
359
371
  true
360
372
  else
361
373
  valid_luhn?(numbers)
@@ -162,7 +162,7 @@ module ActiveMerchant #:nodoc:
162
162
  end
163
163
 
164
164
  def self.supported_countries
165
- @supported_countries ||= []
165
+ @supported_countries ||= (self.superclass.supported_countries || [])
166
166
  end
167
167
 
168
168
  def supported_countries