@thecb/components 4.2.4 → 4.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js
CHANGED
|
@@ -6115,7 +6115,7 @@ var displayCardBrand = function displayCardBrand(number) {
|
|
|
6115
6115
|
return "American Express";
|
|
6116
6116
|
} else return "Unknown Card";
|
|
6117
6117
|
};
|
|
6118
|
-
var
|
|
6118
|
+
var checkDeniedCards = function checkDeniedCards(name) {
|
|
6119
6119
|
switch (name) {
|
|
6120
6120
|
case "DISCOVER":
|
|
6121
6121
|
return /^(?!6011)/;
|
|
@@ -6143,7 +6143,7 @@ var general = /*#__PURE__*/Object.freeze({
|
|
|
6143
6143
|
generateClickHandler: generateClickHandler,
|
|
6144
6144
|
checkCardBrand: checkCardBrand,
|
|
6145
6145
|
displayCardBrand: displayCardBrand,
|
|
6146
|
-
|
|
6146
|
+
checkDeniedCards: checkDeniedCards
|
|
6147
6147
|
});
|
|
6148
6148
|
|
|
6149
6149
|
var Text = function Text(_ref) {
|
|
@@ -39419,11 +39419,11 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
39419
39419
|
showWalletCheckbox = _ref.showWalletCheckbox,
|
|
39420
39420
|
saveToWallet = _ref.saveToWallet,
|
|
39421
39421
|
walletCheckboxMarked = _ref.walletCheckboxMarked,
|
|
39422
|
-
|
|
39422
|
+
deniedCards = _ref.deniedCards;
|
|
39423
39423
|
React.useEffect(function () {
|
|
39424
|
-
if (
|
|
39425
|
-
|
|
39426
|
-
return actions.fields.creditCardNumber.addValidator(matchesRegex(
|
|
39424
|
+
if (deniedCards) {
|
|
39425
|
+
deniedCards.map(function (card) {
|
|
39426
|
+
return actions.fields.creditCardNumber.addValidator(matchesRegex(checkDeniedCards(card)));
|
|
39427
39427
|
});
|
|
39428
39428
|
}
|
|
39429
39429
|
}, []);
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ import CountryDropdown from "../../atoms/country-dropdown";
|
|
|
5
5
|
import {
|
|
6
6
|
checkCardBrand,
|
|
7
7
|
noop,
|
|
8
|
-
|
|
8
|
+
checkDeniedCards,
|
|
9
9
|
displayCardBrand
|
|
10
10
|
} from "../../../util/general";
|
|
11
11
|
import {
|
|
@@ -33,13 +33,13 @@ const PaymentFormCard = ({
|
|
|
33
33
|
showWalletCheckbox,
|
|
34
34
|
saveToWallet,
|
|
35
35
|
walletCheckboxMarked,
|
|
36
|
-
|
|
36
|
+
deniedCards
|
|
37
37
|
}) => {
|
|
38
38
|
useEffect(() => {
|
|
39
|
-
if (
|
|
40
|
-
|
|
39
|
+
if (deniedCards) {
|
|
40
|
+
deniedCards.map(card =>
|
|
41
41
|
actions.fields.creditCardNumber.addValidator(
|
|
42
|
-
matchesRegex(
|
|
42
|
+
matchesRegex(checkDeniedCards(card))
|
|
43
43
|
)
|
|
44
44
|
);
|
|
45
45
|
}
|
package/src/util/general.js
CHANGED