@coinflowlabs/react 4.1.3 → 4.2.2

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.
Files changed (44) hide show
  1. package/build/cjs/card-form/CoinflowCardForm.d.ts +138 -0
  2. package/build/cjs/card-form/CoinflowCardForm.js +177 -0
  3. package/build/cjs/card-form/CoinflowCardForm.js.map +1 -0
  4. package/build/cjs/card-form/TokenEx.d.ts +106 -0
  5. package/build/cjs/card-form/TokenEx.js +4 -0
  6. package/build/cjs/card-form/TokenEx.js.map +1 -0
  7. package/build/cjs/card-form/useCardFormIframe.d.ts +99 -0
  8. package/build/cjs/card-form/useCardFormIframe.js +191 -0
  9. package/build/cjs/card-form/useCardFormIframe.js.map +1 -0
  10. package/build/cjs/common/CoinflowTypes.d.ts +25 -1
  11. package/build/cjs/common/CoinflowTypes.js +8 -1
  12. package/build/cjs/common/CoinflowTypes.js.map +1 -1
  13. package/build/cjs/common/CoinflowUtils.d.ts +1 -1
  14. package/build/cjs/common/CoinflowUtils.js +3 -1
  15. package/build/cjs/common/CoinflowUtils.js.map +1 -1
  16. package/build/cjs/index.d.ts +1 -1
  17. package/build/cjs/index.js +1 -1
  18. package/build/cjs/index.js.map +1 -1
  19. package/build/esm/card-form/CoinflowCardForm.d.ts +138 -0
  20. package/build/esm/card-form/CoinflowCardForm.js +173 -0
  21. package/build/esm/card-form/CoinflowCardForm.js.map +1 -0
  22. package/build/esm/card-form/TokenEx.d.ts +106 -0
  23. package/build/esm/card-form/TokenEx.js +3 -0
  24. package/build/esm/card-form/TokenEx.js.map +1 -0
  25. package/build/esm/card-form/useCardFormIframe.d.ts +99 -0
  26. package/build/esm/card-form/useCardFormIframe.js +187 -0
  27. package/build/esm/card-form/useCardFormIframe.js.map +1 -0
  28. package/build/esm/common/CoinflowTypes.d.ts +25 -1
  29. package/build/esm/common/CoinflowTypes.js +7 -0
  30. package/build/esm/common/CoinflowTypes.js.map +1 -1
  31. package/build/esm/common/CoinflowUtils.d.ts +1 -1
  32. package/build/esm/common/CoinflowUtils.js +3 -1
  33. package/build/esm/common/CoinflowUtils.js.map +1 -1
  34. package/build/esm/index.d.ts +1 -1
  35. package/build/esm/index.js +1 -1
  36. package/build/esm/index.js.map +1 -1
  37. package/build/tsconfig.tsbuildinfo +1 -1
  38. package/package.json +1 -1
  39. package/build/cjs/CoinflowCardForm.d.ts +0 -39
  40. package/build/cjs/CoinflowCardForm.js +0 -100
  41. package/build/cjs/CoinflowCardForm.js.map +0 -1
  42. package/build/esm/CoinflowCardForm.d.ts +0 -39
  43. package/build/esm/CoinflowCardForm.js +0 -97
  44. package/build/esm/CoinflowCardForm.js.map +0 -1
@@ -0,0 +1,138 @@
1
+ import React from 'react';
2
+ import { CardType, CoinflowEnvs } from '../common';
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
+ }
14
+ export interface CoinflowCvvOnlyInputProps {
15
+ token: string;
16
+ cardType: CardType;
17
+ env: CoinflowEnvs;
18
+ css: CardFormInputStyles & {
19
+ cvv: CardFormInputStyles;
20
+ };
21
+ debug?: boolean;
22
+ }
23
+ /**
24
+ * Allows merchants to collect card information from their customers in a PCI-compliant way and receive the tokenized card number.
25
+ *
26
+ * Usage:
27
+ * ```tsx
28
+ * const ref = useRef<{getToken(): Promise<{token: string}>}>();
29
+ *
30
+ * <CoinflowCardNumberInput
31
+ * ref={ref}
32
+ * env={'sandbox'}
33
+ * debug={true}
34
+ * css={{
35
+ * base: 'font-family: Arial, sans-serif;padding: 0 8px;border: 1px solid rgba(0, 0, 0, 0.2);margin: 0;width: 100%;font-size: 13px;line-height: 30px;height: 32px;box-sizing: border-box;-moz-box-sizing: border-box;',
36
+ * focus:
37
+ * 'box-shadow: 0 0 6px 0 rgba(0, 132, 255, 0.5);border: 1px solid rgba(0, 132, 255, 0.5);outline: 0;',
38
+ * error:
39
+ * 'box-shadow: 0 0 6px 0 rgba(224, 57, 57, 0.5);border: 1px solid rgba(224, 57, 57, 0.5);',
40
+ * cvv: {
41
+ * base: 'font-family: Arial, sans-serif;padding: 0 8px;border: 1px solid rgba(0, 0, 0, 0.2);margin: 0;width: 100%;font-size: 13px;line-height: 30px;height: 32px;box-sizing: border-box;-moz-box-sizing: border-box;',
42
+ * focus:
43
+ * 'box-shadow: 0 0 6px 0 rgba(0, 132, 255, 0.5);border: 1px solid rgba(0, 132, 255, 0.5);outline: 0;',
44
+ * error:
45
+ * 'box-shadow: 0 0 6px 0 rgba(224, 57, 57, 0.5);border: 1px solid rgba(224, 57, 57, 0.5);',
46
+ * },
47
+ * }}
48
+ * />
49
+ * <CoinflowCvvInput />
50
+ *
51
+ * <button onClick={() => {
52
+ * ref.current?.getToken()
53
+ * .then(({token}) => console.log(token))
54
+ * .catch(e => console.error('GET TOKEN ERROR', e))
55
+ * }}>Get Token</button>
56
+ *
57
+ * ```
58
+ */
59
+ export declare const CoinflowCardNumberInput: React.ForwardRefExoticComponent<CoinflowCardNumberInputProps & React.RefAttributes<unknown>>;
60
+ /**
61
+ * The CVV number input for creating a new tokenized card
62
+ */
63
+ export declare function CoinflowCvvInput(): React.JSX.Element;
64
+ /**
65
+ * Allows merchants to collect the CVV for an already tokenized card in a PCI-compliant way and receive the token with the CVV linked.
66
+ *
67
+ * Usage:
68
+ * ```tsx
69
+ * const ref = useRef<{getToken(): Promise<{token: string}>}>();
70
+ *
71
+ * <CoinflowCvvOnlyInput
72
+ * ref={ref}
73
+ * cardType={'visa'}
74
+ * token={'411111YJM5TX1111'}
75
+ * env={'sandbox'}
76
+ * debug={true}
77
+ * css={{
78
+ * base: 'font-family: Arial, sans-serif;padding: 0 8px;border: 1px solid rgba(0, 0, 0, 0.2);margin: 0;width: 100%;font-size: 13px;line-height: 30px;height: 32px;box-sizing: border-box;-moz-box-sizing: border-box;',
79
+ * focus:
80
+ * 'box-shadow: 0 0 6px 0 rgba(0, 132, 255, 0.5);border: 1px solid rgba(0, 132, 255, 0.5);outline: 0;',
81
+ * error:
82
+ * 'box-shadow: 0 0 6px 0 rgba(224, 57, 57, 0.5);border: 1px solid rgba(224, 57, 57, 0.5);',
83
+ * cvv: {
84
+ * base: 'font-family: Arial, sans-serif;padding: 0 8px;border: 1px solid rgba(0, 0, 0, 0.2);margin: 0;width: 100%;font-size: 13px;line-height: 30px;height: 32px;box-sizing: border-box;-moz-box-sizing: border-box;',
85
+ * focus:
86
+ * 'box-shadow: 0 0 6px 0 rgba(0, 132, 255, 0.5);border: 1px solid rgba(0, 132, 255, 0.5);outline: 0;',
87
+ * error:
88
+ * 'box-shadow: 0 0 6px 0 rgba(224, 57, 57, 0.5);border: 1px solid rgba(224, 57, 57, 0.5);',
89
+ * },
90
+ * }}
91
+ * />
92
+ *
93
+ * <button onClick={() => {
94
+ * ref.current?.getToken()
95
+ * .then(({token}) => console.log(token))
96
+ * .catch(e => console.error('GET TOKEN ERROR', e))
97
+ * }}>Get Token</button>
98
+ *
99
+ * ```
100
+ */
101
+ export declare const CoinflowCvvOnlyInput: React.ForwardRefExoticComponent<CoinflowCvvOnlyInputProps & React.RefAttributes<unknown>>;
102
+ /**
103
+ * Allows merchants to collect card information from their customers in a PCI-compliant way and receive the tokenized card number.
104
+ * The `CoinflowCardOnlyInput` is used for collecting a debit card for users to be able to withdraw their funds directly to.
105
+ *
106
+ * Usage:
107
+ * ```tsx
108
+ * const ref = useRef<{getToken(): Promise<{token: string}>}>();
109
+ *
110
+ * <CoinflowCardOnlyInput
111
+ * ref={ref}
112
+ * env={'sandbox'}
113
+ * debug={true}
114
+ * css={{
115
+ * base: 'font-family: Arial, sans-serif;padding: 0 8px;border: 1px solid rgba(0, 0, 0, 0.2);margin: 0;width: 100%;font-size: 13px;line-height: 30px;height: 32px;box-sizing: border-box;-moz-box-sizing: border-box;',
116
+ * focus:
117
+ * 'box-shadow: 0 0 6px 0 rgba(0, 132, 255, 0.5);border: 1px solid rgba(0, 132, 255, 0.5);outline: 0;',
118
+ * error:
119
+ * 'box-shadow: 0 0 6px 0 rgba(224, 57, 57, 0.5);border: 1px solid rgba(224, 57, 57, 0.5);',
120
+ * cvv: {
121
+ * base: 'font-family: Arial, sans-serif;padding: 0 8px;border: 1px solid rgba(0, 0, 0, 0.2);margin: 0;width: 100%;font-size: 13px;line-height: 30px;height: 32px;box-sizing: border-box;-moz-box-sizing: border-box;',
122
+ * focus:
123
+ * 'box-shadow: 0 0 6px 0 rgba(0, 132, 255, 0.5);border: 1px solid rgba(0, 132, 255, 0.5);outline: 0;',
124
+ * error:
125
+ * 'box-shadow: 0 0 6px 0 rgba(224, 57, 57, 0.5);border: 1px solid rgba(224, 57, 57, 0.5);',
126
+ * },
127
+ * }}
128
+ * />
129
+ *
130
+ * <button onClick={() => {
131
+ * ref.current?.getToken()
132
+ * .then(({token}) => console.log(token))
133
+ * .catch(e => console.error('GET TOKEN ERROR', e))
134
+ * }}>Get Token</button>
135
+ *
136
+ * ```
137
+ */
138
+ export declare const CoinflowCardOnlyInput: React.ForwardRefExoticComponent<CoinflowCvvOnlyInputProps & React.RefAttributes<unknown>>;
@@ -0,0 +1,177 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CoinflowCardOnlyInput = exports.CoinflowCvvOnlyInput = exports.CoinflowCvvInput = exports.CoinflowCardNumberInput = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var react_1 = tslib_1.__importStar(require("react"));
6
+ var useCardFormIframe_1 = require("./useCardFormIframe");
7
+ /**
8
+ * Allows merchants to collect card information from their customers in a PCI-compliant way and receive the tokenized card number.
9
+ *
10
+ * Usage:
11
+ * ```tsx
12
+ * const ref = useRef<{getToken(): Promise<{token: string}>}>();
13
+ *
14
+ * <CoinflowCardNumberInput
15
+ * ref={ref}
16
+ * env={'sandbox'}
17
+ * debug={true}
18
+ * css={{
19
+ * base: 'font-family: Arial, sans-serif;padding: 0 8px;border: 1px solid rgba(0, 0, 0, 0.2);margin: 0;width: 100%;font-size: 13px;line-height: 30px;height: 32px;box-sizing: border-box;-moz-box-sizing: border-box;',
20
+ * focus:
21
+ * 'box-shadow: 0 0 6px 0 rgba(0, 132, 255, 0.5);border: 1px solid rgba(0, 132, 255, 0.5);outline: 0;',
22
+ * error:
23
+ * 'box-shadow: 0 0 6px 0 rgba(224, 57, 57, 0.5);border: 1px solid rgba(224, 57, 57, 0.5);',
24
+ * cvv: {
25
+ * base: 'font-family: Arial, sans-serif;padding: 0 8px;border: 1px solid rgba(0, 0, 0, 0.2);margin: 0;width: 100%;font-size: 13px;line-height: 30px;height: 32px;box-sizing: border-box;-moz-box-sizing: border-box;',
26
+ * focus:
27
+ * 'box-shadow: 0 0 6px 0 rgba(0, 132, 255, 0.5);border: 1px solid rgba(0, 132, 255, 0.5);outline: 0;',
28
+ * error:
29
+ * 'box-shadow: 0 0 6px 0 rgba(224, 57, 57, 0.5);border: 1px solid rgba(224, 57, 57, 0.5);',
30
+ * },
31
+ * }}
32
+ * />
33
+ * <CoinflowCvvInput />
34
+ *
35
+ * <button onClick={() => {
36
+ * ref.current?.getToken()
37
+ * .then(({token}) => console.log(token))
38
+ * .catch(e => console.error('GET TOKEN ERROR', e))
39
+ * }}>Get Token</button>
40
+ *
41
+ * ```
42
+ */
43
+ exports.CoinflowCardNumberInput = (0, react_1.forwardRef)(function (props, ref) {
44
+ var _a = (0, useCardFormIframe_1.useCardFormIframe)(props.env), tokenExIframe = _a.tokenExIframe, initializeTokenExIframe = _a.initializeTokenExIframe;
45
+ (0, react_1.useImperativeHandle)(ref, function () { return ({
46
+ getToken: function () {
47
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
48
+ return tslib_1.__generator(this, function (_a) {
49
+ if (!tokenExIframe)
50
+ throw new Error('Unable to get token');
51
+ return [2 /*return*/, tokenExIframe.tokenize()];
52
+ });
53
+ });
54
+ },
55
+ }); });
56
+ (0, react_1.useEffect)(function () {
57
+ initializeTokenExIframe(props);
58
+ }, [initializeTokenExIframe, props]);
59
+ return react_1.default.createElement("div", { id: useCardFormIframe_1.TokenExCardNumberIframeId });
60
+ });
61
+ /**
62
+ * The CVV number input for creating a new tokenized card
63
+ */
64
+ function CoinflowCvvInput() {
65
+ return react_1.default.createElement("div", { id: useCardFormIframe_1.TokenExCvvContainerID });
66
+ }
67
+ exports.CoinflowCvvInput = CoinflowCvvInput;
68
+ /**
69
+ * Allows merchants to collect the CVV for an already tokenized card in a PCI-compliant way and receive the token with the CVV linked.
70
+ *
71
+ * Usage:
72
+ * ```tsx
73
+ * const ref = useRef<{getToken(): Promise<{token: string}>}>();
74
+ *
75
+ * <CoinflowCvvOnlyInput
76
+ * ref={ref}
77
+ * cardType={'visa'}
78
+ * token={'411111YJM5TX1111'}
79
+ * env={'sandbox'}
80
+ * debug={true}
81
+ * css={{
82
+ * base: 'font-family: Arial, sans-serif;padding: 0 8px;border: 1px solid rgba(0, 0, 0, 0.2);margin: 0;width: 100%;font-size: 13px;line-height: 30px;height: 32px;box-sizing: border-box;-moz-box-sizing: border-box;',
83
+ * focus:
84
+ * 'box-shadow: 0 0 6px 0 rgba(0, 132, 255, 0.5);border: 1px solid rgba(0, 132, 255, 0.5);outline: 0;',
85
+ * error:
86
+ * 'box-shadow: 0 0 6px 0 rgba(224, 57, 57, 0.5);border: 1px solid rgba(224, 57, 57, 0.5);',
87
+ * cvv: {
88
+ * base: 'font-family: Arial, sans-serif;padding: 0 8px;border: 1px solid rgba(0, 0, 0, 0.2);margin: 0;width: 100%;font-size: 13px;line-height: 30px;height: 32px;box-sizing: border-box;-moz-box-sizing: border-box;',
89
+ * focus:
90
+ * 'box-shadow: 0 0 6px 0 rgba(0, 132, 255, 0.5);border: 1px solid rgba(0, 132, 255, 0.5);outline: 0;',
91
+ * error:
92
+ * 'box-shadow: 0 0 6px 0 rgba(224, 57, 57, 0.5);border: 1px solid rgba(224, 57, 57, 0.5);',
93
+ * },
94
+ * }}
95
+ * />
96
+ *
97
+ * <button onClick={() => {
98
+ * ref.current?.getToken()
99
+ * .then(({token}) => console.log(token))
100
+ * .catch(e => console.error('GET TOKEN ERROR', e))
101
+ * }}>Get Token</button>
102
+ *
103
+ * ```
104
+ */
105
+ exports.CoinflowCvvOnlyInput = (0, react_1.forwardRef)(function (props, ref) {
106
+ var _a = (0, useCardFormIframe_1.useCardFormIframe)(props.env), tokenExIframe = _a.tokenExIframe, initializeCvvOnlyTokenExIframe = _a.initializeCvvOnlyTokenExIframe;
107
+ (0, react_1.useImperativeHandle)(ref, function () { return ({
108
+ getToken: function () {
109
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
110
+ return tslib_1.__generator(this, function (_a) {
111
+ if (!tokenExIframe)
112
+ throw new Error('Unable to get token');
113
+ return [2 /*return*/, tokenExIframe.tokenize()];
114
+ });
115
+ });
116
+ },
117
+ }); });
118
+ (0, react_1.useEffect)(function () {
119
+ initializeCvvOnlyTokenExIframe(props);
120
+ }, [initializeCvvOnlyTokenExIframe, props]);
121
+ return react_1.default.createElement("div", { id: useCardFormIframe_1.TokenExCvvContainerID });
122
+ });
123
+ /**
124
+ * Allows merchants to collect card information from their customers in a PCI-compliant way and receive the tokenized card number.
125
+ * The `CoinflowCardOnlyInput` is used for collecting a debit card for users to be able to withdraw their funds directly to.
126
+ *
127
+ * Usage:
128
+ * ```tsx
129
+ * const ref = useRef<{getToken(): Promise<{token: string}>}>();
130
+ *
131
+ * <CoinflowCardOnlyInput
132
+ * ref={ref}
133
+ * env={'sandbox'}
134
+ * debug={true}
135
+ * css={{
136
+ * base: 'font-family: Arial, sans-serif;padding: 0 8px;border: 1px solid rgba(0, 0, 0, 0.2);margin: 0;width: 100%;font-size: 13px;line-height: 30px;height: 32px;box-sizing: border-box;-moz-box-sizing: border-box;',
137
+ * focus:
138
+ * 'box-shadow: 0 0 6px 0 rgba(0, 132, 255, 0.5);border: 1px solid rgba(0, 132, 255, 0.5);outline: 0;',
139
+ * error:
140
+ * 'box-shadow: 0 0 6px 0 rgba(224, 57, 57, 0.5);border: 1px solid rgba(224, 57, 57, 0.5);',
141
+ * cvv: {
142
+ * base: 'font-family: Arial, sans-serif;padding: 0 8px;border: 1px solid rgba(0, 0, 0, 0.2);margin: 0;width: 100%;font-size: 13px;line-height: 30px;height: 32px;box-sizing: border-box;-moz-box-sizing: border-box;',
143
+ * focus:
144
+ * 'box-shadow: 0 0 6px 0 rgba(0, 132, 255, 0.5);border: 1px solid rgba(0, 132, 255, 0.5);outline: 0;',
145
+ * error:
146
+ * 'box-shadow: 0 0 6px 0 rgba(224, 57, 57, 0.5);border: 1px solid rgba(224, 57, 57, 0.5);',
147
+ * },
148
+ * }}
149
+ * />
150
+ *
151
+ * <button onClick={() => {
152
+ * ref.current?.getToken()
153
+ * .then(({token}) => console.log(token))
154
+ * .catch(e => console.error('GET TOKEN ERROR', e))
155
+ * }}>Get Token</button>
156
+ *
157
+ * ```
158
+ */
159
+ exports.CoinflowCardOnlyInput = (0, react_1.forwardRef)(function (props, ref) {
160
+ var _a = (0, useCardFormIframe_1.useCardFormIframe)(props.env), tokenExIframe = _a.tokenExIframe, initializeTokenExCardOnlyIframe = _a.initializeTokenExCardOnlyIframe;
161
+ (0, react_1.useImperativeHandle)(ref, function () { return ({
162
+ getToken: function () {
163
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
164
+ return tslib_1.__generator(this, function (_a) {
165
+ if (!tokenExIframe)
166
+ throw new Error('Unable to get token');
167
+ return [2 /*return*/, tokenExIframe.tokenize()];
168
+ });
169
+ });
170
+ },
171
+ }); });
172
+ (0, react_1.useEffect)(function () {
173
+ initializeTokenExCardOnlyIframe(props);
174
+ }, [initializeTokenExCardOnlyIframe, props]);
175
+ return react_1.default.createElement("div", { id: useCardFormIframe_1.TokenExCardNumberIframeId });
176
+ });
177
+ //# sourceMappingURL=CoinflowCardForm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CoinflowCardForm.js","sourceRoot":"","sources":["../../../src/card-form/CoinflowCardForm.tsx"],"names":[],"mappings":";;;;AAAA,qDAAwE;AAExE,yDAK6B;AAoB7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACU,QAAA,uBAAuB,GAAG,IAAA,kBAAU,EAC/C,UAAC,KAAmC,EAAE,GAAG;IACjC,IAAA,KAA2C,IAAA,qCAAiB,EAChE,KAAK,CAAC,GAAG,CACV,EAFM,aAAa,mBAAA,EAAE,uBAAuB,6BAE5C,CAAC;IAEF,IAAA,2BAAmB,EAAC,GAAG,EAAE,cAAM,OAAA,CAAC;QACxB,QAAQ;;;oBACZ,IAAI,CAAC,aAAa;wBAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;oBAC3D,sBAAO,aAAa,CAAC,QAAQ,EAAE,EAAC;;;SACjC;KACF,CAAC,EAL6B,CAK7B,CAAC,CAAC;IAEJ,IAAA,iBAAS,EAAC;QACR,uBAAuB,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC,EAAE,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC,CAAC;IAErC,OAAO,uCAAK,EAAE,EAAE,6CAAyB,GAAQ,CAAC;AACpD,CAAC,CACF,CAAC;AAEF;;GAEG;AACH,SAAgB,gBAAgB;IAC9B,OAAO,uCAAK,EAAE,EAAE,yCAAqB,GAAQ,CAAC;AAChD,CAAC;AAFD,4CAEC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACU,QAAA,oBAAoB,GAAG,IAAA,kBAAU,EAC5C,UAAC,KAAgC,EAAE,GAAG;IAC9B,IAAA,KAAkD,IAAA,qCAAiB,EACvE,KAAK,CAAC,GAAG,CACV,EAFM,aAAa,mBAAA,EAAE,8BAA8B,oCAEnD,CAAC;IAEF,IAAA,2BAAmB,EAAC,GAAG,EAAE,cAAM,OAAA,CAAC;QACxB,QAAQ;;;oBACZ,IAAI,CAAC,aAAa;wBAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;oBAC3D,sBAAO,aAAa,CAAC,QAAQ,EAAE,EAAC;;;SACjC;KACF,CAAC,EAL6B,CAK7B,CAAC,CAAC;IAEJ,IAAA,iBAAS,EAAC;QACR,8BAA8B,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC,EAAE,CAAC,8BAA8B,EAAE,KAAK,CAAC,CAAC,CAAC;IAE5C,OAAO,uCAAK,EAAE,EAAE,yCAAqB,GAAQ,CAAC;AAChD,CAAC,CACF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACU,QAAA,qBAAqB,GAAG,IAAA,kBAAU,EAC7C,UAAC,KAAgC,EAAE,GAAG;IAC9B,IAAA,KAAmD,IAAA,qCAAiB,EACxE,KAAK,CAAC,GAAG,CACV,EAFM,aAAa,mBAAA,EAAE,+BAA+B,qCAEpD,CAAC;IAEF,IAAA,2BAAmB,EAAC,GAAG,EAAE,cAAM,OAAA,CAAC;QACxB,QAAQ;;;oBACZ,IAAI,CAAC,aAAa;wBAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;oBAC3D,sBAAO,aAAa,CAAC,QAAQ,EAAE,EAAC;;;SACjC;KACF,CAAC,EAL6B,CAK7B,CAAC,CAAC;IAEJ,IAAA,iBAAS,EAAC;QACR,+BAA+B,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC,EAAE,CAAC,+BAA+B,EAAE,KAAK,CAAC,CAAC,CAAC;IAE7C,OAAO,uCAAK,EAAE,EAAE,6CAAyB,GAAQ,CAAC;AACpD,CAAC,CACF,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,4 @@
1
+ "use strict";
2
+ // Type definitions for TokenEx iframe integration
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=TokenEx.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TokenEx.js","sourceRoot":"","sources":["../../../src/card-form/TokenEx.ts"],"names":[],"mappings":";AAAA,kDAAkD"}
@@ -0,0 +1,99 @@
1
+ import { CSSProperties } from 'react';
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
+ }
23
+ export declare function useCardFormIframe(env: CoinflowEnvs): {
24
+ tokenExIframe: TokenExIframe | undefined;
25
+ initializeTokenExIframe: ({ css, fontFamily, debug, }: {
26
+ css: CardFormInputStyles & {
27
+ cvv: CardFormInputStyles;
28
+ };
29
+ fontFamily?: string;
30
+ debug?: boolean;
31
+ }) => Promise<{
32
+ tokenize: () => Promise<TokenizationResponse>;
33
+ load(): void;
34
+ on: (event: string, callback: (data?: any) => void) => void;
35
+ validate(): void;
36
+ reset(): void;
37
+ blur(): void;
38
+ cvvBlur(): void;
39
+ focus(): void;
40
+ cvvFocus(): void;
41
+ remove(): void;
42
+ toggleMask(): void;
43
+ toggleCvvMask(): void;
44
+ setPAN(pan: string): void;
45
+ binLookup(): void;
46
+ validateConfig(): void;
47
+ setFraudServicesRequestDetails(data: string): void;
48
+ }>;
49
+ initializeCvvOnlyTokenExIframe: ({ token, cardType, css, debug, fontFamily, }: {
50
+ token: string;
51
+ cardType: CardType;
52
+ css: CardFormInputStyles & {
53
+ cvv: CardFormInputStyles;
54
+ };
55
+ debug?: boolean;
56
+ fontFamily?: string;
57
+ }) => Promise<{
58
+ tokenize: () => Promise<TokenizationResponse>;
59
+ load(): void;
60
+ on: (event: string, callback: (data?: any) => void) => void;
61
+ validate(): void;
62
+ reset(): void;
63
+ blur(): void;
64
+ cvvBlur(): void;
65
+ focus(): void;
66
+ cvvFocus(): void;
67
+ remove(): void;
68
+ toggleMask(): void;
69
+ toggleCvvMask(): void;
70
+ setPAN(pan: string): void;
71
+ binLookup(): void;
72
+ validateConfig(): void;
73
+ setFraudServicesRequestDetails(data: string): void;
74
+ }>;
75
+ initializeTokenExCardOnlyIframe: ({ css, fontFamily, debug, }: {
76
+ css: CardFormInputStyles;
77
+ fontFamily?: string;
78
+ debug?: boolean;
79
+ }) => Promise<{
80
+ tokenize: () => Promise<TokenizationResponse>;
81
+ load(): void;
82
+ on: (event: string, callback: (data?: any) => void) => void;
83
+ validate(): void;
84
+ reset(): void;
85
+ blur(): void;
86
+ cvvBlur(): void;
87
+ focus(): void;
88
+ cvvFocus(): void;
89
+ remove(): void;
90
+ toggleMask(): void;
91
+ toggleCvvMask(): void;
92
+ setPAN(pan: string): void;
93
+ binLookup(): void;
94
+ validateConfig(): void;
95
+ setFraudServicesRequestDetails(data: string): void;
96
+ }>;
97
+ loaded: boolean;
98
+ cachedToken: string | undefined;
99
+ };