activemerchant 1.90.0 → 1.99.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +202 -0
  3. data/README.md +6 -2
  4. data/lib/active_merchant/billing/avs_result.rb +4 -5
  5. data/lib/active_merchant/billing/credit_card.rb +8 -0
  6. data/lib/active_merchant/billing/credit_card_methods.rb +81 -5
  7. data/lib/active_merchant/billing/gateway.rb +10 -0
  8. data/lib/active_merchant/billing/gateways/adyen.rb +206 -54
  9. data/lib/active_merchant/billing/gateways/bambora_apac.rb +226 -0
  10. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +43 -10
  11. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +3 -0
  12. data/lib/active_merchant/billing/gateways/beanstream.rb +11 -6
  13. data/lib/active_merchant/billing/gateways/blue_pay.rb +10 -8
  14. data/lib/active_merchant/billing/gateways/blue_snap.rb +211 -36
  15. data/lib/active_merchant/billing/gateways/bpoint.rb +4 -4
  16. data/lib/active_merchant/billing/gateways/braintree_blue.rb +79 -18
  17. data/lib/active_merchant/billing/gateways/card_connect.rb +6 -1
  18. data/lib/active_merchant/billing/gateways/cecabank.rb +20 -9
  19. data/lib/active_merchant/billing/gateways/checkout_v2.rb +98 -61
  20. data/lib/active_merchant/billing/gateways/credorax.rb +69 -4
  21. data/lib/active_merchant/billing/gateways/cyber_source.rb +85 -14
  22. data/lib/active_merchant/billing/gateways/d_local.rb +3 -3
  23. data/lib/active_merchant/billing/gateways/decidir.rb +245 -0
  24. data/lib/active_merchant/billing/gateways/elavon.rb +9 -0
  25. data/lib/active_merchant/billing/gateways/epay.rb +13 -2
  26. data/lib/active_merchant/billing/gateways/eway_rapid.rb +42 -12
  27. data/lib/active_merchant/billing/gateways/fat_zebra.rb +26 -7
  28. data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +42 -3
  29. data/lib/active_merchant/billing/gateways/global_collect.rb +3 -7
  30. data/lib/active_merchant/billing/gateways/hps.rb +46 -1
  31. data/lib/active_merchant/billing/gateways/ipp.rb +1 -0
  32. data/lib/active_merchant/billing/gateways/kushki.rb +1 -1
  33. data/lib/active_merchant/billing/gateways/litle.rb +61 -3
  34. data/lib/active_merchant/billing/gateways/mastercard.rb +30 -5
  35. data/lib/active_merchant/billing/gateways/mercado_pago.rb +1 -1
  36. data/lib/active_merchant/billing/gateways/migs.rb +8 -0
  37. data/lib/active_merchant/billing/gateways/monei.rb +31 -0
  38. data/lib/active_merchant/billing/gateways/moneris.rb +3 -4
  39. data/lib/active_merchant/billing/gateways/mundipagg.rb +37 -9
  40. data/lib/active_merchant/billing/gateways/nab_transact.rb +1 -1
  41. data/lib/active_merchant/billing/gateways/netbanx.rb +4 -0
  42. data/lib/active_merchant/billing/gateways/nmi.rb +45 -5
  43. data/lib/active_merchant/billing/gateways/openpay.rb +1 -1
  44. data/lib/active_merchant/billing/gateways/opp.rb +20 -1
  45. data/lib/active_merchant/billing/gateways/orbital.rb +92 -11
  46. data/lib/active_merchant/billing/gateways/payflow.rb +64 -14
  47. data/lib/active_merchant/billing/gateways/payment_express.rb +7 -0
  48. data/lib/active_merchant/billing/gateways/paymentez.rb +7 -11
  49. data/lib/active_merchant/billing/gateways/paymill.rb +5 -0
  50. data/lib/active_merchant/billing/gateways/paypal.rb +14 -1
  51. data/lib/active_merchant/billing/gateways/paypal_express.rb +3 -1
  52. data/lib/active_merchant/billing/gateways/payu_latam.rb +6 -2
  53. data/lib/active_merchant/billing/gateways/pin.rb +19 -6
  54. data/lib/active_merchant/billing/gateways/pro_pay.rb +1 -1
  55. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +7 -1
  56. data/lib/active_merchant/billing/gateways/qvalent.rb +54 -1
  57. data/lib/active_merchant/billing/gateways/realex.rb +42 -5
  58. data/lib/active_merchant/billing/gateways/redsys.rb +113 -30
  59. data/lib/active_merchant/billing/gateways/spreedly_core.rb +43 -29
  60. data/lib/active_merchant/billing/gateways/stripe.rb +66 -34
  61. data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +271 -0
  62. data/lib/active_merchant/billing/gateways/tns.rb +10 -5
  63. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +5 -5
  64. data/lib/active_merchant/billing/gateways/trust_commerce.rb +46 -6
  65. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +19 -8
  66. data/lib/active_merchant/billing/gateways/visanet_peru.rb +22 -10
  67. data/lib/active_merchant/billing/gateways/worldpay.rb +237 -34
  68. data/lib/active_merchant/country.rb +2 -1
  69. data/lib/active_merchant/version.rb +1 -1
  70. metadata +20 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0966806ab488c5e7ce61def32caf6d697a360f41e8044398309b58e3318396b0'
4
- data.tar.gz: 9793482a76e42cfab91c5918153f629c66fdfccbaeff49489eb06a9d97d892bb
3
+ metadata.gz: cbb76da56e87639a3f9129d70297b78a0edabe9faf2300e682e06e872e019419
4
+ data.tar.gz: 94cb0693e867b03071fe55a7e71b3cfbaf53a7c340d480f24108948822e9e1e7
5
5
  SHA512:
6
- metadata.gz: 7a852cfc08faedf04bac009e0facd471e8387882b2e340ba9428bb71c67b8480cedd626ca6a663262f0269d7c42923caec65c8e0e23ad6980346763a4739a234
7
- data.tar.gz: cc5a90ebd00682fda94ab7898529570ca0fce25f23cb1d1049b2055feedbcf1fe172ec0fed2712f9a1b04ee4c18747297f389079fae0ca281f3110aa68bcad0a
6
+ metadata.gz: aa96ed1337c57fa00d0405ff07a70b9423bac6a26ec69fde450d73bc9cabfc0ae27b75a46faddcdf3e79f2198db8214e8e6c5926468f0acb999bef43fc220a73
7
+ data.tar.gz: f672640992309d545629a41e4f89d505732d0bb88559648a96935ef01293bcff737de41c8a7b8992993dafdfdb71d29bcbf8b85133c3d9ae5311f7b720b7c9c7
data/CHANGELOG CHANGED
@@ -1,6 +1,207 @@
1
1
  = ActiveMerchant CHANGELOG
2
2
 
3
3
  == HEAD
4
+ == Version 1.99.0 (Sep 26, 2019)
5
+ * Adyen: Add functionality to set 3DS exemptions via API [britth] #3331
6
+ * Adyen: Send "NA" instead of "N/A" [leila-alderman] #3339
7
+ * Stripe Payment Intents: Set application fee or transfer amount on capture [britth] #3340
8
+ * TNS: Support Europe endpoint [curiousepic] #3346
9
+ * Redsys: Add 3DS support to gateway [britth] #3336
10
+ * Worldpay: Allow multiple refunds per authorization [jknipp] #3349
11
+ * MercadoPago: Add remote and unit tests for Naranja card [hdeters] #3345
12
+ * CyberSource: Pass commerce indicator if present [curiousepic] #3350
13
+ * Worldpay: Add 3DS2 Support [nfarve] #3344
14
+ * Credorax: Add 3DS 2.0 [nfarve] #3342
15
+ * TNS: Update verison and support pay mode [curiousepic] #3355
16
+ * Stripe: Add supported countries [therufs] #3358
17
+ * Stripe Payment Intents: Add supported countries [therufs] #3359
18
+ * Mundipagg: Append error messages to the message response field [jasonxp] #3353
19
+ * Redsys: Add ability to pass sca_exemption and moto fields to request exemptions [britth] #3354
20
+ * Credorax: Add A Mandatory 3DS field [nfarve] #3360
21
+ * CyberSource: Support 3DS2 pass-through fields [curiousepic] #3363
22
+ * Credorax: Add support for MOTO flagging [britth] #3366
23
+ * Credorax: Enable selecting a processor [leila-alderman] #3302
24
+ * Adyen: Add Cabal card [leila-alderman] #3361
25
+ * Decidir: Add remote tests for Cabal and Naranja [leila-alderman] #3337
26
+ * Payflow: Pass correct field in Status for 3DS in Payflow [nebdil] #3362
27
+ * CyberSource: Use 3DS hash for enrolled field [curiousepic] #3371
28
+
29
+ == Version 1.98.0 (Sep 9, 2019)
30
+ * Stripe Payment Intents: Add new gateway [britth] #3290
31
+ * Stripe: Send cardholder name and address when creating sources for 3DS 1.0 [jknipp] #3300
32
+ * Checkout_v2: Support for native 3DS2.0 [nfarve] #3303
33
+ * Adds new Maestro BINs [tanyajajodia] #3305
34
+ * eWAY Rapid: If no address is available, default to the name associated with the payment method when setting the Customer fields [jasonxp] #3306
35
+ * eWAY Rapid: Fix a bug in which the email was not set in Customer fields if no address was provided [jasonxp] #3306
36
+ * eWAY Rapid: Support both `phone` and `phone_number` fields under the `shipping_address` option [jasonxp] #3306
37
+ * PayU Latam: Add support for the `merchant_buyer_id` field in the `options` and `buyer` hashes [jasonxp] #3308
38
+ * Update Braintree Gem [curiousepic] #3311
39
+ * Fat Zebra: Send metadata for purchase and authorize [montdidier] #3101
40
+ * TrustCommerce: Add support for custom fields [jasonxp] #3313
41
+ * Stripe Payment Intents: Support option fields `transfer_destination` and `transfer_amount` and remove `transfer_data` hash [britth] #3317
42
+ * Barclaycard Smartpay: Add support for `shopperStatement` gateway-specific field [jasonxp] #3319
43
+ * Stripe Payment Intents: Add support for billing_details on payment methods [britth] #3320
44
+ * BlueSnap: add standardized 3DS 2 auth fields [bayprogrammer] #3318
45
+ * Barclaycard Smartpay: Add app based 3DS requests for auth and purchase [britth] #3327
46
+ * Stripe Payment Intents, Checkout V2: Add support for `MOTO` flagging [britth] #3323
47
+ * Braintree Blue: Adding 3DS2 passthru support [molbrown] #3328
48
+ * Global Collect: Add Cabal card [leila-alderman] #3310
49
+ * WorldPay: Add Cabal card [leila-alderman] #3316
50
+ * Decidir: Add Cabal card [leila-alderman] #3322
51
+ * PayU Latam: Add Cabal card [leila-alderman] #3324
52
+ * dLocal: Add Cabal card [leila-alderman] #3325
53
+ * BlueSnap: Add Cabal card [leila-alderman] #3326
54
+ * Adyen: added 3DS support through external [rikterbeek] #3294
55
+ * Worldpay: Add support for MOTO flagging [britth] #3329
56
+ * ePay: 3DS support [AllaWLie] #3321
57
+ * Checkout.com: added options[:metadata][:manual_entry] support for MOTO transactions [filipebarcos] #3330
58
+
59
+ == Version 1.97.0 (Aug 15, 2019)
60
+ * CyberSource: Add issuer `additionalData` gateway-specific field [jasonxp] #3296
61
+ * PayU Latam: Add Naranja card type [hdeters] #3299
62
+ * Adyen: Add app based 3DS requests for auth and purchase [jeremywrowe] #3298
63
+ * MercadoPago: Add Cabal card type [leila-alderman] #3295
64
+ * MONEI: Add external MPI 3DS 1 support [jimmyn] #3292
65
+ * Bambora formerly Beanstream: Pass card owner when storing tokenized cards [alexdunae] #3006
66
+ * Realex: Prevent error calculating `refund_hash` or `credit_hash` when the secret is nil [jasonxp] #3291
67
+ * Orbital: Add external MPI support for 3DS1 [pi3r] #3261
68
+ * Paymill: Add currency and amount to store requests [jasonxp] #3289
69
+ * Realex: Re-implement credit as general credit [leila-alderman] #3280
70
+ * Braintree Blue: Support for stored credentials [hdeters] #3286
71
+ * CardConnect: Move domain from gateway specific to gateway field [hdeters] #3283
72
+
73
+ == Version 1.96.0 (Jul 26, 2019)
74
+ * Bluesnap: Omit state codes for unsupported countries [therufs] #3229
75
+ * Adyen: Pass updateShopperStatement, industryUsage [curiousepic] #3233
76
+ * TransFirst Transaction Express: Fix blank address2 values [britth] #3231
77
+ * WorldPay: Add support for store method [bayprogrammer] #3232
78
+ * Adyen: Support for additional AVS code mapping [jknipp] #3236
79
+ * Adyen: Update message for AVS result code 'A' to generically cover postal code mismatches [jknipp] #3237
80
+ * CyberSource: Update CyberSource SOAP documentation link [vince-smith] #3204
81
+ * USAePay: Handle additional error codes and add default error code [estelendur] #3167
82
+ * Braintree: Add `skip_avs` and `skip_cvv` gateway specific fields [leila-alderman] #3241
83
+ * NAB Transact: Update periodic test url [mengqing] #3177
84
+ * NMI: Add level 3 gateway-specific fields tax, shipping, and ponumber [jasonxp] #3239
85
+ * Checkout V2: Update stored card flag [curiousepic] #3247
86
+ * NMI: Add support for stored credentials [bayprogrammer] #3243
87
+ * Spreedly: Consolidate API requests and support bank accounts [lancecarlson] #3105
88
+ * BPoint: Hook up merchant_reference and CRN fields [curiousepic] #3249
89
+ * Checkout V2: Stop sending phone number to Checkout V2 integration [filipebarcos] #3248
90
+ * Barclaycard Smartpay: Add support for 3DS2 [britth] #3251
91
+ * Adyen: Add support for non-fractional currencies [molbrown] #3257
92
+ * Decidir: Add new gateway [jknipp] #3254
93
+ * Checkout V2: Reapply Update stored card flag [curiousepic]
94
+ * CyberSource: Update supported countries [molbrown] #3260
95
+ * Credorax: Update supported countries [molbrown] #3260
96
+ * Kushki: Update supported countries [molbrown] #3260
97
+ * Paypal: Update supported countries [molbrown] #3260
98
+ * BlueSnap: Send amount in capture requests [jknipp] #3262
99
+ * Mundipagg: Add Alelo card support [jasonxp] #3255
100
+ * Adyen: Remove temporary amount modification for non-fractional currencies [molbrown] #3263
101
+ * Adyen: Set blank state to N/A [therufs] #3252
102
+ * MiGS: Add tx_source gateway specific field [leila-alderman] #3264
103
+ * NMI: Correct password scrubber to scrub symbols [hdeters] #3267
104
+ * Global Collect: Only add name if present [curiousepic] #3268
105
+ * HPS: Add Apple Pay raw cryptogram support [slogsdon] #3209
106
+ * CardConnect: Fix parsing of level 3 fields [hdeters] #3273
107
+ * TrustCommerce: Support void after purchase [jknipp] #3265
108
+ * Payflow: Support arbitrary level 2 + level 3 fields [therufs] #3272
109
+ * BlueSnap: Default to not send amount on capture [molbrown] #3270
110
+ * Spreedly: extra fields, remove extraneous check [montdidier] #3102 #3281
111
+ * Cecabank: Update encryption to SHA2 [leila-alderman] #3278
112
+ * Checkout V2: Fix 3DS 1&2 integration [nicolas-maalouf-cko] #3240
113
+ * Credorax: add 3DS2 MPI auth data support [bayprogrammer] #3274
114
+ * Add Kosovo to the list of countries [AnotherJoSmith] #3226
115
+ * Realex: Adds 3DS 1&2 support through external MPI [filipebarcos] #3284
116
+ * PayPal: Adds 3DS 1 support through external MPI [nebdil] #3279
117
+
118
+ == Version 1.95.0 (May 23, 2019)
119
+ * Adyen: Constantize version to fix subdomains [curiousepic] #3228
120
+ * Qvalent: Adds support for standard stored credential framework [molbrown] #3227
121
+ * Cybersource: Send tokenization data when card is :master [pi3r] #3230
122
+
123
+ == Version 1.94.0 (May 21, 2019)
124
+ * Mundipagg: Fix number lengths for both VR and Sodexo [dtykocki] #3195
125
+ * Stripe: Support show and list webhook endpoints [jknipp] #3196
126
+ * CardConnect: Add frontendid parameter to requests [gcatlin] #3198
127
+ * Adyen: Correct formatting of Billing Address [nfarve] #3200
128
+ * Stripe: Stripe: Show payment source [jknipp] #3202
129
+ * Checkout V2: Checkout V2: Correct success criteria [curiousepic] #3205
130
+ * Adyen: Add normalized hash of 3DS 2.0 data fields from web browsers [davidsantoso] #3207
131
+ * Stripe: Do not attempt application fee refund if refund was not successful [jasonwebster] #3206
132
+ * Elavon: Send transaction_currency if currency is provided [gcatlin] #3201
133
+ * Elavon: Multi-currency support [jknipp] #3210
134
+ * Adyen: Support preAuths and Synchronous Adjusts [curiousepic] #3212
135
+ * WorldPay: Support Unknown Card Type [tanyajajodia] #3213
136
+ * Mundipagg: Make gateway_affiliation_id an option [curiousepic] #3219
137
+ * CyberSource: Adds Elo Card Type [tanyajajodia] #3220
138
+ * CyberSource: Support standalone credit for cards [curiousepic] #3225
139
+
140
+ == Version 1.93.0 (April 18, 2019)
141
+ * Stripe: Do not consider a refund unsuccessful if only refunding the fee failed [jasonwebster] #3188
142
+ * Stripe: Fix webhook creation for connected account [jknipp] #3193
143
+ * Adyen: Upgrade to v40 API version [davidsantoso] #3192
144
+
145
+ == Version 1.92.0 (April 8, 2019)
146
+ * BluePay: Send customer IP address when provided [jknipp] #3149
147
+ * PaymentExpress: Use ip field for client_info field [jknipp] #3150
148
+ * Bambora Asia-Pacific: Adds Store [molbrown] #3147
149
+ * Orbital: Pass normalized stored credential fields [curiousepic] #3148
150
+ * Adds Elo card type in general and specifically to Adyen [deedeelavinder] #3153
151
+ * Mercado Pago: Adds Elo card type [deedeelavinder] #3156
152
+ * Litle: Add support for stored credentials [bayprogrammer] #3155
153
+ * Adyen: Correctly process risk_data option [bayprogrammer] #3161
154
+ * Paymentez: Adds Elo card type [deedeelavinder] #3162
155
+ * WorldPay: Adds Elo card type [deedeelavinder] #3163
156
+ * Adyen: Idempotency for non-purchase requests [molbrown] #3164
157
+ * FirstData e4 v27: Support v28 url and stored creds [curiousepic] #3165
158
+ * WorldPay: Fix element order for 3DS + stored cred [bayprogrammer] #3172
159
+ * Braintree: Add risk data to returned response [jknipp] #3169
160
+ * Adyen: Support idempotency on purchase [molbrown] #3168
161
+ * Adyen: Pass phone, statement, device_fingerprint [curiousepic] #3178
162
+ * Adyen: Fix adding phone from billing address [curiousepic] #3179
163
+ * Fix partial or missing address exceptions [molbrown] #3180
164
+ * Adyen: Update to support normalized stored credential fields [molbrown] #3182
165
+ * VisaNet Peru: Always include DSC_COD_ACCION [bayprogrammer] #3174
166
+ * Adyen: Support adjust action [curiousepic] #3190
167
+ * CyberSource: Add support for stored credentials [therufs] #3185
168
+
169
+ == Version 1.91.0 (February 22, 2019)
170
+ * WorldPay: Pull CVC and AVS Result from Response [nfarve] #3106
171
+ * Worldpay: Add AVS and CVC Mapping [nfarve] #3107
172
+ * Paymentez: Fixes extra_params field [molbrown] #3108
173
+ * Improved support for account_type using Check class's account_type instead [lancecarlson] #3097
174
+ * USA Epay: Allow quantity to be passed and check custom fields [lancecarlson] #3090
175
+ * Fix usaepay transaction invoice [lancecarlson] #3093
176
+ * Adyen: Handles blank state address field [molbrown] #3113
177
+ * Braintree: Send all country fields [curiousepic] #3112
178
+ * Braintree: Account for empty string countries [curiousepic] #3115
179
+ * Orbital: Support for stored credentials framework [jknipp] #3117
180
+ * Openpay: Fix for marking successful transaction(s) as failed [jknipp] #3121
181
+ * Braintree: Adds support for transaction_source [molbrown] #3120
182
+ * Moneris: Remove redundant card on file guard clause [davidsantoso] #3123
183
+ * Switch order of Romania country codes [molbrown] #3125
184
+ * Blue Snap: Supports Level 2/3 data [molbrown] #3126
185
+ * Blue Snap: Support personal_identification_number [jknipp] #3128
186
+ * ProPay: Send 9 digit zip code without dash [molbrown] #3129
187
+ * Adyen: Extend AVS code mappings [therufs] #3119
188
+ * NMI: Add customer id to authorization on store [curiousepic] #3130
189
+ * Trans First Express: Don't pass blank name field [curiousepic] #3133
190
+ * TrustCommerce: Send full name on ACH transactions [jknipp] #3132
191
+ * Qvalent: Map CVV Result to responses [curiousepic] #3135
192
+ * Card Connect: Handle 401s as responses [curiousepic] #3137
193
+ * Worldpay: Introduce normalized stored credential options [davidsantoso] #3134
194
+ * Worldpay: Adjust use of normalized stored credentials hash [davidsantoso] #3139
195
+ * Adyen: Enable Dynamic 3DS [molbrown] #3138
196
+ * Fat Zebra: Support voids [curiousepic] #3142
197
+ * Blue Snap: Support ACH/ECP payments [jknipp] #3143
198
+ * Blue Snap: Fix Card-on-File field typo [jknipp] #3143
199
+ * Add Bambora gateway [InfraRuby] #3145
200
+ * Bambora Asia-Pacific: Updates Gateway [molbrown] #3145
201
+ * PaymentExpress: Support ClientInfo field [jknipp] #3131
202
+ * Pin Payments: Concatenate card and customer tokens when storing card [therufs] #3144
203
+ * Update Discover regex to allow card numbers longer than 16 digits [prashcr] #3146
204
+ * Merrco partial refunds fix [payfirma1] #3141
4
205
 
5
206
  == Version 1.90.0 (January 8, 2019)
6
207
  * Mercado Pago: Support "gateway" processing mode [curiousepic] #3087
@@ -12,6 +213,7 @@
12
213
  * Braintree Blue: Refactor line_items field [curiousepic] #3100
13
214
  * TrustCommerce: Use `application_id` [nfarve] #3103
14
215
  * Stripe: Add 3DS Support [nfarve] #3086
216
+ * Cecabank: Append error text to message [therufs] #3127
15
217
 
16
218
  == Version 1.89.0 (December 17, 2018)
17
219
  * Worldpay: handle Visa and MasterCard payouts differently [bpollack] #3068
data/README.md CHANGED
@@ -84,14 +84,18 @@ end
84
84
  For more in-depth documentation and tutorials, see [GettingStarted.md](GettingStarted.md) and the
85
85
  [API documentation](http://www.rubydoc.info/github/activemerchant/active_merchant/).
86
86
 
87
+ Emerging ActiveMerchant 3DS conventions are documented in the [Contributing](https://github.com/activemerchant/active_merchant/wiki/Contributing#3ds-options)
88
+ guide and [Standardized 3DS Fields](https://github.com/activemerchant/active_merchant/wiki/Standardized-3DS-Fields) guide of the wiki.
89
+
87
90
  ## Supported Payment Gateways
88
91
 
89
- The [ActiveMerchant Wiki](http://github.com/activemerchant/active_merchant/wikis) contains a [table of features supported by each gateway](http://github.com/activemerchant/active_merchant/wikis/gatewayfeaturematrix).
92
+ The [ActiveMerchant Wiki](https://github.com/activemerchant/active_merchant/wikis) contains a [table of features supported by each gateway](https://github.com/activemerchant/active_merchant/wiki/Gateway-Feature-Matrix).
90
93
 
91
94
  * [Authorize.Net CIM](http://www.authorize.net/) - US
92
95
  * [Authorize.Net](http://www.authorize.net/) - AD, AT, AU, BE, BG, CA, CH, CY, CZ, DE, DK, ES, FI, FR, GB, GB, GI, GR, HU, IE, IT, LI, LU, MC, MT, NL, NO, PL, PT, RO, SE, SI, SK, SM, TR, US, VA
93
96
  * [Axcess MS](http://www.axcessms.com/) - AD, AT, BE, BG, BR, CA, CH, CY, CZ, DE, DK, EE, ES, FI, FO, FR, GB, GI, GR, HR, HU, IE, IL, IM, IS, IT, LI, LT, LU, LV, MC, MT, MX, NL, NO, PL, PT, RO, RU, SE, SI, SK, TR, US, VA
94
97
  * [Balanced](https://www.balancedpayments.com/) - US
98
+ * [Bambora Asia-Pacific](http://www.bambora.com/) - AU, NZ
95
99
  * [Bank Frick](http://www.bankfrickacquiring.com/) - LI, US
96
100
  * [Banwire](http://www.banwire.com/) - MX
97
101
  * [Barclays ePDQ Extra Plus](http://www.barclaycard.co.uk/business/accepting-payments/epdq-ecomm/) - GB
@@ -192,7 +196,7 @@ The [ActiveMerchant Wiki](http://github.com/activemerchant/active_merchant/wikis
192
196
  * [Paystation](http://paystation.co.nz) - NZ
193
197
  * [Pay Way](http://www.payway.com.au) - AU
194
198
  * [PayU India](https://www.payu.in/) - IN
195
- * [Pin Payments](http://www.pin.net.au/) - AU
199
+ * [Pin Payments](http://www.pinpayments.com/) - AU
196
200
  * [Plug'n Pay](http://www.plugnpay.com/) - US
197
201
  * [Psigate](http://www.psigate.com/) - CA
198
202
  * [PSL Payment Solutions](http://www.paymentsolutionsltd.com/) - GB
@@ -3,14 +3,13 @@
3
3
  module ActiveMerchant
4
4
  module Billing
5
5
  # Implements the Address Verification System
6
- # https://www.wellsfargo.com/downloads/pdf/biz/merchant/visa_avs.pdf
6
+ # https://www.cybersource.com/developers/other_resources/quick_references/avs_results/.
7
7
  # http://en.wikipedia.org/wiki/Address_Verification_System
8
- # http://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_IG/html/app_avs_cvn_codes.htm#app_AVS_CVN_codes_7891_48375
9
- # http://imgserver.skipjack.com/imgServer/5293710/AVS%20and%20CVV2.pdf
10
8
  # http://www.emsecommerce.net/avs_cvv2_response_codes.htm
9
+ # https://www.cardfellow.com/blog/address-verification-service-avs/
11
10
  class AVSResult
12
11
  MESSAGES = {
13
- 'A' => 'Street address matches, but 5-digit and 9-digit postal code do not match.',
12
+ 'A' => 'Street address matches, but postal code does not match.',
14
13
  'B' => 'Street address matches, but postal code not verified.',
15
14
  'C' => 'Street address and postal code do not match.',
16
15
  'D' => 'Street address and postal code match.',
@@ -23,7 +22,7 @@ module ActiveMerchant
23
22
  'K' => 'Card member\'s name matches but billing address and billing postal code do not match.',
24
23
  'L' => 'Card member\'s name and billing postal code match, but billing address does not match.',
25
24
  'M' => 'Street address and postal code match.',
26
- 'N' => 'Street address and postal code do not match.',
25
+ 'N' => 'Street address and postal code do not match. For American Express: Card member\'s name, street address and postal code do not match.',
27
26
  'O' => 'Card member\'s name and billing address match, but billing postal code does not match.',
28
27
  'P' => 'Postal code matches, but street address not verified.',
29
28
  'Q' => 'Card member\'s name, billing address, and postal code match. Shipping information verified but chargeback protection not guaranteed.',
@@ -18,6 +18,10 @@ module ActiveMerchant #:nodoc:
18
18
  # * Dankort
19
19
  # * Maestro
20
20
  # * Forbrugsforeningen
21
+ # * Elo
22
+ # * Alelo
23
+ # * Cabal
24
+ # * Naranja
21
25
  #
22
26
  # For testing purposes, use the 'bogus' credit card brand. This skips the vast majority of
23
27
  # validations, allowing you to focus on your core concerns until you're ready to be more concerned
@@ -88,6 +92,10 @@ module ActiveMerchant #:nodoc:
88
92
  # * +'dankort'+
89
93
  # * +'maestro'+
90
94
  # * +'forbrugsforeningen'+
95
+ # * +'elo'+
96
+ # * +'alelo'+
97
+ # * +'cabal'+
98
+ # * +'naranja'+
91
99
  #
92
100
  # Or, if you wish to test your implementation, +'bogus'+.
93
101
  #
@@ -5,15 +5,19 @@ module ActiveMerchant #:nodoc:
5
5
  CARD_COMPANY_DETECTORS = {
6
6
  'visa' => ->(num) { num =~ /^4\d{12}(\d{3})?(\d{3})?$/ },
7
7
  'master' => ->(num) { num&.size == 16 && in_bin_range?(num.slice(0, 6), MASTERCARD_RANGES) },
8
- 'discover' => ->(num) { num =~ /^(6011|65\d{2}|64[4-9]\d)\d{12}|(62\d{14})$/ },
8
+ 'elo' => ->(num) { num&.size == 16 && in_bin_range?(num.slice(0, 6), ELO_RANGES) },
9
+ '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})$/ },
9
11
  'american_express' => ->(num) { num =~ /^3[47]\d{13}$/ },
12
+ 'naranja' => ->(num) { num&.size == 16 && in_bin_range?(num.slice(0, 6), NARANJA_RANGES) },
10
13
  'diners_club' => ->(num) { num =~ /^3(0[0-5]|[68]\d)\d{11}$/ },
11
14
  'jcb' => ->(num) { num =~ /^35(28|29|[3-8]\d)\d{12}$/ },
12
15
  'dankort' => ->(num) { num =~ /^5019\d{12}$/ },
13
16
  'maestro' => ->(num) { (12..19).cover?(num&.size) && in_bin_range?(num.slice(0, 6), MAESTRO_RANGES) },
14
17
  'forbrugsforeningen' => ->(num) { num =~ /^600722\d{10}$/ },
15
- 'sodexo' => ->(num) { num =~ /^(606071|603389|606070|606069|606068|600818)\d{8}$/ },
16
- 'vr' => ->(num) { num =~ /^(627416|637036)\d{8}$/ },
18
+ 'sodexo' => ->(num) { num =~ /^(606071|603389|606070|606069|606068|600818)\d{10}$/ },
19
+ 'vr' => ->(num) { num =~ /^(627416|637036)\d{10}$/ },
20
+ 'cabal' => ->(num) { num&.size == 16 && in_bin_range?(num.slice(0, 8), CABAL_RANGES) },
17
21
  'carnet' => lambda { |num|
18
22
  num&.size == 16 && (
19
23
  in_bin_range?(num.slice(0, 6), CARNET_RANGES) ||
@@ -62,10 +66,63 @@ module ActiveMerchant #:nodoc:
62
66
 
63
67
  # https://www.mastercard.us/content/dam/mccom/global/documents/mastercard-rules.pdf, page 73
64
68
  MAESTRO_RANGES = [
69
+ (561200..561269),
70
+ (561271..561299),
71
+ (561320..561356),
72
+ (581700..581751),
73
+ (581753..581800),
74
+ (589998..591259),
75
+ (591261..596770),
76
+ (596772..598744),
77
+ (598746..599999),
78
+ (600297..600314),
79
+ (600316..600335),
80
+ (600337..600362),
81
+ (600364..600382),
82
+ (601232..601254),
83
+ (601256..601276),
84
+ (601640..601652),
85
+ (601689..601700),
86
+ (602011..602050),
65
87
  (639000..639099),
66
88
  (670000..679999),
67
89
  ]
68
90
 
91
+ # https://dev.elo.com.br/apis/tabela-de-bins, download csv from left sidebar
92
+ ELO_RANGES = [
93
+ 506707..506708, 506715..506715, 506718..506722, 506724..506724, 506726..506736, 506739..506739, 506741..506743,
94
+ 506745..506747, 506753..506753, 506774..506776, 506778..506778, 509000..509001, 509003..509003, 509007..509007,
95
+ 509020..509022, 509035..509035, 509039..509042, 509045..509045, 509048..509048, 509051..509071, 509073..509074,
96
+ 509077..509080, 509084..509084, 509091..509094, 509098..509098, 509100..509100, 509104..509104, 509106..509109,
97
+ 627780..627780, 636368..636368, 650031..650033, 650035..650045, 650047..650047, 650406..650410, 650434..650436,
98
+ 650439..650439, 650485..650504, 650506..650530, 650577..650580, 650582..650591, 650721..650727, 650901..650922,
99
+ 650928..650928, 650938..650939, 650946..650948, 650954..650955, 650962..650963, 650967..650967, 650971..650971,
100
+ 651652..651667, 651675..651678, 655000..655010, 655012..655015, 655051..655052, 655056..655057
101
+ ]
102
+
103
+ # Alelo provides BIN ranges by e-mailing them out periodically.
104
+ # The BINs beginning with the digit 4 overlap with Visa's range of valid card numbers.
105
+ # By placing the 'alelo' entry in CARD_COMPANY_DETECTORS below the 'visa' entry, we
106
+ # identify these cards as Visa. This works because transactions with such cards will
107
+ # run on Visa rails.
108
+ ALELO_RANGES = [
109
+ 402588..402588, 404347..404347, 405876..405876, 405882..405882, 405884..405884,
110
+ 405886..405886, 430471..430471, 438061..438061, 438064..438064, 470063..470066,
111
+ 496067..496067, 506699..506704, 506706..506706, 506713..506714, 506716..506716,
112
+ 506749..506750, 506752..506752, 506754..506756, 506758..506762, 506764..506767,
113
+ 506770..506771, 509015..509019, 509880..509882, 509884..509885, 509987..509988
114
+ ]
115
+
116
+ CABAL_RANGES = [
117
+ 60420100..60440099,
118
+ 58965700..58965799,
119
+ 60352200..60352299
120
+ ]
121
+
122
+ NARANJA_RANGES = [
123
+ 589562..589562
124
+ ]
125
+
69
126
  def self.included(base)
70
127
  base.extend(ClassMethods)
71
128
  end
@@ -141,7 +198,7 @@ module ActiveMerchant #:nodoc:
141
198
  valid_test_mode_card_number?(number) ||
142
199
  valid_card_number_length?(number) &&
143
200
  valid_card_number_characters?(number) &&
144
- valid_checksum?(number)
201
+ valid_by_algorithm?(brand?(number), number)
145
202
  end
146
203
 
147
204
  def card_companies
@@ -215,6 +272,15 @@ module ActiveMerchant #:nodoc:
215
272
  %w[1 2 3 success failure error].include?(number)
216
273
  end
217
274
 
275
+ def valid_by_algorithm?(brand, numbers) #:nodoc:
276
+ case brand
277
+ when 'naranja'
278
+ valid_naranja_algo?(numbers)
279
+ else
280
+ valid_luhn?(numbers)
281
+ end
282
+ end
283
+
218
284
  ODD_LUHN_VALUE = {
219
285
  48 => 0,
220
286
  49 => 1,
@@ -245,7 +311,7 @@ module ActiveMerchant #:nodoc:
245
311
  # Checks the validity of a card number by use of the Luhn Algorithm.
246
312
  # Please see http://en.wikipedia.org/wiki/Luhn_algorithm for details.
247
313
  # This implementation is from the luhn_checksum gem, https://github.com/zendesk/luhn_checksum.
248
- def valid_checksum?(numbers) #:nodoc:
314
+ def valid_luhn?(numbers) #:nodoc:
249
315
  sum = 0
250
316
 
251
317
  odd = true
@@ -261,6 +327,16 @@ module ActiveMerchant #:nodoc:
261
327
 
262
328
  sum % 10 == 0
263
329
  end
330
+
331
+ # Checks the validity of a card number by use of Naranja's specific algorithm.
332
+ def valid_naranja_algo?(numbers) #:nodoc:
333
+ num_array = numbers.to_s.chars.map(&:to_i)
334
+ multipliers = [4, 3, 2, 7, 6, 5, 4, 3, 2, 7, 6, 5, 4, 3, 2]
335
+ num_sum = num_array[0..14].zip(multipliers).map { |a, b| a*b }.reduce(:+)
336
+ intermediate = 11 - (num_sum % 11)
337
+ final_num = intermediate > 9 ? 0 : intermediate
338
+ final_num == num_array[15]
339
+ end
264
340
  end
265
341
  end
266
342
  end
@@ -200,6 +200,16 @@ module ActiveMerchant #:nodoc:
200
200
  false
201
201
  end
202
202
 
203
+ def add_fields_to_post_if_present(post, options, fields)
204
+ fields.each do |field|
205
+ add_field_to_post_if_present(post, options, field)
206
+ end
207
+ end
208
+
209
+ def add_field_to_post_if_present(post, options, field)
210
+ post[field] = options[field] if options[field]
211
+ end
212
+
203
213
  protected # :nodoc: all
204
214
 
205
215
  def normalize(field)