Open Bug 1470175 Opened 6 years ago Updated 2 years ago

Card number field should include spaces to group digits

Categories

(Firefox :: WebPayments UI, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: epang, Unassigned)

References

Details

(Whiteboard: [webpayments-reserve])

Attachments

(1 file)

If known, we should should create spaces based on credit card type and number.
Whiteboard: [webpayments] [ux] → [webpayments-reserve] [ux]
Attached image CC Number Spacing (deleted) —
As noted in spec: The credit card number automatically splits to match the format of the card type. For example, Visa card splits number in every 4 digits. Only number characters will be allowed in this field and the CVV Field.
Whiteboard: [webpayments-reserve] [ux] → [webpayments] [ux]
Whiteboard: [webpayments] [ux] → [webpayments-reserve]
Flags: qe-verify+
QA Contact: hani.yacoub
Summary: Specify if the card number field should include spaces → Card number field should include spaces to group digits
I started to take a look onto this issue. I drafted a prototype at https://jsfiddle.net/dpino/qbt46ra3/1/ Sam commented on IRC there are libraries for detecting cc-number patterns. I don't know whether those libraries are already part of the codebase or should be imported somehow. I think a library would definitely be very convenient for easing maintenance. Also it seems detecting a pattern is not so trivia since there's not a 1-to-1 correspondence between a prefix and a pattern (some cards of the same prefix can have several patterns). Regarding UI, I think it would be convenient to place a credit-card icon at the right of the input field. Then as a pattern is detected the icon changes (See: https://baymard.com/blog/credit-card-field-auto-format-spaces). Perhaps that should be a different issue.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: