@coinflowlabs/react 4.2.7 → 4.2.8
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/README.md +4 -0
- package/build/cjs/card-form/CoinflowCardForm.d.ts +1 -23
- package/build/cjs/card-form/CoinflowCardForm.js +11 -14
- package/build/cjs/card-form/CoinflowCardForm.js.map +1 -1
- package/build/cjs/card-form/CoinflowCardFormHeader.js +2 -2
- package/build/cjs/card-form/CoinflowCardFormHeader.js.map +1 -1
- package/build/cjs/card-form/useCardFormIframe.d.ts +5 -94
- package/build/cjs/card-form/useCardFormIframe.js +50 -164
- package/build/cjs/card-form/useCardFormIframe.js.map +1 -1
- package/build/cjs/common/card-form/TokenEx.d.ts +106 -0
- package/build/cjs/common/card-form/TokenEx.js +4 -0
- package/build/cjs/common/card-form/TokenEx.js.map +1 -0
- package/build/cjs/common/card-form/cardFormTypes.d.ts +46 -0
- package/build/cjs/common/card-form/cardFormTypes.js +14 -0
- package/build/cjs/common/card-form/cardFormTypes.js.map +1 -0
- package/build/cjs/common/card-form/tokenexHelpers.d.ts +43 -0
- package/build/cjs/common/card-form/tokenexHelpers.js +204 -0
- package/build/cjs/common/card-form/tokenexHelpers.js.map +1 -0
- package/build/cjs/common/index.d.ts +3 -0
- package/build/cjs/common/index.js +3 -0
- package/build/cjs/common/index.js.map +1 -1
- package/build/esm/card-form/CoinflowCardForm.d.ts +1 -23
- package/build/esm/card-form/CoinflowCardForm.js +8 -11
- package/build/esm/card-form/CoinflowCardForm.js.map +1 -1
- package/build/esm/card-form/CoinflowCardFormHeader.js +2 -2
- package/build/esm/card-form/CoinflowCardFormHeader.js.map +1 -1
- package/build/esm/card-form/useCardFormIframe.d.ts +5 -94
- package/build/esm/card-form/useCardFormIframe.js +51 -164
- package/build/esm/card-form/useCardFormIframe.js.map +1 -1
- package/build/esm/common/card-form/TokenEx.d.ts +106 -0
- package/build/esm/common/card-form/TokenEx.js +3 -0
- package/build/esm/common/card-form/TokenEx.js.map +1 -0
- package/build/esm/common/card-form/cardFormTypes.d.ts +46 -0
- package/build/esm/common/card-form/cardFormTypes.js +11 -0
- package/build/esm/common/card-form/cardFormTypes.js.map +1 -0
- package/build/esm/common/card-form/tokenexHelpers.d.ts +43 -0
- package/build/esm/common/card-form/tokenexHelpers.js +197 -0
- package/build/esm/common/card-form/tokenexHelpers.js.map +1 -0
- package/build/esm/common/index.d.ts +3 -0
- package/build/esm/common/index.js +3 -0
- package/build/esm/common/index.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,27 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { CardFormInputStyles } from './useCardFormIframe';
|
|
4
|
-
export type CoinflowCardTokenResponse = {
|
|
5
|
-
token: string;
|
|
6
|
-
};
|
|
7
|
-
export interface CoinflowCardNumberInputProps {
|
|
8
|
-
env: CoinflowEnvs;
|
|
9
|
-
css: CardFormInputStyles & {
|
|
10
|
-
cvv: CardFormInputStyles;
|
|
11
|
-
};
|
|
12
|
-
debug?: boolean;
|
|
13
|
-
origins?: string[];
|
|
14
|
-
}
|
|
15
|
-
export interface CoinflowCvvOnlyInputProps {
|
|
16
|
-
token: string;
|
|
17
|
-
cardType: CardType;
|
|
18
|
-
env: CoinflowEnvs;
|
|
19
|
-
css: CardFormInputStyles & {
|
|
20
|
-
cvv: CardFormInputStyles;
|
|
21
|
-
};
|
|
22
|
-
debug?: boolean;
|
|
23
|
-
origins?: string[];
|
|
24
|
-
}
|
|
2
|
+
import { CoinflowCardNumberInputProps, CoinflowCvvOnlyInputProps } from '../common/card-form/cardFormTypes';
|
|
25
3
|
/**
|
|
26
4
|
* Allows merchants to collect card information from their customers in a PCI-compliant way and receive the tokenized card number.
|
|
27
5
|
*
|
|
@@ -4,6 +4,7 @@ exports.CoinflowCardOnlyInput = exports.CoinflowCvvOnlyInput = exports.CoinflowC
|
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
var useCardFormIframe_1 = require("./useCardFormIframe");
|
|
7
|
+
var cardFormTypes_1 = require("../common/card-form/cardFormTypes");
|
|
7
8
|
var CoinflowCardNumberInputComponent = (0, react_1.forwardRef)(function (props, ref) {
|
|
8
9
|
var css = (0, react_1.useMemo)(function () {
|
|
9
10
|
return JSON.stringify(props.css);
|
|
@@ -25,9 +26,10 @@ var CoinflowCardNumberInputComponent = (0, react_1.forwardRef)(function (props,
|
|
|
25
26
|
css: css,
|
|
26
27
|
debug: props.debug,
|
|
27
28
|
origins: props.origins,
|
|
29
|
+
fontFamily: props.font,
|
|
28
30
|
});
|
|
29
|
-
}, [initializeTokenExIframe, css, props.debug, props.origins]);
|
|
30
|
-
return react_1.default.createElement("div", { id:
|
|
31
|
+
}, [initializeTokenExIframe, css, props.debug, props.origins, props.font]);
|
|
32
|
+
return react_1.default.createElement("div", { id: cardFormTypes_1.TokenExCardNumberIframeId });
|
|
31
33
|
});
|
|
32
34
|
/**
|
|
33
35
|
* Allows merchants to collect card information from their customers in a PCI-compliant way and receive the tokenized card number.
|
|
@@ -69,7 +71,7 @@ exports.CoinflowCardNumberInput = (0, react_1.memo)(CoinflowCardNumberInputCompo
|
|
|
69
71
|
/**
|
|
70
72
|
* The CVV number input for creating a new tokenized card
|
|
71
73
|
*/
|
|
72
|
-
exports.CoinflowCvvInput = (0, react_1.memo)(function () { return react_1.default.createElement("div", { id:
|
|
74
|
+
exports.CoinflowCvvInput = (0, react_1.memo)(function () { return react_1.default.createElement("div", { id: cardFormTypes_1.TokenExCvvContainerID }); });
|
|
73
75
|
var CoinflowCvvOnlyInputComponent = (0, react_1.forwardRef)(function (props, ref) {
|
|
74
76
|
var css = (0, react_1.useMemo)(function () {
|
|
75
77
|
return JSON.stringify(props.css);
|
|
@@ -93,16 +95,10 @@ var CoinflowCvvOnlyInputComponent = (0, react_1.forwardRef)(function (props, ref
|
|
|
93
95
|
token: props.token,
|
|
94
96
|
cardType: props.cardType,
|
|
95
97
|
origins: props.origins,
|
|
98
|
+
fontFamily: props.font,
|
|
96
99
|
});
|
|
97
|
-
}, [
|
|
98
|
-
|
|
99
|
-
initializeCvvOnlyTokenExIframe,
|
|
100
|
-
props.debug,
|
|
101
|
-
props.token,
|
|
102
|
-
props.cardType,
|
|
103
|
-
props.origins,
|
|
104
|
-
]);
|
|
105
|
-
return (0, react_1.useMemo)(function () { return react_1.default.createElement("div", { id: useCardFormIframe_1.TokenExCvvContainerID }); }, []);
|
|
100
|
+
}, [css, initializeCvvOnlyTokenExIframe, props.debug, props.token, props.cardType, props.origins, props.font]);
|
|
101
|
+
return (0, react_1.useMemo)(function () { return react_1.default.createElement("div", { id: cardFormTypes_1.TokenExCvvContainerID }); }, []);
|
|
106
102
|
});
|
|
107
103
|
/**
|
|
108
104
|
* Allows merchants to collect the CVV for an already tokenized card in a PCI-compliant way and receive the token with the CVV linked.
|
|
@@ -163,9 +159,10 @@ var CoinflowCardOnlyInputComponent = (0, react_1.forwardRef)(function (props, re
|
|
|
163
159
|
css: css,
|
|
164
160
|
debug: props.debug,
|
|
165
161
|
origins: props.origins,
|
|
162
|
+
fontFamily: props.font,
|
|
166
163
|
});
|
|
167
|
-
}, [initializeTokenExCardOnlyIframe, props.debug, css, props.origins]);
|
|
168
|
-
return react_1.default.createElement("div", { id:
|
|
164
|
+
}, [initializeTokenExCardOnlyIframe, props.debug, css, props.origins, props.font]);
|
|
165
|
+
return react_1.default.createElement("div", { id: cardFormTypes_1.TokenExCardNumberIframeId });
|
|
169
166
|
});
|
|
170
167
|
/**
|
|
171
168
|
* Allows merchants to collect card information from their customers in a PCI-compliant way and receive the tokenized card number.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowCardForm.js","sourceRoot":"","sources":["../../../src/card-form/CoinflowCardForm.tsx"],"names":[],"mappings":";;;;AAAA,qDAMe;
|
|
1
|
+
{"version":3,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;;;;;GAmCG;AACU,QAAA,qBAAqB,GAAG,IAAA,YAAI,EAAC,8BAA8B,CAAC,CAAC"}
|
|
@@ -7,8 +7,8 @@ function CoinflowCardFormHeader(_a) {
|
|
|
7
7
|
var env = _a.env;
|
|
8
8
|
var setTokenExScriptTag = (0, useCardFormIframe_1.useCardFormIframe)(env).setTokenExScriptTag;
|
|
9
9
|
(0, react_1.useEffect)(function () {
|
|
10
|
-
setTokenExScriptTag();
|
|
11
|
-
}, [setTokenExScriptTag]);
|
|
10
|
+
setTokenExScriptTag({ env: env, setTokenExScriptLoaded: function () { } });
|
|
11
|
+
}, [env, setTokenExScriptTag]);
|
|
12
12
|
return null;
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=CoinflowCardFormHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowCardFormHeader.js","sourceRoot":"","sources":["../../../src/card-form/CoinflowCardFormHeader.tsx"],"names":[],"mappings":";;AAIA,wDAQC;AAZD,+BAAgC;AAChC,yDAAsD;AAGtD,SAAgB,sBAAsB,CAAC,EAA0B;QAAzB,GAAG,SAAA;IAClC,IAAA,mBAAmB,GAAI,IAAA,qCAAiB,EAAC,GAAG,CAAC,oBAA1B,CAA2B;IAErD,IAAA,iBAAS,EAAC;QACR,mBAAmB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"CoinflowCardFormHeader.js","sourceRoot":"","sources":["../../../src/card-form/CoinflowCardFormHeader.tsx"],"names":[],"mappings":";;AAIA,wDAQC;AAZD,+BAAgC;AAChC,yDAAsD;AAGtD,SAAgB,sBAAsB,CAAC,EAA0B;QAAzB,GAAG,SAAA;IAClC,IAAA,mBAAmB,GAAI,IAAA,qCAAiB,EAAC,GAAG,CAAC,oBAA1B,CAA2B;IAErD,IAAA,iBAAS,EAAC;QACR,mBAAmB,CAAC,EAAC,GAAG,KAAA,EAAE,sBAAsB,EAAE,cAAO,CAAC,EAAC,CAAC,CAAC;IAC/D,CAAC,EAAE,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAE/B,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,99 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CardType, CoinflowEnvs } from '../common';
|
|
3
|
-
import { TokenizationResponse } from './TokenEx';
|
|
4
|
-
export declare const TokenExCardNumberIframeId = "tokenExCardNumber";
|
|
5
|
-
export declare const TokenExCvvContainerID = "tokenExCardCvv";
|
|
6
|
-
export interface TokenExIframe extends ReturnType<typeof TokenEx.Iframe> {
|
|
7
|
-
tokenize: () => Promise<TokenizationResponse>;
|
|
8
|
-
}
|
|
9
|
-
export interface TokenExIFrameConfiguration {
|
|
10
|
-
origin: string;
|
|
11
|
-
timestamp: string;
|
|
12
|
-
tokenExID: string;
|
|
13
|
-
tokenScheme: string;
|
|
14
|
-
authenticationKey: string;
|
|
15
|
-
pci: true;
|
|
16
|
-
token?: string;
|
|
17
|
-
}
|
|
18
|
-
export interface CardFormInputStyles {
|
|
19
|
-
base: CSSProperties | string;
|
|
20
|
-
focus?: CSSProperties | string;
|
|
21
|
-
error?: CSSProperties | string;
|
|
22
|
-
}
|
|
1
|
+
import { CoinflowEnvs, doInitializeCvvOnlyTokenExIframe, doInitializeTokenExCardOnlyIframe, doInitializeTokenExIframe, setTokenExScriptTag, TokenExIframe } from '../common';
|
|
23
2
|
export declare function useCardFormIframe(env: CoinflowEnvs): {
|
|
24
3
|
tokenExIframe: TokenExIframe | undefined;
|
|
25
|
-
initializeTokenExIframe: ({ css, fontFamily, debug, origins, }:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
debug?: boolean;
|
|
29
|
-
origins: string[] | undefined;
|
|
30
|
-
}) => Promise<{
|
|
31
|
-
tokenize: () => Promise<TokenizationResponse>;
|
|
32
|
-
load(): void;
|
|
33
|
-
on: (event: string, callback: (data?: any) => void) => void;
|
|
34
|
-
validate(): void;
|
|
35
|
-
reset(): void;
|
|
36
|
-
blur(): void;
|
|
37
|
-
cvvBlur(): void;
|
|
38
|
-
focus(): void;
|
|
39
|
-
cvvFocus(): void;
|
|
40
|
-
remove(): void;
|
|
41
|
-
toggleMask(): void;
|
|
42
|
-
toggleCvvMask(): void;
|
|
43
|
-
setPAN(pan: string): void;
|
|
44
|
-
binLookup(): void;
|
|
45
|
-
validateConfig(): void;
|
|
46
|
-
setFraudServicesRequestDetails(data: string): void;
|
|
47
|
-
} | undefined>;
|
|
48
|
-
initializeCvvOnlyTokenExIframe: ({ token, cardType, css, debug, fontFamily, origins, }: {
|
|
49
|
-
token: string;
|
|
50
|
-
cardType: CardType;
|
|
51
|
-
css: string;
|
|
52
|
-
debug?: boolean;
|
|
53
|
-
fontFamily?: string;
|
|
54
|
-
origins: string[] | undefined;
|
|
55
|
-
}) => Promise<{
|
|
56
|
-
tokenize: () => Promise<TokenizationResponse>;
|
|
57
|
-
load(): void;
|
|
58
|
-
on: (event: string, callback: (data?: any) => void) => void;
|
|
59
|
-
validate(): void;
|
|
60
|
-
reset(): void;
|
|
61
|
-
blur(): void;
|
|
62
|
-
cvvBlur(): void;
|
|
63
|
-
focus(): void;
|
|
64
|
-
cvvFocus(): void;
|
|
65
|
-
remove(): void;
|
|
66
|
-
toggleMask(): void;
|
|
67
|
-
toggleCvvMask(): void;
|
|
68
|
-
setPAN(pan: string): void;
|
|
69
|
-
binLookup(): void;
|
|
70
|
-
validateConfig(): void;
|
|
71
|
-
setFraudServicesRequestDetails(data: string): void;
|
|
72
|
-
} | undefined>;
|
|
73
|
-
initializeTokenExCardOnlyIframe: ({ css, fontFamily, debug, origins, }: {
|
|
74
|
-
css: string;
|
|
75
|
-
fontFamily?: string;
|
|
76
|
-
debug?: boolean;
|
|
77
|
-
origins: string[] | undefined;
|
|
78
|
-
}) => Promise<{
|
|
79
|
-
tokenize: () => Promise<TokenizationResponse>;
|
|
80
|
-
load(): void;
|
|
81
|
-
on: (event: string, callback: (data?: any) => void) => void;
|
|
82
|
-
validate(): void;
|
|
83
|
-
reset(): void;
|
|
84
|
-
blur(): void;
|
|
85
|
-
cvvBlur(): void;
|
|
86
|
-
focus(): void;
|
|
87
|
-
cvvFocus(): void;
|
|
88
|
-
remove(): void;
|
|
89
|
-
toggleMask(): void;
|
|
90
|
-
toggleCvvMask(): void;
|
|
91
|
-
setPAN(pan: string): void;
|
|
92
|
-
binLookup(): void;
|
|
93
|
-
validateConfig(): void;
|
|
94
|
-
setFraudServicesRequestDetails(data: string): void;
|
|
95
|
-
} | undefined>;
|
|
4
|
+
initializeTokenExIframe: ({ css, fontFamily, debug, origins, }: Omit<Parameters<typeof doInitializeTokenExIframe>[0], "env" | "tokenExScriptLoaded" | "setCachedToken" | "setLoaded">) => Promise<TokenExIframe | undefined>;
|
|
5
|
+
initializeCvvOnlyTokenExIframe: ({ token, cardType, css, debug, fontFamily, origins, }: Omit<Parameters<typeof doInitializeCvvOnlyTokenExIframe>[0], "env" | "tokenExScriptLoaded" | "setCachedToken" | "setLoaded">) => Promise<TokenExIframe | undefined>;
|
|
6
|
+
initializeTokenExCardOnlyIframe: ({ css, fontFamily, debug, origins, }: Omit<Parameters<typeof doInitializeTokenExCardOnlyIframe>[0], "env" | "tokenExScriptLoaded" | "setCachedToken" | "setLoaded">) => Promise<TokenExIframe | undefined>;
|
|
96
7
|
loaded: boolean;
|
|
97
8
|
cachedToken: string | undefined;
|
|
98
|
-
setTokenExScriptTag:
|
|
9
|
+
setTokenExScriptTag: typeof setTokenExScriptTag;
|
|
99
10
|
};
|
|
@@ -1,176 +1,86 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var _a;
|
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.TokenExCvvContainerID = exports.TokenExCardNumberIframeId = void 0;
|
|
5
3
|
exports.useCardFormIframe = useCardFormIframe;
|
|
6
4
|
var tslib_1 = require("tslib");
|
|
7
5
|
var react_1 = require("react");
|
|
8
6
|
var common_1 = require("../common");
|
|
9
|
-
exports.TokenExCardNumberIframeId = 'tokenExCardNumber';
|
|
10
|
-
exports.TokenExCvvContainerID = 'tokenExCardCvv';
|
|
11
|
-
var CARD_TYPE_MAPPING = (_a = {},
|
|
12
|
-
_a[common_1.CardType.VISA] = 'visa',
|
|
13
|
-
_a[common_1.CardType.MASTERCARD] = 'masterCard',
|
|
14
|
-
_a[common_1.CardType.AMEX] = 'americanExpress',
|
|
15
|
-
_a[common_1.CardType.DISCOVER] = 'discover',
|
|
16
|
-
_a);
|
|
17
7
|
function useCardFormIframe(env) {
|
|
18
8
|
var _this = this;
|
|
19
9
|
var _a = (0, react_1.useState)(false), loaded = _a[0], setLoaded = _a[1];
|
|
20
10
|
var _b = (0, react_1.useState)(false), tokenExScriptLoaded = _b[0], setTokenExScriptLoaded = _b[1];
|
|
21
11
|
var _c = (0, react_1.useState)(undefined), tokenExIframe = _c[0], setTokenExIframe = _c[1];
|
|
22
12
|
var _d = (0, react_1.useState)(undefined), cachedToken = _d[0], setCachedToken = _d[1];
|
|
23
|
-
var getIframeConfig = (0, react_1.useCallback)(function (_a) {
|
|
24
|
-
var token = _a.token, origins = _a.origins;
|
|
25
|
-
return fetch(new common_1.CoinflowUtils(env).url + '/api/checkout/authentication-key', {
|
|
26
|
-
method: 'POST',
|
|
27
|
-
headers: {
|
|
28
|
-
'Content-Type': 'application/json',
|
|
29
|
-
},
|
|
30
|
-
body: JSON.stringify({
|
|
31
|
-
origins: tslib_1.__spreadArray(tslib_1.__spreadArray([], (origins !== null && origins !== void 0 ? origins : []), true), [window.location.origin], false),
|
|
32
|
-
token: token,
|
|
33
|
-
}),
|
|
34
|
-
}).then(function (res) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
35
|
-
return tslib_1.__generator(this, function (_a) {
|
|
36
|
-
switch (_a.label) {
|
|
37
|
-
case 0: return [4 /*yield*/, res.json()];
|
|
38
|
-
case 1: return [2 /*return*/, (_a.sent())];
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
}); });
|
|
42
|
-
}, [env]);
|
|
43
|
-
var getStylesAndFont = (0, react_1.useCallback)(function (s) {
|
|
44
|
-
var _a, _b, _c;
|
|
45
|
-
var css = JSON.parse(s);
|
|
46
|
-
var styles = {
|
|
47
|
-
base: CSSPropertiesToComponent(css.base),
|
|
48
|
-
focus: CSSPropertiesToComponent(css.focus),
|
|
49
|
-
error: CSSPropertiesToComponent(css.error),
|
|
50
|
-
cvv: {
|
|
51
|
-
base: CSSPropertiesToComponent((_a = css.cvv) === null || _a === void 0 ? void 0 : _a.base),
|
|
52
|
-
focus: CSSPropertiesToComponent((_b = css.cvv) === null || _b === void 0 ? void 0 : _b.focus),
|
|
53
|
-
error: CSSPropertiesToComponent((_c = css.cvv) === null || _c === void 0 ? void 0 : _c.error),
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
return { styles: styles };
|
|
57
|
-
}, []);
|
|
58
|
-
var setTokenExScriptTag = (0, react_1.useCallback)(function () {
|
|
59
|
-
var scriptTagId = 'tokenex-script';
|
|
60
|
-
if (document.head.querySelector("#".concat(scriptTagId)))
|
|
61
|
-
return;
|
|
62
|
-
var sdkScriptTag = document.createElement('script');
|
|
63
|
-
sdkScriptTag.src =
|
|
64
|
-
env === 'prod'
|
|
65
|
-
? 'https://htp.tokenex.com/iframe/iframe-v3.min.js'
|
|
66
|
-
: 'https://test-htp.tokenex.com/iframe/iframe-v3.min.js';
|
|
67
|
-
sdkScriptTag.id = scriptTagId;
|
|
68
|
-
document.head.appendChild(sdkScriptTag);
|
|
69
|
-
document.getElementById(scriptTagId).addEventListener('load', function () {
|
|
70
|
-
console.log('Setting tokenExScriptLoaded to true!');
|
|
71
|
-
setTokenExScriptLoaded(true);
|
|
72
|
-
});
|
|
73
|
-
}, [env]);
|
|
74
13
|
(0, react_1.useEffect)(function () {
|
|
75
|
-
setTokenExScriptTag();
|
|
76
|
-
}, [
|
|
77
|
-
var loadIframe = (0, react_1.useCallback)(function (iframe) {
|
|
78
|
-
var tokenize = function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
79
|
-
return tslib_1.__generator(this, function (_a) {
|
|
80
|
-
switch (_a.label) {
|
|
81
|
-
case 0:
|
|
82
|
-
iframe.tokenize();
|
|
83
|
-
return [4 /*yield*/, new Promise(function (resolve, reject) {
|
|
84
|
-
iframe.on('tokenize', function (data) {
|
|
85
|
-
setCachedToken(data.token);
|
|
86
|
-
resolve(data);
|
|
87
|
-
});
|
|
88
|
-
iframe.on('validate', function (data) {
|
|
89
|
-
// noinspection PointlessBooleanExpressionJS
|
|
90
|
-
var isInvalid = !data.isValid || data.isCvvValid === false;
|
|
91
|
-
if (isInvalid)
|
|
92
|
-
reject(data);
|
|
93
|
-
});
|
|
94
|
-
})];
|
|
95
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
}); };
|
|
99
|
-
iframe.on('change', function () { return setCachedToken(undefined); });
|
|
100
|
-
iframe.on('cvvChange', function () { return setCachedToken(undefined); });
|
|
101
|
-
iframe.on('load', function () {
|
|
102
|
-
setTimeout(function () { return setLoaded(true); }, 350);
|
|
103
|
-
var el = document.querySelector('#tx_iframe_tokenExCardNumber');
|
|
104
|
-
if (el) {
|
|
105
|
-
// noinspection JSDeprecatedSymbols
|
|
106
|
-
el.scrolling = 'no';
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
setLoaded(false);
|
|
110
|
-
iframe.load();
|
|
111
|
-
var overriden = tslib_1.__assign(tslib_1.__assign({}, iframe), { tokenize: tokenize });
|
|
112
|
-
setTokenExIframe(overriden);
|
|
113
|
-
return overriden;
|
|
114
|
-
}, []);
|
|
14
|
+
(0, common_1.setTokenExScriptTag)({ env: env, setTokenExScriptLoaded: setTokenExScriptLoaded });
|
|
15
|
+
}, [env, setTokenExScriptLoaded]);
|
|
115
16
|
var initializeCvvOnlyTokenExIframe = (0, react_1.useCallback)(function (_a) { return tslib_1.__awaiter(_this, [_a], void 0, function (_b) {
|
|
116
|
-
var
|
|
17
|
+
var iframe;
|
|
117
18
|
var token = _b.token, cardType = _b.cardType, css = _b.css, debug = _b.debug, fontFamily = _b.fontFamily, origins = _b.origins;
|
|
118
19
|
return tslib_1.__generator(this, function (_c) {
|
|
119
20
|
switch (_c.label) {
|
|
120
|
-
case 0:
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
21
|
+
case 0: return [4 /*yield*/, (0, common_1.doInitializeCvvOnlyTokenExIframe)({
|
|
22
|
+
token: token,
|
|
23
|
+
cardType: cardType,
|
|
24
|
+
css: css,
|
|
25
|
+
debug: debug,
|
|
26
|
+
fontFamily: fontFamily,
|
|
27
|
+
origins: origins,
|
|
28
|
+
tokenExScriptLoaded: tokenExScriptLoaded,
|
|
29
|
+
env: env,
|
|
30
|
+
setCachedToken: setCachedToken,
|
|
31
|
+
setLoaded: setLoaded,
|
|
32
|
+
})];
|
|
127
33
|
case 1:
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
iframe = TokenEx.Iframe(exports.TokenExCvvContainerID, config);
|
|
132
|
-
return [2 /*return*/, loadIframe(iframe)];
|
|
34
|
+
iframe = _c.sent();
|
|
35
|
+
setTokenExIframe(iframe);
|
|
36
|
+
return [2 /*return*/, iframe];
|
|
133
37
|
}
|
|
134
38
|
});
|
|
135
|
-
}); }, [
|
|
39
|
+
}); }, [env, tokenExScriptLoaded]);
|
|
136
40
|
var initializeTokenExIframe = (0, react_1.useCallback)(function (_a) { return tslib_1.__awaiter(_this, [_a], void 0, function (_b) {
|
|
137
|
-
var
|
|
41
|
+
var iframe;
|
|
138
42
|
var css = _b.css, fontFamily = _b.fontFamily, debug = _b.debug, origins = _b.origins;
|
|
139
43
|
return tslib_1.__generator(this, function (_c) {
|
|
140
44
|
switch (_c.label) {
|
|
141
|
-
case 0:
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
45
|
+
case 0: return [4 /*yield*/, (0, common_1.doInitializeTokenExIframe)({
|
|
46
|
+
css: css,
|
|
47
|
+
debug: debug,
|
|
48
|
+
fontFamily: fontFamily,
|
|
49
|
+
origins: origins,
|
|
50
|
+
tokenExScriptLoaded: tokenExScriptLoaded,
|
|
51
|
+
env: env,
|
|
52
|
+
setCachedToken: setCachedToken,
|
|
53
|
+
setLoaded: setLoaded,
|
|
54
|
+
})];
|
|
147
55
|
case 1:
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
return [2 /*return*/, loadIframe(iframe)];
|
|
56
|
+
iframe = _c.sent();
|
|
57
|
+
setTokenExIframe(iframe);
|
|
58
|
+
return [2 /*return*/, iframe];
|
|
152
59
|
}
|
|
153
60
|
});
|
|
154
|
-
}); }, [
|
|
61
|
+
}); }, [env, tokenExScriptLoaded]);
|
|
155
62
|
var initializeTokenExCardOnlyIframe = (0, react_1.useCallback)(function (_a) { return tslib_1.__awaiter(_this, [_a], void 0, function (_b) {
|
|
156
|
-
var
|
|
63
|
+
var iframe;
|
|
157
64
|
var css = _b.css, fontFamily = _b.fontFamily, debug = _b.debug, origins = _b.origins;
|
|
158
65
|
return tslib_1.__generator(this, function (_c) {
|
|
159
66
|
switch (_c.label) {
|
|
160
|
-
case 0:
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
67
|
+
case 0: return [4 /*yield*/, (0, common_1.doInitializeTokenExCardOnlyIframe)({
|
|
68
|
+
css: css,
|
|
69
|
+
debug: debug,
|
|
70
|
+
fontFamily: fontFamily,
|
|
71
|
+
origins: origins,
|
|
72
|
+
tokenExScriptLoaded: tokenExScriptLoaded,
|
|
73
|
+
env: env,
|
|
74
|
+
setCachedToken: setCachedToken,
|
|
75
|
+
setLoaded: setLoaded,
|
|
76
|
+
})];
|
|
166
77
|
case 1:
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
return [2 /*return*/, loadIframe(iframe)];
|
|
78
|
+
iframe = _c.sent();
|
|
79
|
+
setTokenExIframe(iframe);
|
|
80
|
+
return [2 /*return*/, iframe];
|
|
171
81
|
}
|
|
172
82
|
});
|
|
173
|
-
}); }, [
|
|
83
|
+
}); }, [env, tokenExScriptLoaded]);
|
|
174
84
|
(0, react_1.useEffect)(function () {
|
|
175
85
|
if (!tokenExIframe)
|
|
176
86
|
return;
|
|
@@ -184,31 +94,7 @@ function useCardFormIframe(env) {
|
|
|
184
94
|
initializeTokenExCardOnlyIframe: initializeTokenExCardOnlyIframe,
|
|
185
95
|
loaded: loaded,
|
|
186
96
|
cachedToken: cachedToken,
|
|
187
|
-
setTokenExScriptTag: setTokenExScriptTag,
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
function CSSPropertiesToComponent(dict) {
|
|
191
|
-
if (!dict)
|
|
192
|
-
return '';
|
|
193
|
-
if (typeof dict === 'string')
|
|
194
|
-
return dict;
|
|
195
|
-
var str = '';
|
|
196
|
-
var _loop_1 = function (key, value) {
|
|
197
|
-
var clo = '';
|
|
198
|
-
key.split('').forEach(function (lt) {
|
|
199
|
-
if (lt.toUpperCase() === lt) {
|
|
200
|
-
clo += '-' + lt.toLowerCase();
|
|
201
|
-
}
|
|
202
|
-
else {
|
|
203
|
-
clo += lt;
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
str += clo + ':' + value + ';';
|
|
97
|
+
setTokenExScriptTag: common_1.setTokenExScriptTag,
|
|
207
98
|
};
|
|
208
|
-
for (var _i = 0, _a = Object.entries(dict); _i < _a.length; _i++) {
|
|
209
|
-
var _b = _a[_i], key = _b[0], value = _b[1];
|
|
210
|
-
_loop_1(key, value);
|
|
211
|
-
}
|
|
212
|
-
return str;
|
|
213
99
|
}
|
|
214
100
|
//# sourceMappingURL=useCardFormIframe.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCardFormIframe.js","sourceRoot":"","sources":["../../../src/card-form/useCardFormIframe.tsx"],"names":[],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C;IACtC,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,OAAO;QACL,aAAa,eAAA;QACb,uBAAuB,yBAAA;QACvB,8BAA8B,gCAAA;QAC9B,+BAA+B,iCAAA;QAC/B,MAAM,QAAA;QACN,WAAW,aAAA;QACX,mBAAmB,8BAAA;KACpB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
export interface TokenizationResponse {
|
|
2
|
+
cardType: string;
|
|
3
|
+
cvvIncluded: true;
|
|
4
|
+
firstSix: string;
|
|
5
|
+
lastFour: string;
|
|
6
|
+
referenceNumber: string;
|
|
7
|
+
token: string;
|
|
8
|
+
tokenHMAC: string;
|
|
9
|
+
}
|
|
10
|
+
declare global {
|
|
11
|
+
namespace TokenEx {
|
|
12
|
+
interface FraudServicesConfig {
|
|
13
|
+
useKount?: boolean;
|
|
14
|
+
kount?: {
|
|
15
|
+
merchantId?: string;
|
|
16
|
+
mode?: string;
|
|
17
|
+
anId?: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
interface Config {
|
|
21
|
+
debug?: boolean;
|
|
22
|
+
enablePrettyFormat?: boolean;
|
|
23
|
+
maskInput?: boolean;
|
|
24
|
+
enableValidateOnBlur?: boolean;
|
|
25
|
+
enableAriaRequired?: boolean;
|
|
26
|
+
pci?: boolean;
|
|
27
|
+
cvvOnly?: boolean;
|
|
28
|
+
allowUnknownCardTypes?: boolean;
|
|
29
|
+
enableAutoComplete?: boolean;
|
|
30
|
+
returnAutoCompleteValues?: boolean;
|
|
31
|
+
returnKhash?: boolean;
|
|
32
|
+
returnWhash?: boolean;
|
|
33
|
+
enforceLuhnCompliance?: boolean;
|
|
34
|
+
use3DS?: boolean;
|
|
35
|
+
validateOnKeyUp?: boolean;
|
|
36
|
+
validateOnCvvKeyUp?: boolean;
|
|
37
|
+
expiresInSeconds?: number;
|
|
38
|
+
useExtendedBIN?: boolean;
|
|
39
|
+
inlineIframeJavaScript?: boolean;
|
|
40
|
+
iframeVersion?: number;
|
|
41
|
+
authenticationKey?: string;
|
|
42
|
+
origin?: string;
|
|
43
|
+
tokenExID?: string;
|
|
44
|
+
timestamp?: string;
|
|
45
|
+
tokenScheme?: string;
|
|
46
|
+
token?: string;
|
|
47
|
+
customDataLabel?: string;
|
|
48
|
+
customCvvDataLabel?: string;
|
|
49
|
+
title?: string;
|
|
50
|
+
cvvTitle?: string;
|
|
51
|
+
inputTitle?: string;
|
|
52
|
+
cvvInputTitle?: string;
|
|
53
|
+
cardMaxLengths?: {
|
|
54
|
+
visa?: number;
|
|
55
|
+
mastercard?: number;
|
|
56
|
+
americanExpress?: number;
|
|
57
|
+
discover?: number;
|
|
58
|
+
jcb?: number;
|
|
59
|
+
diners?: number;
|
|
60
|
+
};
|
|
61
|
+
fraudServices?: FraudServicesConfig;
|
|
62
|
+
threeDSMethodNotificationUrl?: string;
|
|
63
|
+
customDataTypes?: string | object;
|
|
64
|
+
cvvContainerID?: string;
|
|
65
|
+
cvvPlaceholder?: string;
|
|
66
|
+
cardType?: string;
|
|
67
|
+
forterSiteId?: string;
|
|
68
|
+
forterUsername?: string;
|
|
69
|
+
customRegEx?: string;
|
|
70
|
+
placeholder?: string;
|
|
71
|
+
inputType?: string;
|
|
72
|
+
inputMode?: string;
|
|
73
|
+
font?: string;
|
|
74
|
+
cvv?: boolean;
|
|
75
|
+
styles: {
|
|
76
|
+
base: string;
|
|
77
|
+
focus: string;
|
|
78
|
+
error: string;
|
|
79
|
+
cvv: {
|
|
80
|
+
base: string;
|
|
81
|
+
focus: string;
|
|
82
|
+
error: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
interface IframeAPI {
|
|
87
|
+
load(): void;
|
|
88
|
+
on: (event: string, callback: (data?: any) => void) => void;
|
|
89
|
+
tokenize(): void;
|
|
90
|
+
validate(): void;
|
|
91
|
+
reset(): void;
|
|
92
|
+
blur(): void;
|
|
93
|
+
cvvBlur(): void;
|
|
94
|
+
focus(): void;
|
|
95
|
+
cvvFocus(): void;
|
|
96
|
+
remove(): void;
|
|
97
|
+
toggleMask(): void;
|
|
98
|
+
toggleCvvMask(): void;
|
|
99
|
+
setPAN(pan: string): void;
|
|
100
|
+
binLookup(): void;
|
|
101
|
+
validateConfig(): void;
|
|
102
|
+
setFraudServicesRequestDetails(data: string): void;
|
|
103
|
+
}
|
|
104
|
+
function Iframe(containerID: string, configuration: Config): IframeAPI;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TokenEx.js","sourceRoot":"","sources":["../../../../src/common/card-form/TokenEx.ts"],"names":[],"mappings":";AAAA,kDAAkD"}
|