[jira] [Commented] (OFBIZ-7824) Add validation for credit card number length

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-7824) Add validation for credit card number length

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-7824?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15645786#comment-15645786 ]

Paul Foxworthy commented on OFBIZ-7824:
---------------------------------------

Some credit cards have different lengths. For example, American Express is 15, not 16 digits.

Credit cards have a built-in checksum using the Luhn algorithm (https://en.wikipedia.org/wiki/Luhn_algorithm). It would be far better to verify the checksum, rather than just the number of digits.

There already is credit card checksum checking in OFBiz.  Have a look at https://fisheye6.atlassian.com/browse/~br=trunk/ofbiz/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilValidate.java?r=1761200#to1193 and the preceding code.

Is there somewhere in OFBiz that should be using this validation, but isn't currently?



> Add validation for credit card number length
> ---------------------------------------------
>
>                 Key: OFBIZ-7824
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-7824
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: ALL APPLICATIONS
>    Affects Versions: Trunk
>            Reporter: Padmavati Rawat
>            Priority: Minor
>
> Ofbiz allows for any length for credit card numbers, as default length is 16 digits.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)