Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Diners Club 16 #2211

Merged
merged 3 commits into from
Feb 24, 2020
Merged

Add support for Diners Club 16 #2211

merged 3 commits into from
Feb 24, 2020

Conversation

mshafrir-stripe
Copy link
Collaborator

@mshafrir-stripe mshafrir-stripe commented Feb 21, 2020

Summary

  • Update CardBrand
    • Update CardBrand.DinersClub to support 16-digit Diners Club cards
    • Update Diners Club BIN range
      • Card numbers starting with "30", "38", or "39" represent 16-digit Diners Club cards
      • Card numbers starting with "36" represent 14-digit Diners Club cards
    • Rename maxLengthWithoutSpaces to defaultMaxLength
    • Rename maxLengthWithSpaces to defaultMaxLengthWithSpaces
    • Create getMaxLengthForCardNumber() and getMaxLengthWithSpacesForCardNumber() to determine the max length based on the card number's prefix
  • Update most tests to use CardNumberFixtures

Motivation

Fixes #2205

Testing

Add unit tests

dc

Summary
- Add `CardBrand.DinersClub16` to represent 16-digit Diners Club cards
- Update Diners Club BIN range
  - Card numbers starting with `"30"`, `"38"`, or `"39"` represent
    16-digit Diners Club cards
  - Card numbers starting with `"36"` represent
    14-digit Diners Club cards
- Update most tests to use `CardNumberFixtures`

Testing
Add unit tests
- Rename `maxLengthWithoutSpaces` to `defaultMaxLength`
- Rename `maxLengthWithSpaces` to `defaultMaxLengthWithSpaces`
- Create `getMaxLengthForCardNumber()` and
  `getMaxLengthWithSpacesForCardNumber()` to determine the max length
  based on the card number's prefix
Update max length whenever brand changes
@mshafrir-stripe mshafrir-stripe merged commit 6461497 into master Feb 24, 2020
@mshafrir-stripe mshafrir-stripe deleted the dinersclub-16 branch February 24, 2020 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Diners Club card number (16 digits)
3 participants