@coinflowlabs/react 4.2.0 → 4.2.3
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/build/cjs/card-form/CoinflowCardForm.d.ts +41 -4
- package/build/cjs/card-form/CoinflowCardForm.js +61 -13
- package/build/cjs/card-form/CoinflowCardForm.js.map +1 -1
- package/build/cjs/card-form/useCardFormIframe.d.ts +22 -0
- package/build/cjs/card-form/useCardFormIframe.js +34 -3
- package/build/cjs/card-form/useCardFormIframe.js.map +1 -1
- package/build/cjs/common/CoinflowTypes.d.ts +20 -2
- package/build/cjs/common/CoinflowTypes.js.map +1 -1
- package/build/cjs/common/CoinflowUtils.d.ts +1 -1
- package/build/cjs/common/CoinflowUtils.js +3 -1
- package/build/cjs/common/CoinflowUtils.js.map +1 -1
- package/build/esm/card-form/CoinflowCardForm.d.ts +41 -4
- package/build/esm/card-form/CoinflowCardForm.js +61 -13
- package/build/esm/card-form/CoinflowCardForm.js.map +1 -1
- package/build/esm/card-form/useCardFormIframe.d.ts +22 -0
- package/build/esm/card-form/useCardFormIframe.js +34 -3
- package/build/esm/card-form/useCardFormIframe.js.map +1 -1
- package/build/esm/common/CoinflowTypes.d.ts +20 -2
- package/build/esm/common/CoinflowTypes.js.map +1 -1
- package/build/esm/common/CoinflowUtils.d.ts +1 -1
- package/build/esm/common/CoinflowUtils.js +3 -1
- package/build/esm/common/CoinflowUtils.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { CardType, CoinflowEnvs } from '../common';
|
|
3
3
|
import { CardFormInputStyles } from './useCardFormIframe';
|
|
4
4
|
export type CoinflowCardTokenResponse = {
|
|
@@ -28,8 +28,8 @@ export interface CoinflowCvvOnlyInputProps {
|
|
|
28
28
|
* const ref = useRef<{getToken(): Promise<{token: string}>}>();
|
|
29
29
|
*
|
|
30
30
|
* <CoinflowCardNumberInput
|
|
31
|
-
* ref={
|
|
32
|
-
* env={'
|
|
31
|
+
* ref={ref}
|
|
32
|
+
* env={'sandbox'}
|
|
33
33
|
* debug={true}
|
|
34
34
|
* css={{
|
|
35
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;',
|
|
@@ -72,7 +72,7 @@ export declare function CoinflowCvvInput(): React.JSX.Element;
|
|
|
72
72
|
* ref={ref}
|
|
73
73
|
* cardType={'visa'}
|
|
74
74
|
* token={'411111YJM5TX1111'}
|
|
75
|
-
* env={
|
|
75
|
+
* env={'sandbox'}
|
|
76
76
|
* debug={true}
|
|
77
77
|
* css={{
|
|
78
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;',
|
|
@@ -99,3 +99,40 @@ export declare function CoinflowCvvInput(): React.JSX.Element;
|
|
|
99
99
|
* ```
|
|
100
100
|
*/
|
|
101
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>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CoinflowCvvOnlyInput = exports.CoinflowCvvInput = exports.CoinflowCardNumberInput = void 0;
|
|
3
|
+
exports.CoinflowCardOnlyInput = exports.CoinflowCvvOnlyInput = exports.CoinflowCvvInput = exports.CoinflowCardNumberInput = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
var useCardFormIframe_1 = require("./useCardFormIframe");
|
|
@@ -12,8 +12,8 @@ var useCardFormIframe_1 = require("./useCardFormIframe");
|
|
|
12
12
|
* const ref = useRef<{getToken(): Promise<{token: string}>}>();
|
|
13
13
|
*
|
|
14
14
|
* <CoinflowCardNumberInput
|
|
15
|
-
* ref={
|
|
16
|
-
* env={'
|
|
15
|
+
* ref={ref}
|
|
16
|
+
* env={'sandbox'}
|
|
17
17
|
* debug={true}
|
|
18
18
|
* css={{
|
|
19
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;',
|
|
@@ -54,21 +54,15 @@ exports.CoinflowCardNumberInput = (0, react_1.forwardRef)(function (props, ref)
|
|
|
54
54
|
},
|
|
55
55
|
}); });
|
|
56
56
|
(0, react_1.useEffect)(function () {
|
|
57
|
-
var sdkScriptTag = document.createElement('script');
|
|
58
|
-
sdkScriptTag.src =
|
|
59
|
-
props.env === 'prod'
|
|
60
|
-
? 'https://htp.tokenex.com/iframe/iframe-v3.min.js'
|
|
61
|
-
: 'https://test-htp.tokenex.com/iframe/iframe-v3.min.js';
|
|
62
|
-
document.head.appendChild(sdkScriptTag);
|
|
63
57
|
initializeTokenExIframe(props);
|
|
64
58
|
}, [initializeTokenExIframe, props]);
|
|
65
|
-
return react_1.default.createElement("div", { id: useCardFormIframe_1.TokenExCardNumberIframeId });
|
|
59
|
+
return (0, react_1.useMemo)(function () { return react_1.default.createElement("div", { id: useCardFormIframe_1.TokenExCardNumberIframeId }); }, []);
|
|
66
60
|
});
|
|
67
61
|
/**
|
|
68
62
|
* The CVV number input for creating a new tokenized card
|
|
69
63
|
*/
|
|
70
64
|
function CoinflowCvvInput() {
|
|
71
|
-
return react_1.default.createElement("div", { id: useCardFormIframe_1.TokenExCvvContainerID });
|
|
65
|
+
return (0, react_1.useMemo)(function () { return react_1.default.createElement("div", { id: useCardFormIframe_1.TokenExCvvContainerID }); }, []);
|
|
72
66
|
}
|
|
73
67
|
exports.CoinflowCvvInput = CoinflowCvvInput;
|
|
74
68
|
/**
|
|
@@ -82,7 +76,7 @@ exports.CoinflowCvvInput = CoinflowCvvInput;
|
|
|
82
76
|
* ref={ref}
|
|
83
77
|
* cardType={'visa'}
|
|
84
78
|
* token={'411111YJM5TX1111'}
|
|
85
|
-
* env={
|
|
79
|
+
* env={'sandbox'}
|
|
86
80
|
* debug={true}
|
|
87
81
|
* css={{
|
|
88
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;',
|
|
@@ -124,6 +118,60 @@ exports.CoinflowCvvOnlyInput = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
124
118
|
(0, react_1.useEffect)(function () {
|
|
125
119
|
initializeCvvOnlyTokenExIframe(props);
|
|
126
120
|
}, [initializeCvvOnlyTokenExIframe, props]);
|
|
127
|
-
return react_1.default.createElement("div", { id: useCardFormIframe_1.TokenExCvvContainerID });
|
|
121
|
+
return (0, react_1.useMemo)(function () { 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 (0, react_1.useMemo)(function () { return react_1.default.createElement("div", { id: useCardFormIframe_1.TokenExCardNumberIframeId }); }, []);
|
|
128
176
|
});
|
|
129
177
|
//# sourceMappingURL=CoinflowCardForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowCardForm.js","sourceRoot":"","sources":["../../../src/card-form/CoinflowCardForm.tsx"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"CoinflowCardForm.js","sourceRoot":"","sources":["../../../src/card-form/CoinflowCardForm.tsx"],"names":[],"mappings":";;;;AAAA,qDAAmF;AAEnF,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;QACx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C,OAAO,IAAA,eAAO,EAAC,cAAM,OAAA,uCAAK,EAAE,EAAE,yCAAqB,GAAQ,EAAtC,CAAsC,EAAE,EAAE,CAAC,CAAC;AACnE,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,IAAA,eAAO,EAAC,cAAM,OAAA,uCAAK,EAAE,EAAE,6CAAyB,GAAQ,EAA1C,CAA0C,EAAE,EAAE,CAAC,CAAC;AACvE,CAAC,CACF,CAAC"}
|
|
@@ -72,6 +72,28 @@ export declare function useCardFormIframe(env: CoinflowEnvs): {
|
|
|
72
72
|
validateConfig(): void;
|
|
73
73
|
setFraudServicesRequestDetails(data: string): void;
|
|
74
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
|
+
}>;
|
|
75
97
|
loaded: boolean;
|
|
76
98
|
cachedToken: string | undefined;
|
|
77
99
|
};
|
|
@@ -39,18 +39,34 @@ function useCardFormIframe(env) {
|
|
|
39
39
|
}); });
|
|
40
40
|
}, [env]);
|
|
41
41
|
var getStylesAndFont = (0, react_1.useCallback)(function (css) {
|
|
42
|
+
var _a, _b, _c;
|
|
42
43
|
var styles = {
|
|
43
44
|
base: CSSPropertiesToComponent(css.base),
|
|
44
45
|
focus: CSSPropertiesToComponent(css.focus),
|
|
45
46
|
error: CSSPropertiesToComponent(css.error),
|
|
46
47
|
cvv: {
|
|
47
|
-
base: CSSPropertiesToComponent(css.cvv.base),
|
|
48
|
-
focus: CSSPropertiesToComponent(css.cvv.focus),
|
|
49
|
-
error: CSSPropertiesToComponent(css.cvv.error),
|
|
48
|
+
base: CSSPropertiesToComponent((_a = css.cvv) === null || _a === void 0 ? void 0 : _a.base),
|
|
49
|
+
focus: CSSPropertiesToComponent((_b = css.cvv) === null || _b === void 0 ? void 0 : _b.focus),
|
|
50
|
+
error: CSSPropertiesToComponent((_c = css.cvv) === null || _c === void 0 ? void 0 : _c.error),
|
|
50
51
|
},
|
|
51
52
|
};
|
|
52
53
|
return { styles: styles };
|
|
53
54
|
}, []);
|
|
55
|
+
var setTokenExScriptTag = (0, react_1.useCallback)(function () {
|
|
56
|
+
var scriptTagId = 'tokenex-script';
|
|
57
|
+
if (document.head.querySelector("#".concat(scriptTagId)))
|
|
58
|
+
return;
|
|
59
|
+
var sdkScriptTag = document.createElement('script');
|
|
60
|
+
sdkScriptTag.src =
|
|
61
|
+
env === 'prod'
|
|
62
|
+
? 'https://htp.tokenex.com/iframe/iframe-v3.min.js'
|
|
63
|
+
: 'https://test-htp.tokenex.com/iframe/iframe-v3.min.js';
|
|
64
|
+
sdkScriptTag.id = scriptTagId;
|
|
65
|
+
document.head.appendChild(sdkScriptTag);
|
|
66
|
+
}, [env]);
|
|
67
|
+
(0, react_1.useEffect)(function () {
|
|
68
|
+
setTokenExScriptTag();
|
|
69
|
+
}, [setTokenExScriptTag]);
|
|
54
70
|
var loadIframe = (0, react_1.useCallback)(function (iframe) {
|
|
55
71
|
var tokenize = function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
56
72
|
return tslib_1.__generator(this, function (_a) {
|
|
@@ -118,6 +134,20 @@ function useCardFormIframe(env) {
|
|
|
118
134
|
}
|
|
119
135
|
});
|
|
120
136
|
}); }, [getIframeConfig, getStylesAndFont, loadIframe]);
|
|
137
|
+
var initializeTokenExCardOnlyIframe = (0, react_1.useCallback)(function (_a) { return tslib_1.__awaiter(_this, [_a], void 0, function (_b) {
|
|
138
|
+
var iframeConfig, styles, iframe;
|
|
139
|
+
var css = _b.css, fontFamily = _b.fontFamily, debug = _b.debug;
|
|
140
|
+
return tslib_1.__generator(this, function (_c) {
|
|
141
|
+
switch (_c.label) {
|
|
142
|
+
case 0: return [4 /*yield*/, getIframeConfig({})];
|
|
143
|
+
case 1:
|
|
144
|
+
iframeConfig = _c.sent();
|
|
145
|
+
styles = getStylesAndFont(css).styles;
|
|
146
|
+
iframe = TokenEx.Iframe(exports.TokenExCardNumberIframeId, tslib_1.__assign(tslib_1.__assign({}, iframeConfig), { placeholder: '0000 0000 0000 0000', enablePrettyFormat: true, cvv: false, styles: styles, font: fontFamily, debug: debug !== null && debug !== void 0 ? debug : false }));
|
|
147
|
+
return [2 /*return*/, loadIframe(iframe)];
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}); }, [getIframeConfig, getStylesAndFont, loadIframe]);
|
|
121
151
|
(0, react_1.useEffect)(function () {
|
|
122
152
|
if (!tokenExIframe)
|
|
123
153
|
return;
|
|
@@ -128,6 +158,7 @@ function useCardFormIframe(env) {
|
|
|
128
158
|
tokenExIframe: tokenExIframe,
|
|
129
159
|
initializeTokenExIframe: initializeTokenExIframe,
|
|
130
160
|
initializeCvvOnlyTokenExIframe: initializeCvvOnlyTokenExIframe,
|
|
161
|
+
initializeTokenExCardOnlyIframe: initializeTokenExCardOnlyIframe,
|
|
131
162
|
loaded: loaded,
|
|
132
163
|
cachedToken: cachedToken,
|
|
133
164
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCardFormIframe.js","sourceRoot":"","sources":["../../../src/card-form/useCardFormIframe.tsx"],"names":[],"mappings":";;;;;AAAA,+BAAsE;AACtE,oCAAgE;AAGnD,QAAA,yBAAyB,GAAG,mBAAmB,CAAC;AAChD,QAAA,qBAAqB,GAAG,gBAAgB,CAAC;AAqBtD,IAAM,iBAAiB;IACrB,GAAC,iBAAQ,CAAC,IAAI,IAAG,MAAM;IACvB,GAAC,iBAAQ,CAAC,UAAU,IAAG,YAAY;IACnC,GAAC,iBAAQ,CAAC,IAAI,IAAG,iBAAiB;IAClC,GAAC,iBAAQ,CAAC,QAAQ,IAAG,UAAU;OAChC,CAAC;AAEF,SAAgB,iBAAiB,CAAC,GAAiB;IAAnD,
|
|
1
|
+
{"version":3,"file":"useCardFormIframe.js","sourceRoot":"","sources":["../../../src/card-form/useCardFormIframe.tsx"],"names":[],"mappings":";;;;;AAAA,+BAAsE;AACtE,oCAAgE;AAGnD,QAAA,yBAAyB,GAAG,mBAAmB,CAAC;AAChD,QAAA,qBAAqB,GAAG,gBAAgB,CAAC;AAqBtD,IAAM,iBAAiB;IACrB,GAAC,iBAAQ,CAAC,IAAI,IAAG,MAAM;IACvB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C;AA3ND,8CA2NC;AAED,SAAS,wBAAwB,CAC/B,IAAwC;IAExC,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IACrB,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IAE1C,IAAI,GAAG,GAAG,EAAE,CAAC;4BACD,GAAG,EAAE,KAAK;QACpB,IAAI,GAAG,GAAG,EAAE,CAAC;QACb,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,UAAA,EAAE;YACtB,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,EAAE,EAAE,CAAC;gBAC5B,GAAG,IAAI,GAAG,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC;YAChC,CAAC;iBAAM,CAAC;gBACN,GAAG,IAAI,EAAE,CAAC;YACZ,CAAC;QACH,CAAC,CAAC,CAAC;QACH,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,KAAK,GAAG,GAAG,CAAC;;IATjC,KAA2B,UAAoB,EAApB,KAAA,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAApB,cAAoB,EAApB,IAAoB;QAApC,IAAA,WAAY,EAAX,GAAG,QAAA,EAAE,KAAK,QAAA;gBAAV,GAAG,EAAE,KAAK;KAUrB;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -35,7 +35,7 @@ export interface CustomerInfo {
|
|
|
35
35
|
}
|
|
36
36
|
/** Coinflow Types **/
|
|
37
37
|
export type CoinflowBlockchain = 'solana' | 'near' | 'eth' | 'polygon' | 'base';
|
|
38
|
-
export type CoinflowEnvs = 'prod' | 'staging' | 'sandbox' | 'local';
|
|
38
|
+
export type CoinflowEnvs = 'prod' | 'staging' | 'staging-live' | 'sandbox' | 'local';
|
|
39
39
|
export interface CoinflowTypes {
|
|
40
40
|
merchantId: string;
|
|
41
41
|
env?: CoinflowEnvs;
|
|
@@ -162,6 +162,15 @@ export interface CoinflowCommonPurchaseProps extends CoinflowTypes {
|
|
|
162
162
|
authOnly?: boolean;
|
|
163
163
|
deviceId?: string;
|
|
164
164
|
jwtToken?: string;
|
|
165
|
+
/**
|
|
166
|
+
* If rendering the Coinflow component within multiple nested iframes, all ancestors in the chain must be provided as a comma-separated list.
|
|
167
|
+
*
|
|
168
|
+
* Example:
|
|
169
|
+
* Primary origin that will be interacting with the Coinflow iFrame: foo.com
|
|
170
|
+
* Subsequent origins that will render foo.com: bar.com
|
|
171
|
+
* The origin array would then be: [https://foo.com,https://bar.com]
|
|
172
|
+
*/
|
|
173
|
+
origins?: string[];
|
|
165
174
|
}
|
|
166
175
|
export interface CoinflowSolanaPurchaseProps extends CoinflowCommonPurchaseProps {
|
|
167
176
|
wallet: SolanaWallet;
|
|
@@ -215,6 +224,15 @@ export interface CoinflowCommonWithdrawProps extends CoinflowTypes {
|
|
|
215
224
|
supportsVersionedTransactions?: boolean;
|
|
216
225
|
lockAmount?: boolean;
|
|
217
226
|
transactionSigner?: string;
|
|
227
|
+
/**
|
|
228
|
+
* If rendering the Coinflow component within multiple nested iframes, all ancestors in the chain must be provided as a comma-separated list.
|
|
229
|
+
*
|
|
230
|
+
* Example:
|
|
231
|
+
* Primary origin that will be interacting with the Coinflow iFrame: foo.com
|
|
232
|
+
* Subsequent origins that will render foo.com: bar.com
|
|
233
|
+
* The origin array would then be: [https://foo.com,https://bar.com]
|
|
234
|
+
*/
|
|
235
|
+
origins?: string[];
|
|
218
236
|
}
|
|
219
237
|
export interface CoinflowSolanaWithdrawProps extends CoinflowCommonWithdrawProps {
|
|
220
238
|
wallet: SolanaWallet;
|
|
@@ -272,7 +290,7 @@ export interface ReservoirRedeem extends CommonEvmRedeem {
|
|
|
272
290
|
items: ReservoirItems;
|
|
273
291
|
}
|
|
274
292
|
export type EvmTransactionData = SafeMintRedeem | ReturnedTokenIdRedeem | ReservoirRedeem | KnownTokenIdRedeem | NormalRedeem;
|
|
275
|
-
export interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId'>, Pick<CoinflowCommonPurchaseProps, 'chargebackProtectionData' | 'webhookInfo' | 'amount' | 'customerInfo' | 'settlementType' | 'email' | 'planCode' | 'deviceId' | 'jwtToken'>, Pick<CoinflowCommonWithdrawProps, 'bankAccountLinkRedirect' | 'additionalWallets' | 'transactionSigner' | 'lockAmount' | 'lockDefaultToken'>, Pick<CoinflowEvmPurchaseProps, 'authOnly'>, Pick<CoinflowSolanaPurchaseProps, 'rent' | 'nativeSolToConvert' | 'token'> {
|
|
293
|
+
export interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId'>, Pick<CoinflowCommonPurchaseProps, 'chargebackProtectionData' | 'webhookInfo' | 'amount' | 'customerInfo' | 'settlementType' | 'email' | 'planCode' | 'deviceId' | 'jwtToken' | 'origins'>, Pick<CoinflowCommonWithdrawProps, 'bankAccountLinkRedirect' | 'additionalWallets' | 'transactionSigner' | 'lockAmount' | 'lockDefaultToken' | 'origins'>, Pick<CoinflowEvmPurchaseProps, 'authOnly'>, Pick<CoinflowSolanaPurchaseProps, 'rent' | 'nativeSolToConvert' | 'token'> {
|
|
276
294
|
walletPubkey: string | null | undefined;
|
|
277
295
|
route: string;
|
|
278
296
|
routePrefix?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowTypes.js","sourceRoot":"","sources":["../../../src/common/CoinflowTypes.ts"],"names":[],"mappings":";;;AAQA,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,+BAAa,CAAA;IACb,+BAAa,CAAA;AACf,CAAC,EAJW,cAAc,8BAAd,cAAc,QAIzB;AAED,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,gCAAe,CAAA;IACf,8BAAa,CAAA;AACf,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB;
|
|
1
|
+
{"version":3,"file":"CoinflowTypes.js","sourceRoot":"","sources":["../../../src/common/CoinflowTypes.ts"],"names":[],"mappings":";;;AAQA,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,+BAAa,CAAA;IACb,+BAAa,CAAA;AACf,CAAC,EAJW,cAAc,8BAAd,cAAc,QAIzB;AAED,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,gCAAe,CAAA;IACf,8BAAa,CAAA;AACf,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB;AAoaD,IAAY,QAKX;AALD,WAAY,QAAQ;IAClB,yBAAa,CAAA;IACb,+BAAmB,CAAA;IACnB,yBAAa,CAAA;IACb,6BAAiB,CAAA;AACnB,CAAC,EALW,QAAQ,wBAAR,QAAQ,QAKnB"}
|
|
@@ -9,7 +9,7 @@ export declare class CoinflowUtils {
|
|
|
9
9
|
}>;
|
|
10
10
|
static getCoinflowBaseUrl(env?: CoinflowEnvs): string;
|
|
11
11
|
static getCoinflowApiUrl(env?: CoinflowEnvs): string;
|
|
12
|
-
static getCoinflowUrl({ walletPubkey, route, routePrefix, env, amount, transaction, blockchain, supportsVersionedTransactions, webhookInfo, email, loaderBackground, handleHeightChange, bankAccountLinkRedirect, additionalWallets, nearDeposit, chargebackProtectionData, merchantCss, color, rent, lockDefaultToken, token, tokens, planCode, disableApplePay, disableGooglePay, customerInfo, settlementType, lockAmount, nativeSolToConvert, theme, usePermit, transactionSigner, authOnly, deviceId, jwtToken, }: CoinflowIFrameProps): string;
|
|
12
|
+
static getCoinflowUrl({ walletPubkey, route, routePrefix, env, amount, transaction, blockchain, supportsVersionedTransactions, webhookInfo, email, loaderBackground, handleHeightChange, bankAccountLinkRedirect, additionalWallets, nearDeposit, chargebackProtectionData, merchantCss, color, rent, lockDefaultToken, token, tokens, planCode, disableApplePay, disableGooglePay, customerInfo, settlementType, lockAmount, nativeSolToConvert, theme, usePermit, transactionSigner, authOnly, deviceId, jwtToken, origins, }: CoinflowIFrameProps): string;
|
|
13
13
|
static getTransaction(props: CoinflowPurchaseProps): string | undefined;
|
|
14
14
|
static byBlockchain<T>(blockchain: CoinflowBlockchain, args: {
|
|
15
15
|
solana: T;
|
|
@@ -65,7 +65,7 @@ var CoinflowUtils = /** @class */ (function () {
|
|
|
65
65
|
};
|
|
66
66
|
CoinflowUtils.getCoinflowUrl = function (_a) {
|
|
67
67
|
var _b;
|
|
68
|
-
var walletPubkey = _a.walletPubkey, route = _a.route, routePrefix = _a.routePrefix, env = _a.env, amount = _a.amount, transaction = _a.transaction, blockchain = _a.blockchain, supportsVersionedTransactions = _a.supportsVersionedTransactions, webhookInfo = _a.webhookInfo, email = _a.email, loaderBackground = _a.loaderBackground, handleHeightChange = _a.handleHeightChange, bankAccountLinkRedirect = _a.bankAccountLinkRedirect, additionalWallets = _a.additionalWallets, nearDeposit = _a.nearDeposit, chargebackProtectionData = _a.chargebackProtectionData, merchantCss = _a.merchantCss, color = _a.color, rent = _a.rent, lockDefaultToken = _a.lockDefaultToken, token = _a.token, tokens = _a.tokens, planCode = _a.planCode, disableApplePay = _a.disableApplePay, disableGooglePay = _a.disableGooglePay, customerInfo = _a.customerInfo, settlementType = _a.settlementType, lockAmount = _a.lockAmount, nativeSolToConvert = _a.nativeSolToConvert, theme = _a.theme, usePermit = _a.usePermit, transactionSigner = _a.transactionSigner, authOnly = _a.authOnly, deviceId = _a.deviceId, jwtToken = _a.jwtToken;
|
|
68
|
+
var walletPubkey = _a.walletPubkey, route = _a.route, routePrefix = _a.routePrefix, env = _a.env, amount = _a.amount, transaction = _a.transaction, blockchain = _a.blockchain, supportsVersionedTransactions = _a.supportsVersionedTransactions, webhookInfo = _a.webhookInfo, email = _a.email, loaderBackground = _a.loaderBackground, handleHeightChange = _a.handleHeightChange, bankAccountLinkRedirect = _a.bankAccountLinkRedirect, additionalWallets = _a.additionalWallets, nearDeposit = _a.nearDeposit, chargebackProtectionData = _a.chargebackProtectionData, merchantCss = _a.merchantCss, color = _a.color, rent = _a.rent, lockDefaultToken = _a.lockDefaultToken, token = _a.token, tokens = _a.tokens, planCode = _a.planCode, disableApplePay = _a.disableApplePay, disableGooglePay = _a.disableGooglePay, customerInfo = _a.customerInfo, settlementType = _a.settlementType, lockAmount = _a.lockAmount, nativeSolToConvert = _a.nativeSolToConvert, theme = _a.theme, usePermit = _a.usePermit, transactionSigner = _a.transactionSigner, authOnly = _a.authOnly, deviceId = _a.deviceId, jwtToken = _a.jwtToken, origins = _a.origins;
|
|
69
69
|
var prefix = routePrefix
|
|
70
70
|
? "/".concat(routePrefix, "/").concat(blockchain)
|
|
71
71
|
: "/".concat(blockchain);
|
|
@@ -153,6 +153,8 @@ var CoinflowUtils = /** @class */ (function () {
|
|
|
153
153
|
url.searchParams.append('authOnly', 'true');
|
|
154
154
|
if (jwtToken)
|
|
155
155
|
url.searchParams.append('jwtToken', jwtToken);
|
|
156
|
+
if (origins)
|
|
157
|
+
url.searchParams.append('origins', lz_string_1.default.compressToEncodedURIComponent(JSON.stringify(origins)));
|
|
156
158
|
return url.toString();
|
|
157
159
|
};
|
|
158
160
|
CoinflowUtils.getTransaction = function (props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowUtils.js","sourceRoot":"","sources":["../../../src/common/CoinflowUtils.ts"],"names":[],"mappings":";;;;AAMA,mDAA8C;AAC9C,gEAAiC;AAEjC;IAIE,uBAAY,GAAkB;QAC5B,IAAI,CAAC,GAAG,GAAG,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,MAAM,CAAC;QACzB,IAAI,IAAI,CAAC,GAAG,KAAK,MAAM;YAAE,IAAI,CAAC,GAAG,GAAG,2BAA2B,CAAC;aAC3D,IAAI,IAAI,CAAC,GAAG,KAAK,OAAO;YAAE,IAAI,CAAC,GAAG,GAAG,uBAAuB,CAAC;;YAC7D,IAAI,CAAC,GAAG,GAAG,sBAAe,IAAI,CAAC,GAAG,mBAAgB,CAAC;IAC1D,CAAC;IAEK,yCAAiB,GAAvB,UAAwB,UAAkB;;;gBACxC,sBAAO,KAAK,CAAC,IAAI,CAAC,GAAG,GA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AAM,CAAC,CAAC,CAAC;YACxE,CAAC;SACF,CAAC,EAAE,CAAC;IACP,CAAC;IAEM,0BAAY,GAAnB,UACE,UAA8B,EAC9B,IAAuD;QAEvD,QAAQ,UAAU,EAAE,CAAC;YACnB,KAAK,QAAQ;gBACX,OAAO,IAAI,CAAC,MAAM,CAAC;YACrB,KAAK,MAAM;gBACT,OAAO,IAAI,CAAC,IAAI,CAAC;YACnB,KAAK,SAAS;gBACZ,OAAO,IAAI,CAAC,OAAO,CAAC;YACtB,KAAK,KAAK;gBACR,OAAO,IAAI,CAAC,GAAG,CAAC;YAClB,KAAK,MAAM;gBACT,OAAO,IAAI,CAAC,IAAI,CAAC;YACnB;gBACE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;IACH,oBAAC;AAAD,CAAC,AAnSD,IAmSC;AAnSY,sCAAa"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { CardType, CoinflowEnvs } from '../common';
|
|
3
3
|
import { CardFormInputStyles } from './useCardFormIframe';
|
|
4
4
|
export type CoinflowCardTokenResponse = {
|
|
@@ -28,8 +28,8 @@ export interface CoinflowCvvOnlyInputProps {
|
|
|
28
28
|
* const ref = useRef<{getToken(): Promise<{token: string}>}>();
|
|
29
29
|
*
|
|
30
30
|
* <CoinflowCardNumberInput
|
|
31
|
-
* ref={
|
|
32
|
-
* env={'
|
|
31
|
+
* ref={ref}
|
|
32
|
+
* env={'sandbox'}
|
|
33
33
|
* debug={true}
|
|
34
34
|
* css={{
|
|
35
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;',
|
|
@@ -72,7 +72,7 @@ export declare function CoinflowCvvInput(): React.JSX.Element;
|
|
|
72
72
|
* ref={ref}
|
|
73
73
|
* cardType={'visa'}
|
|
74
74
|
* token={'411111YJM5TX1111'}
|
|
75
|
-
* env={
|
|
75
|
+
* env={'sandbox'}
|
|
76
76
|
* debug={true}
|
|
77
77
|
* css={{
|
|
78
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;',
|
|
@@ -99,3 +99,40 @@ export declare function CoinflowCvvInput(): React.JSX.Element;
|
|
|
99
99
|
* ```
|
|
100
100
|
*/
|
|
101
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>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __awaiter, __generator } from "tslib";
|
|
2
|
-
import React, { forwardRef, useEffect, useImperativeHandle } from
|
|
2
|
+
import React, { forwardRef, useEffect, useImperativeHandle, useMemo } from "react";
|
|
3
3
|
import { TokenExCardNumberIframeId, TokenExCvvContainerID, useCardFormIframe, } from './useCardFormIframe';
|
|
4
4
|
/**
|
|
5
5
|
* Allows merchants to collect card information from their customers in a PCI-compliant way and receive the tokenized card number.
|
|
@@ -9,8 +9,8 @@ import { TokenExCardNumberIframeId, TokenExCvvContainerID, useCardFormIframe, }
|
|
|
9
9
|
* const ref = useRef<{getToken(): Promise<{token: string}>}>();
|
|
10
10
|
*
|
|
11
11
|
* <CoinflowCardNumberInput
|
|
12
|
-
* ref={
|
|
13
|
-
* env={'
|
|
12
|
+
* ref={ref}
|
|
13
|
+
* env={'sandbox'}
|
|
14
14
|
* debug={true}
|
|
15
15
|
* css={{
|
|
16
16
|
* 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;',
|
|
@@ -51,21 +51,15 @@ export var CoinflowCardNumberInput = forwardRef(function (props, ref) {
|
|
|
51
51
|
},
|
|
52
52
|
}); });
|
|
53
53
|
useEffect(function () {
|
|
54
|
-
var sdkScriptTag = document.createElement('script');
|
|
55
|
-
sdkScriptTag.src =
|
|
56
|
-
props.env === 'prod'
|
|
57
|
-
? 'https://htp.tokenex.com/iframe/iframe-v3.min.js'
|
|
58
|
-
: 'https://test-htp.tokenex.com/iframe/iframe-v3.min.js';
|
|
59
|
-
document.head.appendChild(sdkScriptTag);
|
|
60
54
|
initializeTokenExIframe(props);
|
|
61
55
|
}, [initializeTokenExIframe, props]);
|
|
62
|
-
return React.createElement("div", { id: TokenExCardNumberIframeId });
|
|
56
|
+
return useMemo(function () { return React.createElement("div", { id: TokenExCardNumberIframeId }); }, []);
|
|
63
57
|
});
|
|
64
58
|
/**
|
|
65
59
|
* The CVV number input for creating a new tokenized card
|
|
66
60
|
*/
|
|
67
61
|
export function CoinflowCvvInput() {
|
|
68
|
-
return React.createElement("div", { id: TokenExCvvContainerID });
|
|
62
|
+
return useMemo(function () { return React.createElement("div", { id: TokenExCvvContainerID }); }, []);
|
|
69
63
|
}
|
|
70
64
|
/**
|
|
71
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.
|
|
@@ -78,7 +72,7 @@ export function CoinflowCvvInput() {
|
|
|
78
72
|
* ref={ref}
|
|
79
73
|
* cardType={'visa'}
|
|
80
74
|
* token={'411111YJM5TX1111'}
|
|
81
|
-
* env={
|
|
75
|
+
* env={'sandbox'}
|
|
82
76
|
* debug={true}
|
|
83
77
|
* css={{
|
|
84
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;',
|
|
@@ -120,6 +114,60 @@ export var CoinflowCvvOnlyInput = forwardRef(function (props, ref) {
|
|
|
120
114
|
useEffect(function () {
|
|
121
115
|
initializeCvvOnlyTokenExIframe(props);
|
|
122
116
|
}, [initializeCvvOnlyTokenExIframe, props]);
|
|
123
|
-
return React.createElement("div", { id: TokenExCvvContainerID });
|
|
117
|
+
return useMemo(function () { return React.createElement("div", { id: TokenExCvvContainerID }); }, []);
|
|
118
|
+
});
|
|
119
|
+
/**
|
|
120
|
+
* Allows merchants to collect card information from their customers in a PCI-compliant way and receive the tokenized card number.
|
|
121
|
+
* The `CoinflowCardOnlyInput` is used for collecting a debit card for users to be able to withdraw their funds directly to.
|
|
122
|
+
*
|
|
123
|
+
* Usage:
|
|
124
|
+
* ```tsx
|
|
125
|
+
* const ref = useRef<{getToken(): Promise<{token: string}>}>();
|
|
126
|
+
*
|
|
127
|
+
* <CoinflowCardOnlyInput
|
|
128
|
+
* ref={ref}
|
|
129
|
+
* env={'sandbox'}
|
|
130
|
+
* debug={true}
|
|
131
|
+
* css={{
|
|
132
|
+
* 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;',
|
|
133
|
+
* focus:
|
|
134
|
+
* 'box-shadow: 0 0 6px 0 rgba(0, 132, 255, 0.5);border: 1px solid rgba(0, 132, 255, 0.5);outline: 0;',
|
|
135
|
+
* error:
|
|
136
|
+
* 'box-shadow: 0 0 6px 0 rgba(224, 57, 57, 0.5);border: 1px solid rgba(224, 57, 57, 0.5);',
|
|
137
|
+
* cvv: {
|
|
138
|
+
* 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;',
|
|
139
|
+
* focus:
|
|
140
|
+
* 'box-shadow: 0 0 6px 0 rgba(0, 132, 255, 0.5);border: 1px solid rgba(0, 132, 255, 0.5);outline: 0;',
|
|
141
|
+
* error:
|
|
142
|
+
* 'box-shadow: 0 0 6px 0 rgba(224, 57, 57, 0.5);border: 1px solid rgba(224, 57, 57, 0.5);',
|
|
143
|
+
* },
|
|
144
|
+
* }}
|
|
145
|
+
* />
|
|
146
|
+
*
|
|
147
|
+
* <button onClick={() => {
|
|
148
|
+
* ref.current?.getToken()
|
|
149
|
+
* .then(({token}) => console.log(token))
|
|
150
|
+
* .catch(e => console.error('GET TOKEN ERROR', e))
|
|
151
|
+
* }}>Get Token</button>
|
|
152
|
+
*
|
|
153
|
+
* ```
|
|
154
|
+
*/
|
|
155
|
+
export var CoinflowCardOnlyInput = forwardRef(function (props, ref) {
|
|
156
|
+
var _a = useCardFormIframe(props.env), tokenExIframe = _a.tokenExIframe, initializeTokenExCardOnlyIframe = _a.initializeTokenExCardOnlyIframe;
|
|
157
|
+
useImperativeHandle(ref, function () { return ({
|
|
158
|
+
getToken: function () {
|
|
159
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
160
|
+
return __generator(this, function (_a) {
|
|
161
|
+
if (!tokenExIframe)
|
|
162
|
+
throw new Error('Unable to get token');
|
|
163
|
+
return [2 /*return*/, tokenExIframe.tokenize()];
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
},
|
|
167
|
+
}); });
|
|
168
|
+
useEffect(function () {
|
|
169
|
+
initializeTokenExCardOnlyIframe(props);
|
|
170
|
+
}, [initializeTokenExCardOnlyIframe, props]);
|
|
171
|
+
return useMemo(function () { return React.createElement("div", { id: TokenExCardNumberIframeId }); }, []);
|
|
124
172
|
});
|
|
125
173
|
//# sourceMappingURL=CoinflowCardForm.js.map
|