From 0b890ceb1a45482e8962325fcf22f263355fd0b0 Mon Sep 17 00:00:00 2001 From: Kyle Giannini Date: Wed, 6 Mar 2024 12:13:15 -0800 Subject: [PATCH] feat(CreditCardNumber): Add unionpay as an accepted card type --- src/components/Input/CreditCardNumber.spec.js | 1 + src/components/Input/CreditCardNumber.tsx | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/Input/CreditCardNumber.spec.js b/src/components/Input/CreditCardNumber.spec.js index 9cc86a147..58c098041 100644 --- a/src/components/Input/CreditCardNumber.spec.js +++ b/src/components/Input/CreditCardNumber.spec.js @@ -12,6 +12,7 @@ const EXAMPLES = { 'master-card': '5555555555554444', discover: '6011111111111117', jcb: '3530111333300000', + unionpay: '6262320002000067', visa: '4111111111111111', }; diff --git a/src/components/Input/CreditCardNumber.tsx b/src/components/Input/CreditCardNumber.tsx index fcaba401c..696247e0f 100644 --- a/src/components/Input/CreditCardNumber.tsx +++ b/src/components/Input/CreditCardNumber.tsx @@ -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' @@ -33,6 +40,7 @@ const ICONS: { 'master-card': 'cc-mastercard', discover: 'cc-discover', jcb: 'cc-jcb', + unionpay: 'credit-card', visa: 'cc-visa', };