@coinflowlabs/react 4.1.2 → 4.2.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/build/cjs/card-form/CoinflowCardForm.d.ts +101 -0
- package/build/cjs/card-form/CoinflowCardForm.js +129 -0
- package/build/cjs/card-form/CoinflowCardForm.js.map +1 -0
- package/build/cjs/card-form/TokenEx.d.ts +106 -0
- package/build/cjs/card-form/TokenEx.js +4 -0
- package/build/cjs/card-form/TokenEx.js.map +1 -0
- package/build/cjs/card-form/useCardFormIframe.d.ts +77 -0
- package/build/cjs/card-form/useCardFormIframe.js +160 -0
- package/build/cjs/card-form/useCardFormIframe.js.map +1 -0
- package/build/cjs/common/CoinflowLibMessageHandlers.d.ts +13 -3
- package/build/cjs/common/CoinflowLibMessageHandlers.js +19 -11
- package/build/cjs/common/CoinflowLibMessageHandlers.js.map +1 -1
- package/build/cjs/common/CoinflowTypes.d.ts +10 -1
- package/build/cjs/common/CoinflowTypes.js +8 -1
- package/build/cjs/common/CoinflowTypes.js.map +1 -1
- package/build/cjs/index.d.ts +1 -1
- package/build/cjs/index.js +1 -1
- package/build/cjs/index.js.map +1 -1
- package/build/esm/card-form/CoinflowCardForm.d.ts +101 -0
- package/build/esm/card-form/CoinflowCardForm.js +125 -0
- package/build/esm/card-form/CoinflowCardForm.js.map +1 -0
- package/build/esm/card-form/TokenEx.d.ts +106 -0
- package/build/esm/card-form/TokenEx.js +3 -0
- package/build/esm/card-form/TokenEx.js.map +1 -0
- package/build/esm/card-form/useCardFormIframe.d.ts +77 -0
- package/build/esm/card-form/useCardFormIframe.js +156 -0
- package/build/esm/card-form/useCardFormIframe.js.map +1 -0
- package/build/esm/common/CoinflowLibMessageHandlers.d.ts +13 -3
- package/build/esm/common/CoinflowLibMessageHandlers.js +19 -11
- package/build/esm/common/CoinflowLibMessageHandlers.js.map +1 -1
- package/build/esm/common/CoinflowTypes.d.ts +10 -1
- package/build/esm/common/CoinflowTypes.js +7 -0
- package/build/esm/common/CoinflowTypes.js.map +1 -1
- package/build/esm/index.d.ts +1 -1
- package/build/esm/index.js +1 -1
- package/build/esm/index.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/build/cjs/CoinflowCardForm.d.ts +0 -39
- package/build/cjs/CoinflowCardForm.js +0 -97
- package/build/cjs/CoinflowCardForm.js.map +0 -1
- package/build/esm/CoinflowCardForm.d.ts +0 -39
- package/build/esm/CoinflowCardForm.js +0 -94
- package/build/esm/CoinflowCardForm.js.map +0 -1
|
@@ -10,6 +10,7 @@ var IFrameMessageMethods;
|
|
|
10
10
|
IFrameMessageMethods["SignTransaction"] = "signTransaction";
|
|
11
11
|
IFrameMessageMethods["SendTransaction"] = "sendTransaction";
|
|
12
12
|
IFrameMessageMethods["HeightChange"] = "heightChange";
|
|
13
|
+
IFrameMessageMethods["Success"] = "success";
|
|
13
14
|
})(IFrameMessageMethods || (IFrameMessageMethods = {}));
|
|
14
15
|
function getWalletPubkey(_a) {
|
|
15
16
|
var wallet = _a.wallet;
|
|
@@ -52,24 +53,28 @@ function handleIFrameMessage(rawMessage, handlers) {
|
|
|
52
53
|
if (!handlers.handleHeightChange)
|
|
53
54
|
return;
|
|
54
55
|
return handlers.handleHeightChange(data);
|
|
56
|
+
case IFrameMessageMethods.Success:
|
|
57
|
+
if (!handlers.onSuccess)
|
|
58
|
+
return;
|
|
59
|
+
handlers.onSuccess(walletCall.info);
|
|
60
|
+
return;
|
|
55
61
|
}
|
|
56
62
|
console.warn("Didn't expect to get here, handleIFrameMessage method:".concat(method, " is not one of ").concat(Object.values(IFrameMessageMethods)));
|
|
57
63
|
}
|
|
58
64
|
exports.handleIFrameMessage = handleIFrameMessage;
|
|
59
|
-
function getHandlers(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
base: function () { return getEvmWalletHandlers({ wallet: wallet }); },
|
|
65
|
+
function getHandlers(props) {
|
|
66
|
+
return CoinflowUtils_1.CoinflowUtils.byBlockchain(props.blockchain, {
|
|
67
|
+
solana: function () { return getSolanaWalletHandlers(props); },
|
|
68
|
+
near: function () { return getNearWalletHandlers(props); },
|
|
69
|
+
eth: function () { return getEvmWalletHandlers(props); },
|
|
70
|
+
polygon: function () { return getEvmWalletHandlers(props); },
|
|
71
|
+
base: function () { return getEvmWalletHandlers(props); },
|
|
67
72
|
})();
|
|
68
73
|
}
|
|
69
74
|
exports.getHandlers = getHandlers;
|
|
70
75
|
function getSolanaWalletHandlers(_a) {
|
|
71
76
|
var _this = this;
|
|
72
|
-
var wallet = _a.wallet;
|
|
77
|
+
var wallet = _a.wallet, onSuccess = _a.onSuccess;
|
|
73
78
|
return {
|
|
74
79
|
handleSendTransaction: function (transaction) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
75
80
|
var tx;
|
|
@@ -122,6 +127,7 @@ function getSolanaWalletHandlers(_a) {
|
|
|
122
127
|
}
|
|
123
128
|
});
|
|
124
129
|
}); },
|
|
130
|
+
onSuccess: onSuccess,
|
|
125
131
|
};
|
|
126
132
|
}
|
|
127
133
|
function getSolanaTransaction(data) {
|
|
@@ -137,7 +143,7 @@ function getSolanaTransaction(data) {
|
|
|
137
143
|
}
|
|
138
144
|
function getNearWalletHandlers(_a) {
|
|
139
145
|
var _this = this;
|
|
140
|
-
var wallet = _a.wallet;
|
|
146
|
+
var wallet = _a.wallet, onSuccess = _a.onSuccess;
|
|
141
147
|
var nearWallet = wallet;
|
|
142
148
|
return {
|
|
143
149
|
handleSendTransaction: function (transaction) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
@@ -156,11 +162,12 @@ function getNearWalletHandlers(_a) {
|
|
|
156
162
|
}
|
|
157
163
|
});
|
|
158
164
|
}); },
|
|
165
|
+
onSuccess: onSuccess,
|
|
159
166
|
};
|
|
160
167
|
}
|
|
161
168
|
function getEvmWalletHandlers(_a) {
|
|
162
169
|
var _this = this;
|
|
163
|
-
var wallet = _a.wallet;
|
|
170
|
+
var wallet = _a.wallet, onSuccess = _a.onSuccess;
|
|
164
171
|
var evmWallet = wallet;
|
|
165
172
|
return {
|
|
166
173
|
handleSendTransaction: function (transaction) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
@@ -181,6 +188,7 @@ function getEvmWalletHandlers(_a) {
|
|
|
181
188
|
return [2 /*return*/, evmWallet.signMessage(message)];
|
|
182
189
|
});
|
|
183
190
|
}); },
|
|
191
|
+
onSuccess: onSuccess,
|
|
184
192
|
};
|
|
185
193
|
}
|
|
186
194
|
//# sourceMappingURL=CoinflowLibMessageHandlers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowLibMessageHandlers.js","sourceRoot":"","sources":["../../../src/common/CoinflowLibMessageHandlers.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"CoinflowLibMessageHandlers.js","sourceRoot":"","sources":["../../../src/common/CoinflowLibMessageHandlers.ts"],"names":[],"mappings":";;;;AAOA,iDAA8C;AAE9C,mDAA8C;AAoB9C,IAAK,oBAMJ;AAND,WAAK,oBAAoB;IACvB,mDAA2B,CAAA;IAC3B,2DAAmC,CAAA;IACnC,2DAAmC,CAAA;IACnC,qDAA6B,CAAA;IAC7B,2CAAmB,CAAA;AACrB,CAAC,EANI,oBAAoB,KAApB,oBAAoB,QAMxB;AAED,SAAgB,eAAe,CAAC,EAEQ;QADtC,MAAM,YAAA;IAEN,IAAI,WAAW,IAAI,MAAM,EAAE,CAAC;QAC1B,OAAO,MAAM,CAAC,SAAU,CAAC,QAAQ,EAAE,CAAC;IACtC,CAAC;IAED,IAAI,SAAS,IAAI,MAAM,EAAE,CAAC;QACxB,OAAO,MAAM,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,IAAI,WAAW,IAAI,MAAM,EAAE,CAAC;QAC1B,OAAO,MAAM,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED,OAAO,IAAI,CAAC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= Omit<T, K> & Partial<Pick<T, K>>;
|
|
48
|
-
export type OnSuccessMethod = (
|
|
48
|
+
export type OnSuccessMethod = (args: {
|
|
49
|
+
paymentId: string;
|
|
50
|
+
hash?: string | undefined;
|
|
51
|
+
} | string) => void | Promise<void>;
|
|
49
52
|
/** Wallets **/
|
|
50
53
|
export interface SolanaWallet {
|
|
51
54
|
publicKey: PublicKey | null;
|
|
@@ -284,4 +287,10 @@ export interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId'>,
|
|
|
284
287
|
theme?: MerchantTheme;
|
|
285
288
|
usePermit?: boolean;
|
|
286
289
|
}
|
|
290
|
+
export declare enum CardType {
|
|
291
|
+
VISA = "VISA",
|
|
292
|
+
MASTERCARD = "MSTR",
|
|
293
|
+
AMEX = "AMEX",
|
|
294
|
+
DISCOVER = "DISC"
|
|
295
|
+
}
|
|
287
296
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MerchantStyle = exports.SettlementType = void 0;
|
|
3
|
+
exports.CardType = exports.MerchantStyle = exports.SettlementType = void 0;
|
|
4
4
|
var SettlementType;
|
|
5
5
|
(function (SettlementType) {
|
|
6
6
|
SettlementType["Credits"] = "Credits";
|
|
@@ -13,4 +13,11 @@ var MerchantStyle;
|
|
|
13
13
|
MerchantStyle["Sharp"] = "sharp";
|
|
14
14
|
MerchantStyle["Pill"] = "pill";
|
|
15
15
|
})(MerchantStyle || (exports.MerchantStyle = MerchantStyle = {}));
|
|
16
|
+
var CardType;
|
|
17
|
+
(function (CardType) {
|
|
18
|
+
CardType["VISA"] = "VISA";
|
|
19
|
+
CardType["MASTERCARD"] = "MSTR";
|
|
20
|
+
CardType["AMEX"] = "AMEX";
|
|
21
|
+
CardType["DISCOVER"] = "DISC";
|
|
22
|
+
})(CardType || (exports.CardType = CardType = {}));
|
|
16
23
|
//# sourceMappingURL=CoinflowTypes.js.map
|
|
@@ -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;AA2YD,IAAY,QAKX;AALD,WAAY,QAAQ;IAClB,yBAAa,CAAA;IACb,+BAAmB,CAAA;IACnB,yBAAa,CAAA;IACb,6BAAiB,CAAA;AACnB,CAAC,EALW,QAAQ,wBAAR,QAAQ,QAKnB"}
|
package/build/cjs/index.d.ts
CHANGED
|
@@ -5,6 +5,6 @@ export * from './CoinflowIFrame';
|
|
|
5
5
|
export * from './CoinflowPurchaseHistory';
|
|
6
6
|
export * from './CoinflowWithdrawHistory';
|
|
7
7
|
export * from './CoinflowPurchaseProtection';
|
|
8
|
-
export * from './CoinflowCardForm';
|
|
8
|
+
export * from './card-form/CoinflowCardForm';
|
|
9
9
|
export * from './CoinflowApplePayButton';
|
|
10
10
|
export * from './CoinflowGooglePayButton';
|
package/build/cjs/index.js
CHANGED
|
@@ -8,7 +8,7 @@ tslib_1.__exportStar(require("./CoinflowIFrame"), exports);
|
|
|
8
8
|
tslib_1.__exportStar(require("./CoinflowPurchaseHistory"), exports);
|
|
9
9
|
tslib_1.__exportStar(require("./CoinflowWithdrawHistory"), exports);
|
|
10
10
|
tslib_1.__exportStar(require("./CoinflowPurchaseProtection"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("./CoinflowCardForm"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./card-form/CoinflowCardForm"), exports);
|
|
12
12
|
tslib_1.__exportStar(require("./CoinflowApplePayButton"), exports);
|
|
13
13
|
tslib_1.__exportStar(require("./CoinflowGooglePayButton"), exports);
|
|
14
14
|
//# sourceMappingURL=index.js.map
|
package/build/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,6DAAmC;AACnC,6DAAmC;AACnC,mDAAyB;AACzB,2DAAiC;AACjC,oEAA0C;AAC1C,oEAA0C;AAC1C,uEAA6C;AAC7C,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,6DAAmC;AACnC,6DAAmC;AACnC,mDAAyB;AACzB,2DAAiC;AACjC,oEAA0C;AAC1C,oEAA0C;AAC1C,uEAA6C;AAC7C,uEAA6C;AAC7C,mEAAyC;AACzC,oEAA0C"}
|
|
@@ -0,0 +1,101 @@
|
|
|
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={coinflowCardFormRef}
|
|
32
|
+
* env={'ref'}
|
|
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={import.meta.env.VITE_ENV as CoinflowEnvs}
|
|
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>>;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { __awaiter, __generator } from "tslib";
|
|
2
|
+
import React, { forwardRef, useEffect, useImperativeHandle } from 'react';
|
|
3
|
+
import { TokenExCardNumberIframeId, TokenExCvvContainerID, useCardFormIframe, } from './useCardFormIframe';
|
|
4
|
+
/**
|
|
5
|
+
* Allows merchants to collect card information from their customers in a PCI-compliant way and receive the tokenized card number.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* ```tsx
|
|
9
|
+
* const ref = useRef<{getToken(): Promise<{token: string}>}>();
|
|
10
|
+
*
|
|
11
|
+
* <CoinflowCardNumberInput
|
|
12
|
+
* ref={coinflowCardFormRef}
|
|
13
|
+
* env={'ref'}
|
|
14
|
+
* debug={true}
|
|
15
|
+
* css={{
|
|
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;',
|
|
17
|
+
* focus:
|
|
18
|
+
* 'box-shadow: 0 0 6px 0 rgba(0, 132, 255, 0.5);border: 1px solid rgba(0, 132, 255, 0.5);outline: 0;',
|
|
19
|
+
* error:
|
|
20
|
+
* 'box-shadow: 0 0 6px 0 rgba(224, 57, 57, 0.5);border: 1px solid rgba(224, 57, 57, 0.5);',
|
|
21
|
+
* cvv: {
|
|
22
|
+
* 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;',
|
|
23
|
+
* focus:
|
|
24
|
+
* 'box-shadow: 0 0 6px 0 rgba(0, 132, 255, 0.5);border: 1px solid rgba(0, 132, 255, 0.5);outline: 0;',
|
|
25
|
+
* error:
|
|
26
|
+
* 'box-shadow: 0 0 6px 0 rgba(224, 57, 57, 0.5);border: 1px solid rgba(224, 57, 57, 0.5);',
|
|
27
|
+
* },
|
|
28
|
+
* }}
|
|
29
|
+
* />
|
|
30
|
+
* <CoinflowCvvInput />
|
|
31
|
+
*
|
|
32
|
+
* <button onClick={() => {
|
|
33
|
+
* ref.current?.getToken()
|
|
34
|
+
* .then(({token}) => console.log(token))
|
|
35
|
+
* .catch(e => console.error('GET TOKEN ERROR', e))
|
|
36
|
+
* }}>Get Token</button>
|
|
37
|
+
*
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export var CoinflowCardNumberInput = forwardRef(function (props, ref) {
|
|
41
|
+
var _a = useCardFormIframe(props.env), tokenExIframe = _a.tokenExIframe, initializeTokenExIframe = _a.initializeTokenExIframe;
|
|
42
|
+
useImperativeHandle(ref, function () { return ({
|
|
43
|
+
getToken: function () {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
45
|
+
return __generator(this, function (_a) {
|
|
46
|
+
if (!tokenExIframe)
|
|
47
|
+
throw new Error('Unable to get token');
|
|
48
|
+
return [2 /*return*/, tokenExIframe.tokenize()];
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
},
|
|
52
|
+
}); });
|
|
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
|
+
initializeTokenExIframe(props);
|
|
61
|
+
}, [initializeTokenExIframe, props]);
|
|
62
|
+
return React.createElement("div", { id: TokenExCardNumberIframeId });
|
|
63
|
+
});
|
|
64
|
+
/**
|
|
65
|
+
* The CVV number input for creating a new tokenized card
|
|
66
|
+
*/
|
|
67
|
+
export function CoinflowCvvInput() {
|
|
68
|
+
return React.createElement("div", { id: TokenExCvvContainerID });
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Allows merchants to collect the CVV for an already tokenized card in a PCI-compliant way and receive the token with the CVV linked.
|
|
72
|
+
*
|
|
73
|
+
* Usage:
|
|
74
|
+
* ```tsx
|
|
75
|
+
* const ref = useRef<{getToken(): Promise<{token: string}>}>();
|
|
76
|
+
*
|
|
77
|
+
* <CoinflowCvvOnlyInput
|
|
78
|
+
* ref={ref}
|
|
79
|
+
* cardType={'visa'}
|
|
80
|
+
* token={'411111YJM5TX1111'}
|
|
81
|
+
* env={import.meta.env.VITE_ENV as CoinflowEnvs}
|
|
82
|
+
* debug={true}
|
|
83
|
+
* css={{
|
|
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
|
+
* cvv: {
|
|
90
|
+
* 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;',
|
|
91
|
+
* focus:
|
|
92
|
+
* 'box-shadow: 0 0 6px 0 rgba(0, 132, 255, 0.5);border: 1px solid rgba(0, 132, 255, 0.5);outline: 0;',
|
|
93
|
+
* error:
|
|
94
|
+
* 'box-shadow: 0 0 6px 0 rgba(224, 57, 57, 0.5);border: 1px solid rgba(224, 57, 57, 0.5);',
|
|
95
|
+
* },
|
|
96
|
+
* }}
|
|
97
|
+
* />
|
|
98
|
+
*
|
|
99
|
+
* <button onClick={() => {
|
|
100
|
+
* ref.current?.getToken()
|
|
101
|
+
* .then(({token}) => console.log(token))
|
|
102
|
+
* .catch(e => console.error('GET TOKEN ERROR', e))
|
|
103
|
+
* }}>Get Token</button>
|
|
104
|
+
*
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
export var CoinflowCvvOnlyInput = forwardRef(function (props, ref) {
|
|
108
|
+
var _a = useCardFormIframe(props.env), tokenExIframe = _a.tokenExIframe, initializeCvvOnlyTokenExIframe = _a.initializeCvvOnlyTokenExIframe;
|
|
109
|
+
useImperativeHandle(ref, function () { return ({
|
|
110
|
+
getToken: function () {
|
|
111
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
112
|
+
return __generator(this, function (_a) {
|
|
113
|
+
if (!tokenExIframe)
|
|
114
|
+
throw new Error('Unable to get token');
|
|
115
|
+
return [2 /*return*/, tokenExIframe.tokenize()];
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
},
|
|
119
|
+
}); });
|
|
120
|
+
useEffect(function () {
|
|
121
|
+
initializeCvvOnlyTokenExIframe(props);
|
|
122
|
+
}, [initializeCvvOnlyTokenExIframe, props]);
|
|
123
|
+
return React.createElement("div", { id: TokenExCvvContainerID });
|
|
124
|
+
});
|
|
125
|
+
//# sourceMappingURL=CoinflowCardForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CoinflowCardForm.js","sourceRoot":"","sources":["../../../src/card-form/CoinflowCardForm.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAC,UAAU,EAAE,SAAS,EAAE,mBAAmB,EAAC,MAAM,OAAO,CAAC;AAExE,OAAO,EAEL,yBAAyB,EACzB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAoB7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,CAAC,IAAM,uBAAuB,GAAG,UAAU,CAC/C,UAAC,KAAmC,EAAE,GAAG;IACjC,IAAA,KAA2C,iBAAiB,CAChE,KAAK,CAAC,GAAG,CACV,EAFM,aAAa,mBAAA,EAAE,uBAAuB,6BAE5C,CAAC;IAEF,mBAAmB,CAAC,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,SAAS,CAAC;QACR,IAAM,YAAY,GAAG,QAAQ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
2
|
+
cardType: string;
|
|
3
|
+
cvvIncluded: true;
|
|
4
|
+
firstSix: string;
|
|
5
|
+
lastFour: string;
|
|
6
|
+
referenceNumber: string;
|
|
7
|
+
token: string;
|
|
8
|
+
tokenHMAC: string;
|
|
9
|
+
}
|
|
10
|
+
declare global {
|
|
11
|
+
namespace TokenEx {
|
|
12
|
+
interface FraudServicesConfig {
|
|
13
|
+
useKount?: boolean;
|
|
14
|
+
kount?: {
|
|
15
|
+
merchantId?: string;
|
|
16
|
+
mode?: string;
|
|
17
|
+
anId?: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
interface Config {
|
|
21
|
+
debug?: boolean;
|
|
22
|
+
enablePrettyFormat?: boolean;
|
|
23
|
+
maskInput?: boolean;
|
|
24
|
+
enableValidateOnBlur?: boolean;
|
|
25
|
+
enableAriaRequired?: boolean;
|
|
26
|
+
pci?: boolean;
|
|
27
|
+
cvvOnly?: boolean;
|
|
28
|
+
allowUnknownCardTypes?: boolean;
|
|
29
|
+
enableAutoComplete?: boolean;
|
|
30
|
+
returnAutoCompleteValues?: boolean;
|
|
31
|
+
returnKhash?: boolean;
|
|
32
|
+
returnWhash?: boolean;
|
|
33
|
+
enforceLuhnCompliance?: boolean;
|
|
34
|
+
use3DS?: boolean;
|
|
35
|
+
validateOnKeyUp?: boolean;
|
|
36
|
+
validateOnCvvKeyUp?: boolean;
|
|
37
|
+
expiresInSeconds?: number;
|
|
38
|
+
useExtendedBIN?: boolean;
|
|
39
|
+
inlineIframeJavaScript?: boolean;
|
|
40
|
+
iframeVersion?: number;
|
|
41
|
+
authenticationKey?: string;
|
|
42
|
+
origin?: string;
|
|
43
|
+
tokenExID?: string;
|
|
44
|
+
timestamp?: string;
|
|
45
|
+
tokenScheme?: string;
|
|
46
|
+
token?: string;
|
|
47
|
+
customDataLabel?: string;
|
|
48
|
+
customCvvDataLabel?: string;
|
|
49
|
+
title?: string;
|
|
50
|
+
cvvTitle?: string;
|
|
51
|
+
inputTitle?: string;
|
|
52
|
+
cvvInputTitle?: string;
|
|
53
|
+
cardMaxLengths?: {
|
|
54
|
+
visa?: number;
|
|
55
|
+
mastercard?: number;
|
|
56
|
+
americanExpress?: number;
|
|
57
|
+
discover?: number;
|
|
58
|
+
jcb?: number;
|
|
59
|
+
diners?: number;
|
|
60
|
+
};
|
|
61
|
+
fraudServices?: FraudServicesConfig;
|
|
62
|
+
threeDSMethodNotificationUrl?: string;
|
|
63
|
+
customDataTypes?: string | object;
|
|
64
|
+
cvvContainerID?: string;
|
|
65
|
+
cvvPlaceholder?: string;
|
|
66
|
+
cardType?: string;
|
|
67
|
+
forterSiteId?: string;
|
|
68
|
+
forterUsername?: string;
|
|
69
|
+
customRegEx?: string;
|
|
70
|
+
placeholder?: string;
|
|
71
|
+
inputType?: string;
|
|
72
|
+
inputMode?: string;
|
|
73
|
+
font?: string;
|
|
74
|
+
cvv?: boolean;
|
|
75
|
+
styles: {
|
|
76
|
+
base: string;
|
|
77
|
+
focus: string;
|
|
78
|
+
error: string;
|
|
79
|
+
cvv: {
|
|
80
|
+
base: string;
|
|
81
|
+
focus: string;
|
|
82
|
+
error: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
interface IframeAPI {
|
|
87
|
+
load(): void;
|
|
88
|
+
on: (event: string, callback: (data?: any) => void) => void;
|
|
89
|
+
tokenize(): void;
|
|
90
|
+
validate(): void;
|
|
91
|
+
reset(): void;
|
|
92
|
+
blur(): void;
|
|
93
|
+
cvvBlur(): void;
|
|
94
|
+
focus(): void;
|
|
95
|
+
cvvFocus(): void;
|
|
96
|
+
remove(): void;
|
|
97
|
+
toggleMask(): void;
|
|
98
|
+
toggleCvvMask(): void;
|
|
99
|
+
setPAN(pan: string): void;
|
|
100
|
+
binLookup(): void;
|
|
101
|
+
validateConfig(): void;
|
|
102
|
+
setFraudServicesRequestDetails(data: string): void;
|
|
103
|
+
}
|
|
104
|
+
function Iframe(containerID: string, configuration: Config): IframeAPI;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TokenEx.js","sourceRoot":"","sources":["../../../src/card-form/TokenEx.ts"],"names":[],"mappings":"AAAA,kDAAkD"}
|
|
@@ -0,0 +1,77 @@
|
|
|
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
|
+
loaded: boolean;
|
|
76
|
+
cachedToken: string | undefined;
|
|
77
|
+
};
|