Closed (fixed)
Project:
Commerce Core
Version:
7.x-1.x-dev
Component:
Payment
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
11 Oct 2012 at 15:48 UTC
Updated:
10 Nov 2017 at 19:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
stella commentedPatch re-roll to stop the error "You have entered an invalid card security code." appearing too.
Comment #2
rszrama commentedWouldn't this reverse the current default behavior so sites that currently expect it to be required could suddenly see it appearing as not required?
Comment #3
stella commentedI guess it would depend on each payment gateway definition. If the payment gateway doesn't set it then it's not required. I just implemented it the same way as the issue number. Then in the commerce_realex payment gateway I do a requirement check based on the card type selected.
Maybe there's a better approach, but there needs to be some way to have the CVV field be optional as not all card types require it (e.g. Laser debit card).
Comment #4
albert volkman commentedThis patch builds on the previous patch by introducing a new option "no_code". We can add this piece without breaking existing functionality, and then allow payment types implement this as an option (like the patch from #1948540: Make Security code optional).
Comment #5
rszrama commentedI'd like to see the validation in #4 be a little smarter. commerce_payment_validate_credit_card_security_code() isn't the place to add an exception for an empty code; the function assumes it's being passed a CVV to validate, not an empty string. Better would be to not invoke the function to begin with if we know the CVV isn't required and is an empty string.
Comment #6
nickonom commentedCan't believe this was last updated 3 years ago and nobody else posted here. I am also interested in this feature.
Comment #7
jsacksick commentedMaking the actual field not required could easily be achieved by implementing a hook_form_alter().
However, once you do that, the validation will fail because of the isset() check in commerce_payment_credit_card_validate(), I suggest we replace it by a !empty() check, this way, the CVV would only be validated if filled...
Comment #9
rszrama commentedSorry this is so long overdue. Committed the patch in #7.