Skip to content

Payments- No error messages displayed for using numbers for the Name of Card and Expiration date 0233 #6689

Closed

Description

@kbecciv

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Lunch the app
  2. Log in with any account
  3. Go to Setting - Payments
  4. Tap on Plus - tap on Debit Card
  5. Put numbers for Name of Card
  6. Put expiration date as 0233

Expected Result:

Error messages displayed for using numbers for the Name of Card and expiration date - 0233

Actual Result:

No error messages displayed for using numbers for the Name of Card and expiration date - 0233

Workaround:

Unknown

Platform:

Where is this issue occurring?

  • Web
  • iOS
  • Android
  • Desktop App
  • Mobile Web

**Version Number:1.1.19-3
**Reproducible in staging?:Yes
**Reproducible in production?:Yes
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

Expensify/Expensify Issue URL:
Issue reported by:
Slack conversation:

View all open jobs on GitHub

Activity

  1. MelvinBot commented on Dec 10, 2021

    @MelvinBot
    Contributor

    Triggered auto assignment to @marcochavezf (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

  2. marcochavezf commented on Dec 20, 2021

    @marcochavezf
    Contributor

    The expiration date is valid, according to the implementation of the function to validate the expiration date, the format MMYY is valid:

    /**
    * Validates that this is a valid expiration date. Supports the following formats:
    * 1. MM/YY
    * 2. MM/YYYY
    * 3. MMYY
    * 4. MMYYYY
    *
    * @param {String} string
    * @returns {Boolean}
    */
    function isValidExpirationDate(string) {
    if (!CONST.REGEX.CARD_EXPIRATION_DATE.test(string)) {
    return false;
    }
    // Use the last of the month to check if the expiration date is in the future or not
    const expirationDate = `${CardUtils.getYearFromExpirationDateString(string)}-${CardUtils.getMonthFromExpirationDateString(string)}-01`;
    return moment(expirationDate).endOf('month').isAfter(moment());
    }

    Also, I found in the Web-S WAF that cardName can accept numbers (I found this comment in the WAF: It's not uncommon that company credit cards will have crazy chars in their name.).

    I'm going to close this ticket because seems those inputs are expected.

  3. marcochavezf commented on Dec 20, 2021

    @marcochavezf
    Contributor

    I noticed we have a few frontend validations in old dot, I'm going re-open the issue and create a PR to reuse/mimic the same logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions