Skip to content

Commit

Permalink
feat(CreditCardNumber): Add unionpay as an accepted card type
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleG43 committed Mar 8, 2024
1 parent cbd2b65 commit 0b890ce
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/Input/CreditCardNumber.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const EXAMPLES = {
'master-card': '5555555555554444',
discover: '6011111111111117',
jcb: '3530111333300000',
unionpay: '6262320002000067',
visa: '4111111111111111',
};

Expand Down
10 changes: 9 additions & 1 deletion src/components/Input/CreditCardNumber.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ import InputGroupText from '../InputGroup/InputGroupText';
import Input from './Input';

// runtime representation of card types for input validation
type CardType = 'visa' | 'master-card' | 'american-express' | 'discover' | 'diners-club' | 'jcb';
type CardType =
| 'visa'
| 'master-card'
| 'american-express'
| 'discover'
| 'diners-club'
| 'jcb'
| 'unionpay';

type IconName =
| 'cc-amex'
Expand All @@ -33,6 +40,7 @@ const ICONS: {
'master-card': 'cc-mastercard',
discover: 'cc-discover',
jcb: 'cc-jcb',
unionpay: 'credit-card',
visa: 'cc-visa',
};

Expand Down

0 comments on commit 0b890ce

Please sign in to comment.