@coinflowlabs/react 5.22.3 → 6.0.0
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/CoinflowPazeButton.d.ts +4 -0
- package/build/cjs/CoinflowPazeButton.js +17 -0
- package/build/cjs/CoinflowPazeButton.js.map +1 -0
- package/build/cjs/MobileWalletButton.d.ts +2 -1
- package/build/cjs/MobileWalletButton.js +2 -2
- package/build/cjs/MobileWalletButton.js.map +1 -1
- package/build/cjs/card-form/CoinflowCardFormV2.d.ts +4 -1
- package/build/cjs/card-form/CoinflowCardFormV2.js.map +1 -1
- package/build/cjs/common/CoinflowFraudProtectionHeader.d.ts +11 -0
- package/build/cjs/common/CoinflowFraudProtectionHeader.js +37 -0
- package/build/cjs/common/CoinflowFraudProtectionHeader.js.map +1 -0
- package/build/cjs/common/CoinflowTypes.d.ts +14 -1
- package/build/cjs/common/CoinflowTypes.js +9 -1
- package/build/cjs/common/CoinflowTypes.js.map +1 -1
- package/build/cjs/common/CoinflowUtils.d.ts +1 -1
- package/build/cjs/common/CoinflowUtils.js +4 -1
- package/build/cjs/common/CoinflowUtils.js.map +1 -1
- package/build/cjs/common/card-form/cardFieldValidationError.d.ts +2 -0
- package/build/cjs/common/card-form/cardFieldValidationError.js +2 -0
- package/build/cjs/common/card-form/cardFieldValidationError.js.map +1 -1
- package/build/cjs/common/index.d.ts +2 -2
- package/build/cjs/common/index.js +2 -2
- package/build/cjs/common/index.js.map +1 -1
- package/build/cjs/common/types/L2L3Data.d.ts +82 -0
- package/build/cjs/common/types/L2L3Data.js +3 -0
- package/build/cjs/common/types/L2L3Data.js.map +1 -0
- package/build/cjs/index.d.ts +1 -2
- package/build/cjs/index.js +1 -2
- package/build/cjs/index.js.map +1 -1
- package/build/esm/CoinflowPazeButton.d.ts +4 -0
- package/build/esm/CoinflowPazeButton.js +13 -0
- package/build/esm/CoinflowPazeButton.js.map +1 -0
- package/build/esm/MobileWalletButton.d.ts +2 -1
- package/build/esm/MobileWalletButton.js +2 -2
- package/build/esm/MobileWalletButton.js.map +1 -1
- package/build/esm/card-form/CoinflowCardFormV2.d.ts +4 -1
- package/build/esm/card-form/CoinflowCardFormV2.js.map +1 -1
- package/build/esm/common/CoinflowFraudProtectionHeader.d.ts +11 -0
- package/build/esm/common/CoinflowFraudProtectionHeader.js +33 -0
- package/build/esm/common/CoinflowFraudProtectionHeader.js.map +1 -0
- package/build/esm/common/CoinflowTypes.d.ts +14 -1
- package/build/esm/common/CoinflowTypes.js +8 -0
- package/build/esm/common/CoinflowTypes.js.map +1 -1
- package/build/esm/common/CoinflowUtils.d.ts +1 -1
- package/build/esm/common/CoinflowUtils.js +4 -1
- package/build/esm/common/CoinflowUtils.js.map +1 -1
- package/build/esm/common/card-form/cardFieldValidationError.d.ts +2 -0
- package/build/esm/common/card-form/cardFieldValidationError.js +2 -0
- package/build/esm/common/card-form/cardFieldValidationError.js.map +1 -1
- package/build/esm/common/index.d.ts +2 -2
- package/build/esm/common/index.js +2 -2
- package/build/esm/common/index.js.map +1 -1
- package/build/esm/common/types/L2L3Data.d.ts +82 -0
- package/build/esm/common/types/L2L3Data.js +2 -0
- package/build/esm/common/types/L2L3Data.js.map +1 -0
- package/build/esm/index.d.ts +1 -2
- package/build/esm/index.js +1 -2
- package/build/esm/index.js.map +1 -1
- package/build/tsconfig.cjs.tsbuildinfo +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/build/cjs/card-form/CoinflowCardForm.d.ts +0 -126
- package/build/cjs/card-form/CoinflowCardForm.js +0 -217
- package/build/cjs/card-form/CoinflowCardForm.js.map +0 -1
- package/build/cjs/card-form/CoinflowCardFormHeader.d.ts +0 -6
- package/build/cjs/card-form/CoinflowCardFormHeader.js +0 -16
- package/build/cjs/card-form/CoinflowCardFormHeader.js.map +0 -1
- package/build/cjs/card-form/useCardFormIframe.d.ts +0 -12
- package/build/cjs/card-form/useCardFormIframe.js +0 -73
- package/build/cjs/card-form/useCardFormIframe.js.map +0 -1
- package/build/cjs/common/card-form/TokenEx.d.ts +0 -72
- package/build/cjs/common/card-form/TokenEx.js +0 -15
- package/build/cjs/common/card-form/TokenEx.js.map +0 -1
- package/build/cjs/common/card-form/tokenexHelpers.d.ts +0 -35
- package/build/cjs/common/card-form/tokenexHelpers.js +0 -164
- package/build/cjs/common/card-form/tokenexHelpers.js.map +0 -1
- package/build/esm/card-form/CoinflowCardForm.d.ts +0 -126
- package/build/esm/card-form/CoinflowCardForm.js +0 -213
- package/build/esm/card-form/CoinflowCardForm.js.map +0 -1
- package/build/esm/card-form/CoinflowCardFormHeader.d.ts +0 -6
- package/build/esm/card-form/CoinflowCardFormHeader.js +0 -12
- package/build/esm/card-form/CoinflowCardFormHeader.js.map +0 -1
- package/build/esm/card-form/useCardFormIframe.d.ts +0 -12
- package/build/esm/card-form/useCardFormIframe.js +0 -70
- package/build/esm/card-form/useCardFormIframe.js.map +0 -1
- package/build/esm/common/card-form/TokenEx.d.ts +0 -72
- package/build/esm/common/card-form/TokenEx.js +0 -12
- package/build/esm/common/card-form/TokenEx.js.map +0 -1
- package/build/esm/common/card-form/tokenexHelpers.d.ts +0 -35
- package/build/esm/common/card-form/tokenexHelpers.js +0 -157
- package/build/esm/common/card-form/tokenexHelpers.js.map +0 -1
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { MerchantIdOrCheckoutJwt, CoinflowCardNumberInputProps, CoinflowCvvOnlyInputProps } from '../common';
|
|
3
|
-
/**
|
|
4
|
-
* Allows merchants to collect card information from their customers in a PCI-compliant way and receive the tokenized card number.
|
|
5
|
-
*
|
|
6
|
-
* Usage:
|
|
7
|
-
* ```tsx
|
|
8
|
-
* const ref = useRef<{getToken(): Promise<{token: string}>}>();
|
|
9
|
-
*
|
|
10
|
-
* <CoinflowCardNumberInput
|
|
11
|
-
* ref={ref}
|
|
12
|
-
* env={'sandbox'}
|
|
13
|
-
* debug={true}
|
|
14
|
-
* css={{
|
|
15
|
-
* base: 'font-family: "Red Hat Display", 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;',
|
|
16
|
-
* focus:
|
|
17
|
-
* 'box-shadow: 0 0 6px 0 rgba(0, 132, 255, 0.5);border: 1px solid rgba(0, 132, 255, 0.5);outline: 0;',
|
|
18
|
-
* error:
|
|
19
|
-
* 'box-shadow: 0 0 6px 0 rgba(224, 57, 57, 0.5);border: 1px solid rgba(224, 57, 57, 0.5);',
|
|
20
|
-
* cvv: {
|
|
21
|
-
* base: 'font-family: "Red Hat Display", 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;',
|
|
22
|
-
* focus:
|
|
23
|
-
* 'box-shadow: 0 0 6px 0 rgba(0, 132, 255, 0.5);border: 1px solid rgba(0, 132, 255, 0.5);outline: 0;',
|
|
24
|
-
* error:
|
|
25
|
-
* 'box-shadow: 0 0 6px 0 rgba(224, 57, 57, 0.5);border: 1px solid rgba(224, 57, 57, 0.5);',
|
|
26
|
-
* },
|
|
27
|
-
* }}
|
|
28
|
-
* />
|
|
29
|
-
* <CoinflowCvvInput />
|
|
30
|
-
*
|
|
31
|
-
* <button onClick={() => {
|
|
32
|
-
* ref.current?.getToken()
|
|
33
|
-
* .then(({token}) => console.log(token))
|
|
34
|
-
* .catch(e => console.error('GET TOKEN ERROR', e))
|
|
35
|
-
* }}>Get Token</button>
|
|
36
|
-
*
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
export declare const CoinflowCardNumberInput: React.NamedExoticComponent<(CoinflowCardNumberInputProps & MerchantIdOrCheckoutJwt) & React.RefAttributes<unknown>>;
|
|
40
|
-
/**
|
|
41
|
-
* The CVV number input for creating a new tokenized card
|
|
42
|
-
*/
|
|
43
|
-
export declare const CoinflowCvvInput: React.MemoExoticComponent<() => React.JSX.Element>;
|
|
44
|
-
/**
|
|
45
|
-
* Allows merchants to collect the CVV for an already tokenized card in a PCI-compliant way and receive the token with the CVV linked.
|
|
46
|
-
*
|
|
47
|
-
* Usage:
|
|
48
|
-
* ```tsx
|
|
49
|
-
* const ref = useRef<{getToken(): Promise<{token: string}>}>();
|
|
50
|
-
*
|
|
51
|
-
* <CoinflowCvvOnlyInput
|
|
52
|
-
* ref={ref}
|
|
53
|
-
* cardType={'visa'}
|
|
54
|
-
* token={'411111YJM5TX1111'}
|
|
55
|
-
* env={'sandbox'}
|
|
56
|
-
* debug={true}
|
|
57
|
-
* css={{
|
|
58
|
-
* base: 'font-family: "Red Hat Display", 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;',
|
|
59
|
-
* focus:
|
|
60
|
-
* 'box-shadow: 0 0 6px 0 rgba(0, 132, 255, 0.5);border: 1px solid rgba(0, 132, 255, 0.5);outline: 0;',
|
|
61
|
-
* error:
|
|
62
|
-
* 'box-shadow: 0 0 6px 0 rgba(224, 57, 57, 0.5);border: 1px solid rgba(224, 57, 57, 0.5);',
|
|
63
|
-
* cvv: {
|
|
64
|
-
* base: 'font-family: "Red Hat Display", 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;',
|
|
65
|
-
* focus:
|
|
66
|
-
* 'box-shadow: 0 0 6px 0 rgba(0, 132, 255, 0.5);border: 1px solid rgba(0, 132, 255, 0.5);outline: 0;',
|
|
67
|
-
* error:
|
|
68
|
-
* 'box-shadow: 0 0 6px 0 rgba(224, 57, 57, 0.5);border: 1px solid rgba(224, 57, 57, 0.5);',
|
|
69
|
-
* },
|
|
70
|
-
* }}
|
|
71
|
-
* />
|
|
72
|
-
*
|
|
73
|
-
* <button onClick={() => {
|
|
74
|
-
* ref.current?.getToken()
|
|
75
|
-
* .then(({token}) => console.log(token))
|
|
76
|
-
* .catch(e => console.error('GET TOKEN ERROR', e))
|
|
77
|
-
* }}>Get Token</button>
|
|
78
|
-
*
|
|
79
|
-
* ```
|
|
80
|
-
*/
|
|
81
|
-
export declare const CoinflowCvvOnlyInput: React.NamedExoticComponent<(CoinflowCvvOnlyInputProps & MerchantIdOrCheckoutJwt) & React.RefAttributes<unknown>>;
|
|
82
|
-
/**
|
|
83
|
-
* Allows merchants to collect card information from their customers in a PCI-compliant way and receive the tokenized card number.
|
|
84
|
-
* The `CoinflowCardOnlyInput` is used for collecting a debit card for users to be able to withdraw their funds directly to.
|
|
85
|
-
*
|
|
86
|
-
* Usage:
|
|
87
|
-
* ```tsx
|
|
88
|
-
* const ref = useRef<{getToken(): Promise<{token: string}>}>();
|
|
89
|
-
*
|
|
90
|
-
* <CoinflowCardOnlyInput
|
|
91
|
-
* ref={ref}
|
|
92
|
-
* env={'sandbox'}
|
|
93
|
-
* debug={true}
|
|
94
|
-
* css={{
|
|
95
|
-
* base: 'font-family: "Red Hat Display", 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;',
|
|
96
|
-
* focus:
|
|
97
|
-
* 'box-shadow: 0 0 6px 0 rgba(0, 132, 255, 0.5);border: 1px solid rgba(0, 132, 255, 0.5);outline: 0;',
|
|
98
|
-
* error:
|
|
99
|
-
* 'box-shadow: 0 0 6px 0 rgba(224, 57, 57, 0.5);border: 1px solid rgba(224, 57, 57, 0.5);',
|
|
100
|
-
* cvv: {
|
|
101
|
-
* base: 'font-family: "Red Hat Display", 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;',
|
|
102
|
-
* focus:
|
|
103
|
-
* 'box-shadow: 0 0 6px 0 rgba(0, 132, 255, 0.5);border: 1px solid rgba(0, 132, 255, 0.5);outline: 0;',
|
|
104
|
-
* error:
|
|
105
|
-
* 'box-shadow: 0 0 6px 0 rgba(224, 57, 57, 0.5);border: 1px solid rgba(224, 57, 57, 0.5);',
|
|
106
|
-
* },
|
|
107
|
-
* }}
|
|
108
|
-
* />
|
|
109
|
-
*
|
|
110
|
-
* <button onClick={() => {
|
|
111
|
-
* ref.current?.getToken()
|
|
112
|
-
* .then(({token}) => console.log(token))
|
|
113
|
-
* .catch(e => console.error('GET TOKEN ERROR', e))
|
|
114
|
-
* }}>Get Token</button>
|
|
115
|
-
*
|
|
116
|
-
* ```
|
|
117
|
-
*/
|
|
118
|
-
export declare const CoinflowCardOnlyInput: React.NamedExoticComponent<(CoinflowCvvOnlyInputProps & MerchantIdOrCheckoutJwt) & React.RefAttributes<unknown>>;
|
|
119
|
-
/** @deprecated Use CoinflowCardForm instead */
|
|
120
|
-
export declare const CoinflowLegacyCardNumberInput: React.NamedExoticComponent<(CoinflowCardNumberInputProps & MerchantIdOrCheckoutJwt) & React.RefAttributes<unknown>>;
|
|
121
|
-
/** @deprecated Use CoinflowCvvForm instead */
|
|
122
|
-
export declare const CoinflowLegacyCvvInput: React.MemoExoticComponent<() => React.JSX.Element>;
|
|
123
|
-
/** @deprecated Use CoinflowCvvForm instead */
|
|
124
|
-
export declare const CoinflowLegacyCvvOnlyInput: React.NamedExoticComponent<(CoinflowCvvOnlyInputProps & MerchantIdOrCheckoutJwt) & React.RefAttributes<unknown>>;
|
|
125
|
-
/** @deprecated Use CoinflowCardNumberForm instead */
|
|
126
|
-
export declare const CoinflowLegacyCardOnlyInput: React.NamedExoticComponent<(CoinflowCvvOnlyInputProps & MerchantIdOrCheckoutJwt) & React.RefAttributes<unknown>>;
|
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef, memo, useEffect, useImperativeHandle, useMemo, } from 'react';
|
|
2
|
-
import { useCardFormIframe } from './useCardFormIframe';
|
|
3
|
-
import { TokenExCardNumberIframeId, TokenExCvvContainerID, } from '../common';
|
|
4
|
-
const CoinflowCardNumberInputComponent = forwardRef((props, ref) => {
|
|
5
|
-
const css = useMemo(() => {
|
|
6
|
-
return JSON.stringify(props.css);
|
|
7
|
-
}, [props.css]);
|
|
8
|
-
const origins = JSON.stringify(props.origins);
|
|
9
|
-
const { tokenExIframe, initializeTokenExIframe } = useCardFormIframe(props);
|
|
10
|
-
useImperativeHandle(ref, () => ({
|
|
11
|
-
async getToken() {
|
|
12
|
-
if (!tokenExIframe)
|
|
13
|
-
throw new Error('Unable to get token');
|
|
14
|
-
return tokenExIframe.tokenize();
|
|
15
|
-
},
|
|
16
|
-
}));
|
|
17
|
-
useEffect(() => {
|
|
18
|
-
initializeTokenExIframe({
|
|
19
|
-
css,
|
|
20
|
-
debug: props.debug,
|
|
21
|
-
origins: JSON.parse(origins),
|
|
22
|
-
font: props.font,
|
|
23
|
-
});
|
|
24
|
-
}, [css, props.debug, props.font, origins, initializeTokenExIframe]);
|
|
25
|
-
return React.createElement("div", { id: TokenExCardNumberIframeId });
|
|
26
|
-
});
|
|
27
|
-
/**
|
|
28
|
-
* Allows merchants to collect card information from their customers in a PCI-compliant way and receive the tokenized card number.
|
|
29
|
-
*
|
|
30
|
-
* Usage:
|
|
31
|
-
* ```tsx
|
|
32
|
-
* const ref = useRef<{getToken(): Promise<{token: string}>}>();
|
|
33
|
-
*
|
|
34
|
-
* <CoinflowCardNumberInput
|
|
35
|
-
* ref={ref}
|
|
36
|
-
* env={'sandbox'}
|
|
37
|
-
* debug={true}
|
|
38
|
-
* css={{
|
|
39
|
-
* base: 'font-family: "Red Hat Display", 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;',
|
|
40
|
-
* focus:
|
|
41
|
-
* 'box-shadow: 0 0 6px 0 rgba(0, 132, 255, 0.5);border: 1px solid rgba(0, 132, 255, 0.5);outline: 0;',
|
|
42
|
-
* error:
|
|
43
|
-
* 'box-shadow: 0 0 6px 0 rgba(224, 57, 57, 0.5);border: 1px solid rgba(224, 57, 57, 0.5);',
|
|
44
|
-
* cvv: {
|
|
45
|
-
* base: 'font-family: "Red Hat Display", 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;',
|
|
46
|
-
* focus:
|
|
47
|
-
* 'box-shadow: 0 0 6px 0 rgba(0, 132, 255, 0.5);border: 1px solid rgba(0, 132, 255, 0.5);outline: 0;',
|
|
48
|
-
* error:
|
|
49
|
-
* 'box-shadow: 0 0 6px 0 rgba(224, 57, 57, 0.5);border: 1px solid rgba(224, 57, 57, 0.5);',
|
|
50
|
-
* },
|
|
51
|
-
* }}
|
|
52
|
-
* />
|
|
53
|
-
* <CoinflowCvvInput />
|
|
54
|
-
*
|
|
55
|
-
* <button onClick={() => {
|
|
56
|
-
* ref.current?.getToken()
|
|
57
|
-
* .then(({token}) => console.log(token))
|
|
58
|
-
* .catch(e => console.error('GET TOKEN ERROR', e))
|
|
59
|
-
* }}>Get Token</button>
|
|
60
|
-
*
|
|
61
|
-
* ```
|
|
62
|
-
*/
|
|
63
|
-
export const CoinflowCardNumberInput = memo(CoinflowCardNumberInputComponent);
|
|
64
|
-
/**
|
|
65
|
-
* The CVV number input for creating a new tokenized card
|
|
66
|
-
*/
|
|
67
|
-
export const CoinflowCvvInput = memo(() => React.createElement("div", { id: TokenExCvvContainerID }));
|
|
68
|
-
const CoinflowCvvOnlyInputComponent = forwardRef((props, ref) => {
|
|
69
|
-
const css = useMemo(() => {
|
|
70
|
-
return JSON.stringify(props.css);
|
|
71
|
-
}, [props.css]);
|
|
72
|
-
const origins = JSON.stringify(props.origins);
|
|
73
|
-
const { tokenExIframe, initializeCvvOnlyTokenExIframe } = useCardFormIframe(props);
|
|
74
|
-
useImperativeHandle(ref, () => ({
|
|
75
|
-
async getToken() {
|
|
76
|
-
if (!tokenExIframe)
|
|
77
|
-
throw new Error('Unable to get token');
|
|
78
|
-
return tokenExIframe.tokenize();
|
|
79
|
-
},
|
|
80
|
-
}));
|
|
81
|
-
useEffect(() => {
|
|
82
|
-
initializeCvvOnlyTokenExIframe({
|
|
83
|
-
css,
|
|
84
|
-
debug: props.debug,
|
|
85
|
-
token: props.token,
|
|
86
|
-
cardType: props.cardType,
|
|
87
|
-
origins: JSON.parse(origins),
|
|
88
|
-
font: props.font,
|
|
89
|
-
});
|
|
90
|
-
}, [
|
|
91
|
-
css,
|
|
92
|
-
initializeCvvOnlyTokenExIframe,
|
|
93
|
-
props.debug,
|
|
94
|
-
props.token,
|
|
95
|
-
props.cardType,
|
|
96
|
-
origins,
|
|
97
|
-
props.font,
|
|
98
|
-
]);
|
|
99
|
-
return useMemo(() => React.createElement("div", { id: TokenExCvvContainerID }), []);
|
|
100
|
-
});
|
|
101
|
-
/**
|
|
102
|
-
* Allows merchants to collect the CVV for an already tokenized card in a PCI-compliant way and receive the token with the CVV linked.
|
|
103
|
-
*
|
|
104
|
-
* Usage:
|
|
105
|
-
* ```tsx
|
|
106
|
-
* const ref = useRef<{getToken(): Promise<{token: string}>}>();
|
|
107
|
-
*
|
|
108
|
-
* <CoinflowCvvOnlyInput
|
|
109
|
-
* ref={ref}
|
|
110
|
-
* cardType={'visa'}
|
|
111
|
-
* token={'411111YJM5TX1111'}
|
|
112
|
-
* env={'sandbox'}
|
|
113
|
-
* debug={true}
|
|
114
|
-
* css={{
|
|
115
|
-
* base: 'font-family: "Red Hat Display", 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: "Red Hat Display", 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 const CoinflowCvvOnlyInput = memo(CoinflowCvvOnlyInputComponent);
|
|
139
|
-
const CoinflowCardOnlyInputComponent = forwardRef((props, ref) => {
|
|
140
|
-
const css = useMemo(() => {
|
|
141
|
-
return JSON.stringify(props.css);
|
|
142
|
-
}, [props.css]);
|
|
143
|
-
const origins = JSON.stringify(props.origins);
|
|
144
|
-
const { tokenExIframe, initializeTokenExCardOnlyIframe } = useCardFormIframe(props);
|
|
145
|
-
useImperativeHandle(ref, () => ({
|
|
146
|
-
async getToken() {
|
|
147
|
-
if (!tokenExIframe)
|
|
148
|
-
throw new Error('Unable to get token');
|
|
149
|
-
return tokenExIframe.tokenize();
|
|
150
|
-
},
|
|
151
|
-
}));
|
|
152
|
-
useEffect(() => {
|
|
153
|
-
initializeTokenExCardOnlyIframe({
|
|
154
|
-
css,
|
|
155
|
-
debug: props.debug,
|
|
156
|
-
origins: JSON.parse(origins),
|
|
157
|
-
font: props.font,
|
|
158
|
-
});
|
|
159
|
-
}, [
|
|
160
|
-
initializeTokenExCardOnlyIframe,
|
|
161
|
-
props.debug,
|
|
162
|
-
css,
|
|
163
|
-
origins,
|
|
164
|
-
props.font,
|
|
165
|
-
]);
|
|
166
|
-
return React.createElement("div", { id: TokenExCardNumberIframeId });
|
|
167
|
-
});
|
|
168
|
-
/**
|
|
169
|
-
* Allows merchants to collect card information from their customers in a PCI-compliant way and receive the tokenized card number.
|
|
170
|
-
* The `CoinflowCardOnlyInput` is used for collecting a debit card for users to be able to withdraw their funds directly to.
|
|
171
|
-
*
|
|
172
|
-
* Usage:
|
|
173
|
-
* ```tsx
|
|
174
|
-
* const ref = useRef<{getToken(): Promise<{token: string}>}>();
|
|
175
|
-
*
|
|
176
|
-
* <CoinflowCardOnlyInput
|
|
177
|
-
* ref={ref}
|
|
178
|
-
* env={'sandbox'}
|
|
179
|
-
* debug={true}
|
|
180
|
-
* css={{
|
|
181
|
-
* base: 'font-family: "Red Hat Display", 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;',
|
|
182
|
-
* focus:
|
|
183
|
-
* 'box-shadow: 0 0 6px 0 rgba(0, 132, 255, 0.5);border: 1px solid rgba(0, 132, 255, 0.5);outline: 0;',
|
|
184
|
-
* error:
|
|
185
|
-
* 'box-shadow: 0 0 6px 0 rgba(224, 57, 57, 0.5);border: 1px solid rgba(224, 57, 57, 0.5);',
|
|
186
|
-
* cvv: {
|
|
187
|
-
* base: 'font-family: "Red Hat Display", 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;',
|
|
188
|
-
* focus:
|
|
189
|
-
* 'box-shadow: 0 0 6px 0 rgba(0, 132, 255, 0.5);border: 1px solid rgba(0, 132, 255, 0.5);outline: 0;',
|
|
190
|
-
* error:
|
|
191
|
-
* 'box-shadow: 0 0 6px 0 rgba(224, 57, 57, 0.5);border: 1px solid rgba(224, 57, 57, 0.5);',
|
|
192
|
-
* },
|
|
193
|
-
* }}
|
|
194
|
-
* />
|
|
195
|
-
*
|
|
196
|
-
* <button onClick={() => {
|
|
197
|
-
* ref.current?.getToken()
|
|
198
|
-
* .then(({token}) => console.log(token))
|
|
199
|
-
* .catch(e => console.error('GET TOKEN ERROR', e))
|
|
200
|
-
* }}>Get Token</button>
|
|
201
|
-
*
|
|
202
|
-
* ```
|
|
203
|
-
*/
|
|
204
|
-
export const CoinflowCardOnlyInput = memo(CoinflowCardOnlyInputComponent);
|
|
205
|
-
/** @deprecated Use CoinflowCardForm instead */
|
|
206
|
-
export const CoinflowLegacyCardNumberInput = CoinflowCardNumberInput;
|
|
207
|
-
/** @deprecated Use CoinflowCvvForm instead */
|
|
208
|
-
export const CoinflowLegacyCvvInput = CoinflowCvvInput;
|
|
209
|
-
/** @deprecated Use CoinflowCvvForm instead */
|
|
210
|
-
export const CoinflowLegacyCvvOnlyInput = CoinflowCvvOnlyInput;
|
|
211
|
-
/** @deprecated Use CoinflowCardNumberForm instead */
|
|
212
|
-
export const CoinflowLegacyCardOnlyInput = CoinflowCardOnlyInput;
|
|
213
|
-
//# sourceMappingURL=CoinflowCardForm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowCardForm.js","sourceRoot":"","sources":["../../../src/card-form/CoinflowCardForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,UAAU,EACV,IAAI,EACJ,SAAS,EACT,m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E;QACD,+BAA+B;QAC/B,KAAK,CAAC,KAAK;QACX,GAAG;QACH,OAAO;QACP,KAAK,CAAC,IAAI;KACX,CAAC,CAAC;IAEH,OAAO,6BAAK,EAAE,EAAE,yBAAyB,GAAI,CAAC;AAChD,CAAC,CACF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC,8BAA8B,CAAC,CAAC;AAE1E,+CAA+C;AAC/C,MAAM,CAAC,MAAM,6BAA6B,GAAG,uBAAuB,CAAC;AACrE,8CAA8C;AAC9C,MAAM,CAAC,MAAM,sBAAsB,GAAG,gBAAgB,CAAC;AACvD,8CAA8C;AAC9C,MAAM,CAAC,MAAM,0BAA0B,GAAG,oBAAoB,CAAC;AAC/D,qDAAqD;AACrD,MAAM,CAAC,MAAM,2BAA2B,GAAG,qBAAqB,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { CoinflowEnvs, MerchantIdOrCheckoutJwt } from '../common';
|
|
2
|
-
export declare function CoinflowCardFormHeader(props: {
|
|
3
|
-
env: CoinflowEnvs;
|
|
4
|
-
} & MerchantIdOrCheckoutJwt): null;
|
|
5
|
-
/** @deprecated Use CoinflowCardForm instead — header is no longer needed */
|
|
6
|
-
export declare const CoinflowLegacyCardFormHeader: typeof CoinflowCardFormHeader;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
2
|
-
import { useCardFormIframe } from './useCardFormIframe';
|
|
3
|
-
export function CoinflowCardFormHeader(props) {
|
|
4
|
-
const { setTokenExScriptTag } = useCardFormIframe(props);
|
|
5
|
-
useEffect(() => {
|
|
6
|
-
setTokenExScriptTag({ env: props.env, setTokenExScriptLoaded: () => { } });
|
|
7
|
-
}, [props.env, setTokenExScriptTag]);
|
|
8
|
-
return null;
|
|
9
|
-
}
|
|
10
|
-
/** @deprecated Use CoinflowCardForm instead — header is no longer needed */
|
|
11
|
-
export const CoinflowLegacyCardFormHeader = CoinflowCardFormHeader;
|
|
12
|
-
//# sourceMappingURL=CoinflowCardFormHeader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowCardFormHeader.js","sourceRoot":"","sources":["../../../src/card-form/CoinflowCardFormHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAChC,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAGtD,MAAM,UAAU,sBAAsB,CACpC,KAAoD;IAEpD,MAAM,EAAC,mBAAmB,EAAC,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAEvD,SAAS,CAAC,GAAG,EAAE;QACb,mBAAmB,CAAC,EAAC,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,sBAAsB,EAAE,GAAG,EAAE,GAAE,CAAC,EAAC,CAAC,CAAC;IAC1E,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAErC,OAAO,IAAI,CAAC;AACd,CAAC;AAED,4EAA4E;AAC5E,MAAM,CAAC,MAAM,4BAA4B,GAAG,sBAAsB,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { CoinflowEnvs, doInitializeCvvOnlyTokenExIframe, doInitializeTokenExCardOnlyIframe, doInitializeTokenExIframe, setTokenExScriptTag, TokenExIframe, MerchantIdOrCheckoutJwt } from '../common';
|
|
2
|
-
export declare function useCardFormIframe({ env, merchantId, checkoutJwt, }: {
|
|
3
|
-
env: CoinflowEnvs;
|
|
4
|
-
} & MerchantIdOrCheckoutJwt): {
|
|
5
|
-
tokenExIframe: TokenExIframe | undefined;
|
|
6
|
-
initializeTokenExIframe: (args: Omit<Parameters<typeof doInitializeTokenExIframe>[0], 'env' | 'tokenExScriptLoaded' | 'setCachedToken' | 'setLoaded'>) => Promise<TokenExIframe | undefined>;
|
|
7
|
-
initializeCvvOnlyTokenExIframe: (args: Omit<Parameters<typeof doInitializeCvvOnlyTokenExIframe>[0], 'env' | 'tokenExScriptLoaded' | 'setCachedToken' | 'setLoaded'>) => Promise<TokenExIframe | undefined>;
|
|
8
|
-
initializeTokenExCardOnlyIframe: (args: Omit<Parameters<typeof doInitializeTokenExCardOnlyIframe>[0], 'env' | 'tokenExScriptLoaded' | 'setCachedToken' | 'setLoaded'>) => Promise<TokenExIframe | undefined>;
|
|
9
|
-
loaded: boolean;
|
|
10
|
-
cachedToken: string | undefined;
|
|
11
|
-
setTokenExScriptTag: typeof setTokenExScriptTag;
|
|
12
|
-
};
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
-
import { doInitializeCvvOnlyTokenExIframe, doInitializeTokenExCardOnlyIframe, doInitializeTokenExIframe, setTokenExScriptTag, } from '../common';
|
|
3
|
-
export function useCardFormIframe({ env,
|
|
4
|
-
// @ts-ignore
|
|
5
|
-
merchantId,
|
|
6
|
-
// @ts-ignore
|
|
7
|
-
checkoutJwt, }) {
|
|
8
|
-
const [loaded, setLoaded] = useState(false);
|
|
9
|
-
const [tokenExScriptLoaded, setTokenExScriptLoaded] = useState(false);
|
|
10
|
-
const [tokenExIframe, setTokenExIframe] = useState(undefined);
|
|
11
|
-
const [cachedToken, setCachedToken] = useState(undefined);
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
setTokenExScriptTag({ env, setTokenExScriptLoaded });
|
|
14
|
-
}, [env, setTokenExScriptLoaded]);
|
|
15
|
-
const initializeCvvOnlyTokenExIframe = useCallback(async (args) => {
|
|
16
|
-
const iframe = await doInitializeCvvOnlyTokenExIframe({
|
|
17
|
-
...args,
|
|
18
|
-
tokenExScriptLoaded,
|
|
19
|
-
setCachedToken,
|
|
20
|
-
setLoaded,
|
|
21
|
-
env,
|
|
22
|
-
merchantId,
|
|
23
|
-
checkoutJwt,
|
|
24
|
-
});
|
|
25
|
-
setTokenExIframe(iframe);
|
|
26
|
-
return iframe;
|
|
27
|
-
}, [checkoutJwt, env, merchantId, tokenExScriptLoaded]);
|
|
28
|
-
const initializeTokenExIframe = useCallback(async (args) => {
|
|
29
|
-
const iframe = await doInitializeTokenExIframe({
|
|
30
|
-
...args,
|
|
31
|
-
tokenExScriptLoaded,
|
|
32
|
-
setCachedToken,
|
|
33
|
-
setLoaded,
|
|
34
|
-
env,
|
|
35
|
-
merchantId,
|
|
36
|
-
checkoutJwt,
|
|
37
|
-
});
|
|
38
|
-
setTokenExIframe(iframe);
|
|
39
|
-
return iframe;
|
|
40
|
-
}, [checkoutJwt, env, merchantId, tokenExScriptLoaded]);
|
|
41
|
-
const initializeTokenExCardOnlyIframe = useCallback(async (args) => {
|
|
42
|
-
const iframe = await doInitializeTokenExCardOnlyIframe({
|
|
43
|
-
...args,
|
|
44
|
-
tokenExScriptLoaded,
|
|
45
|
-
setCachedToken,
|
|
46
|
-
setLoaded,
|
|
47
|
-
env,
|
|
48
|
-
merchantId,
|
|
49
|
-
checkoutJwt,
|
|
50
|
-
});
|
|
51
|
-
setTokenExIframe(iframe);
|
|
52
|
-
return iframe;
|
|
53
|
-
}, [checkoutJwt, env, merchantId, tokenExScriptLoaded]);
|
|
54
|
-
useEffect(() => {
|
|
55
|
-
if (!tokenExIframe)
|
|
56
|
-
return;
|
|
57
|
-
tokenExIframe.load();
|
|
58
|
-
return () => tokenExIframe.remove();
|
|
59
|
-
}, [tokenExIframe]);
|
|
60
|
-
return {
|
|
61
|
-
tokenExIframe,
|
|
62
|
-
initializeTokenExIframe,
|
|
63
|
-
initializeCvvOnlyTokenExIframe,
|
|
64
|
-
initializeTokenExCardOnlyIframe,
|
|
65
|
-
loaded,
|
|
66
|
-
cachedToken,
|
|
67
|
-
setTokenExScriptTag,
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
//# sourceMappingURL=useCardFormIframe.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use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C,EACD,EAAE;QACF,MAAM,MAAM,GAAG,MAAM,yBAAyB,CAAC;YAC7C,GAAG,IAAI;YACP,mBAAmB;YACnB,cAAc;YACd,SAAS;YACT,GAAG;YACH,UAAU;YACV,WAAW;SACZ,CAAC,CAAC;QAEH,gBAAgB,CAAC,MAAM,CAAC,CAAC;QACzB,OAAO,MAAM,CAAC;IAChB,CAAC,EACD,CAAC,WAAW,EAAE,GAAG,EAAE,UAAU,EAAE,mBAAmB,CAAC,CACpD,CAAC;IAEF,MAAM,+BAA+B,GAAG,WAAW,CACjD,KAAK,EACH,IAGC,EACD,EAAE;QACF,MAAM,MAAM,GAAG,MAAM,iCAAiC,CAAC;YACrD,GAAG,IAAI;YACP,mBAAmB;YACnB,cAAc;YACd,SAAS;YACT,GAAG;YACH,UAAU;YACV,WAAW;SACZ,CAAC,CAAC;QAEH,gBAAgB,CAAC,MAAM,CAAC,CAAC;QACzB,OAAO,MAAM,CAAC;IAChB,CAAC,EACD,CAAC,WAAW,EAAE,GAAG,EAAE,UAAU,EAAE,mBAAmB,CAAC,CACpD,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,aAAa;YAAE,OAAO;QAC3B,aAAa,CAAC,IAAI,EAAE,CAAC;QACrB,OAAO,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC;IACtC,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,OAAO;QACL,aAAa;QACb,uBAAuB;QACvB,8BAA8B;QAC9B,+BAA+B;QAC/B,MAAM;QACN,WAAW;QACX,mBAAmB;KACpB,CAAC;AACJ,CAAC"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { CardType, CoinflowEnvs } from '../CoinflowTypes';
|
|
2
|
-
import type { Properties as CSSProperties } from 'csstype';
|
|
3
|
-
export declare const TokenExCardNumberIframeId = "tokenExCardNumber";
|
|
4
|
-
export declare const TokenExCvvContainerID = "tokenExCardCvv";
|
|
5
|
-
export interface TokenExIframe extends ReturnType<typeof TokenEx.Iframe> {
|
|
6
|
-
tokenize: () => Promise<TokenizationResponse>;
|
|
7
|
-
}
|
|
8
|
-
export declare const CARD_TYPE_MAPPING: Record<CardType, string>;
|
|
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
|
-
use3DS?: boolean;
|
|
18
|
-
threeDSMethodNotificationUrl?: string;
|
|
19
|
-
}
|
|
20
|
-
export interface CardFormInputStyles {
|
|
21
|
-
base: CSSProperties | string;
|
|
22
|
-
placeholder?: CSSProperties | string;
|
|
23
|
-
focus?: CSSProperties | string;
|
|
24
|
-
error?: CSSProperties | string;
|
|
25
|
-
}
|
|
26
|
-
export type CoinflowCardTokenResponse = {
|
|
27
|
-
token: string;
|
|
28
|
-
};
|
|
29
|
-
export interface CoinflowCardNumberInputProps {
|
|
30
|
-
env: CoinflowEnvs;
|
|
31
|
-
css: CardFormInputStyles & {
|
|
32
|
-
cvv: CardFormInputStyles;
|
|
33
|
-
};
|
|
34
|
-
debug?: boolean;
|
|
35
|
-
origins: string[];
|
|
36
|
-
font?: string;
|
|
37
|
-
}
|
|
38
|
-
export interface CoinflowCvvOnlyInputProps {
|
|
39
|
-
token: string;
|
|
40
|
-
cardType: CardType;
|
|
41
|
-
env: CoinflowEnvs;
|
|
42
|
-
css: CardFormInputStyles & {
|
|
43
|
-
cvv: CardFormInputStyles;
|
|
44
|
-
};
|
|
45
|
-
debug?: boolean;
|
|
46
|
-
origins: string[];
|
|
47
|
-
font?: string;
|
|
48
|
-
}
|
|
49
|
-
export interface VersionDetail {
|
|
50
|
-
threeDSMethodURL: string;
|
|
51
|
-
acsStartProtocolVersion: string;
|
|
52
|
-
acsEndProtocolVersion: string;
|
|
53
|
-
threeDSServerStartVersion: string;
|
|
54
|
-
threeDSServerEndVersion?: string;
|
|
55
|
-
acsInfoInd: [string];
|
|
56
|
-
directoryServerID: string;
|
|
57
|
-
dsStartProtocolVersion: string;
|
|
58
|
-
dsEndProtocolVersion: string;
|
|
59
|
-
dsIdentifier: string;
|
|
60
|
-
threeDSServerTransID: string;
|
|
61
|
-
}
|
|
62
|
-
export interface TokenizationResponse {
|
|
63
|
-
cardType: string;
|
|
64
|
-
cvvIncluded: true;
|
|
65
|
-
firstSix: string;
|
|
66
|
-
lastFour: string;
|
|
67
|
-
referenceNumber: string;
|
|
68
|
-
token: string;
|
|
69
|
-
tokenHMAC: string;
|
|
70
|
-
recommended3dsVersion?: Record<string, string>;
|
|
71
|
-
threeDSecureResponse?: VersionDetail[];
|
|
72
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Type definitions for TokenEx iframe integration
|
|
2
|
-
/// <reference path="./TokenEx.global.d.ts" />
|
|
3
|
-
import { CardType } from '../CoinflowTypes';
|
|
4
|
-
export const TokenExCardNumberIframeId = 'tokenExCardNumber';
|
|
5
|
-
export const TokenExCvvContainerID = 'tokenExCardCvv';
|
|
6
|
-
export const CARD_TYPE_MAPPING = {
|
|
7
|
-
[CardType.VISA]: 'visa',
|
|
8
|
-
[CardType.MASTERCARD]: 'masterCard',
|
|
9
|
-
[CardType.AMEX]: 'americanExpress',
|
|
10
|
-
[CardType.DISCOVER]: 'discover',
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=TokenEx.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TokenEx.js","sourceRoot":"","sources":["../../../../src/common/card-form/TokenEx.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,8CAA8C;AAE9C,OAAO,EAAC,QAAQ,EAAe,MAAM,kBAAkB,CAAC;AAGxD,MAAM,CAAC,MAAM,yBAAyB,GAAG,mBAAmB,CAAC;AAC7D,MAAM,CAAC,MAAM,qBAAqB,GAAG,gBAAgB,CAAC;AAKtD,MAAM,CAAC,MAAM,iBAAiB,GAA6B;IACzD,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM;IACvB,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,YAAY;IACnC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,iBAAiB;IAClC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,UAAU;CAChC,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { TokenExIframe, TokenExIFrameConfiguration } from './TokenEx';
|
|
2
|
-
import { CardType, CoinflowEnvs } from '../CoinflowTypes';
|
|
3
|
-
export type MerchantIdOrCheckoutJwt = {
|
|
4
|
-
checkoutJwt: string;
|
|
5
|
-
} | {
|
|
6
|
-
merchantId: string;
|
|
7
|
-
};
|
|
8
|
-
export interface CommonDoInitializeTokenExIframeArgs {
|
|
9
|
-
css: string;
|
|
10
|
-
debug?: boolean;
|
|
11
|
-
font?: string;
|
|
12
|
-
origins: string[];
|
|
13
|
-
tokenExScriptLoaded: boolean;
|
|
14
|
-
env: CoinflowEnvs;
|
|
15
|
-
setCachedToken: (s: string | undefined) => void;
|
|
16
|
-
setLoaded: (b: boolean) => void;
|
|
17
|
-
}
|
|
18
|
-
export type DoInitializeTokenExIframeArgs = CommonDoInitializeTokenExIframeArgs & MerchantIdOrCheckoutJwt;
|
|
19
|
-
export type DoInitializeCvvOnlyTokenExIframeArgs = DoInitializeTokenExIframeArgs & {
|
|
20
|
-
token: string;
|
|
21
|
-
cardType: CardType;
|
|
22
|
-
};
|
|
23
|
-
export type GetIFrameConfigArgs = {
|
|
24
|
-
token?: string;
|
|
25
|
-
origins: string[];
|
|
26
|
-
env: CoinflowEnvs;
|
|
27
|
-
} & MerchantIdOrCheckoutJwt;
|
|
28
|
-
export declare function getIframeConfig(args: GetIFrameConfigArgs): Promise<TokenExIFrameConfiguration>;
|
|
29
|
-
export declare function setTokenExScriptTag({ env, setTokenExScriptLoaded, }: {
|
|
30
|
-
env: CoinflowEnvs;
|
|
31
|
-
setTokenExScriptLoaded: (b: boolean) => void;
|
|
32
|
-
}): void;
|
|
33
|
-
export declare function doInitializeCvvOnlyTokenExIframe(args: DoInitializeCvvOnlyTokenExIframeArgs): Promise<TokenExIframe | undefined>;
|
|
34
|
-
export declare function doInitializeTokenExIframe(args: DoInitializeTokenExIframeArgs): Promise<TokenExIframe | undefined>;
|
|
35
|
-
export declare function doInitializeTokenExCardOnlyIframe(args: DoInitializeTokenExIframeArgs): Promise<TokenExIframe | undefined>;
|