Closed (fixed)
Project:
Commerce Core
Version:
7.x-1.x-dev
Component:
Payment
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
19 Jun 2017 at 16:54 UTC
Updated:
4 Aug 2017 at 12:40 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
bojanz commented2.x code: https://github.com/drupalcommerce/commerce/blob/8.x-2.x/modules/payment/...
Note that 2.x uses a more declarative approach, while 1.x is more imperative. If we could sync the 1.x logic with 2.x, it would be easier to keep the datasets in sync.
Comment #3
dhare23 commentedQuick fix to validate 2-series BIN cards.
Comment #4
mglamanHere is a direct backport (CreditCard -> CommercePaymentCreditCard, unit test as well.) Switch, Laser, and Solo removed as no longer active.
Comment #5
mglamanAssigning to rszrama to review.
Comment #6
bojanz commentedGood job.
You've changed the diners club machine name, that should be synced back.
We also lost Visa Electron (2.x has just Visa), not sure if that's relevant (I modeled the list after the stripe/braintree lists)
Also, we probably don't need to mention that something is a 2.x backport. It's all us, and there will hopefuly be more.
Comment #7
mglaman2.x DC/DCi are combined. Reroll to address this
Comment #8
mglamanAdded Visa Electron back. Kept DC/DCi/CB combined. I think maybe we should also write a change record which states Laser, Switch/Solo removed as they are no longer active. DCi/CB merged into DC.
We also don't need Visa Electron explicitly defined because it starts with
4Comment #9
mglamanCreated a draft CR here https://www.drupal.org/node/2887698
Comment #11
mglamanCommitted! Yay, first 2.x work backport to update 1.x
Comment #12
jsacksick commentedReverted the commit since it was containing unrelated code... :p
Comment #14
jsacksick commentedJust committed the right patch.
Comment #16
jsacksick commentedIt appears there's an issue with
commerce_payment_validate_credit_card_type(), I always get the following error: "You have entered a credit card number that does not match the type selected." when entering valid test credit card numbers.commerce_payment_validate_credit_card_type()used to return a string, now it returns an array, hence the check performed incommerce_payment_credit_card_validate()doesn't pass.We could either update
commerce_payment_credit_card_validate()to expect an array or makecommerce_payment_validate_credit_card_type()return the credit card type (a.k.a id) string, or FALSE when not valid.Additionally, the $card_types array argument is not used in the function.
Comment #18
jsacksick commentedSince various payment contrib modules are calling
commerce_payment_validate_credit_card_type, I think we should make it return the card type string instead of an array (See patch attached):