@evervault/evervault-react-native 1.0.1 → 1.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/README.md +34 -39
- package/dist/commonjs/components/3DS/ThreeDSecure.js +34 -0
- package/dist/commonjs/components/3DS/ThreeDSecure.js.map +1 -0
- package/dist/commonjs/components/3DS/ThreeDSecureFrame.js +45 -0
- package/dist/commonjs/components/3DS/ThreeDSecureFrame.js.map +1 -0
- package/dist/commonjs/components/3DS/config.js +9 -0
- package/dist/commonjs/components/3DS/config.js.map +1 -0
- package/dist/commonjs/components/3DS/context.js +9 -0
- package/dist/commonjs/components/3DS/context.js.map +1 -0
- package/dist/commonjs/components/3DS/index.js +20 -0
- package/dist/commonjs/components/3DS/index.js.map +1 -0
- package/dist/commonjs/components/3DS/styles.js +63 -0
- package/dist/commonjs/components/3DS/styles.js.map +1 -0
- package/dist/commonjs/components/3DS/threeDSSession.js +109 -0
- package/dist/commonjs/components/3DS/threeDSSession.js.map +1 -0
- package/dist/commonjs/components/3DS/types.js +2 -0
- package/dist/commonjs/components/3DS/types.js.map +1 -0
- package/dist/commonjs/components/3DS/useThreeDSecure.js +46 -0
- package/dist/commonjs/components/3DS/useThreeDSecure.js.map +1 -0
- package/dist/commonjs/components/Card/Card.js +13 -13
- package/dist/commonjs/components/Card/CardCVC.js +7 -7
- package/dist/commonjs/components/Card/CardExpiry.js +6 -6
- package/dist/commonjs/components/Card/CardHolder.js +5 -5
- package/dist/commonjs/components/Card/CardNumber.js +6 -6
- package/dist/commonjs/components/Card/CardNumber.js.map +1 -1
- package/dist/commonjs/components/Card/context.js +5 -5
- package/dist/commonjs/components/Card/utilities.js +5 -5
- package/dist/commonjs/components/EvervaultProvider.js +62 -0
- package/dist/commonjs/components/EvervaultProvider.js.map +1 -0
- package/dist/commonjs/index.js +21 -0
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/native.js +2 -2
- package/dist/commonjs/sdk.js +10 -3
- package/dist/commonjs/sdk.js.map +1 -1
- package/dist/module/components/3DS/ThreeDSecure.js +28 -0
- package/dist/module/components/3DS/ThreeDSecure.js.map +1 -0
- package/dist/module/components/3DS/ThreeDSecureFrame.js +36 -0
- package/dist/module/components/3DS/ThreeDSecureFrame.js.map +1 -0
- package/dist/module/components/3DS/config.js +3 -0
- package/dist/module/components/3DS/config.js.map +1 -0
- package/dist/module/components/3DS/context.js +3 -0
- package/dist/module/components/3DS/context.js.map +1 -0
- package/dist/module/components/3DS/index.js +3 -0
- package/dist/module/components/3DS/index.js.map +1 -0
- package/dist/module/components/3DS/styles.js +58 -0
- package/dist/module/components/3DS/styles.js.map +1 -0
- package/dist/module/components/3DS/threeDSSession.js +100 -0
- package/dist/module/components/3DS/threeDSSession.js.map +1 -0
- package/dist/module/components/3DS/types.js +2 -0
- package/dist/module/components/3DS/types.js.map +1 -0
- package/dist/module/components/3DS/useThreeDSecure.js +40 -0
- package/dist/module/components/3DS/useThreeDSecure.js.map +1 -0
- package/dist/module/components/Card/Card.js +25 -25
- package/dist/module/components/Card/Card.js.map +1 -1
- package/dist/module/components/Card/CardCVC.js +12 -12
- package/dist/module/components/Card/CardExpiry.js +10 -10
- package/dist/module/components/Card/CardHolder.js +9 -9
- package/dist/module/components/Card/CardNumber.js +11 -11
- package/dist/module/components/Card/CardNumber.js.map +1 -1
- package/dist/module/components/Card/context.js +6 -6
- package/dist/module/components/Card/index.js +1 -1
- package/dist/module/components/Card/utilities.js +6 -6
- package/dist/module/components/EvervaultProvider.js +53 -0
- package/dist/module/components/EvervaultProvider.js.map +1 -0
- package/dist/module/index.js +4 -2
- package/dist/module/index.js.map +1 -1
- package/dist/module/native.js +3 -3
- package/dist/module/sdk.js +13 -5
- package/dist/module/sdk.js.map +1 -1
- package/dist/typescript/src/components/3DS/ThreeDSecure.d.ts +8 -0
- package/dist/typescript/src/components/3DS/ThreeDSecure.d.ts.map +1 -0
- package/dist/typescript/src/components/3DS/ThreeDSecureFrame.d.ts +3 -0
- package/dist/typescript/src/components/3DS/ThreeDSecureFrame.d.ts.map +1 -0
- package/dist/typescript/src/components/3DS/config.d.ts +3 -0
- package/dist/typescript/src/components/3DS/config.d.ts.map +1 -0
- package/dist/typescript/src/components/3DS/context.d.ts +4 -0
- package/dist/typescript/src/components/3DS/context.d.ts.map +1 -0
- package/dist/typescript/src/components/3DS/index.d.ts +3 -0
- package/dist/typescript/src/components/3DS/index.d.ts.map +1 -0
- package/dist/typescript/src/components/3DS/styles.d.ts +57 -0
- package/dist/typescript/src/components/3DS/styles.d.ts.map +1 -0
- package/dist/typescript/src/components/3DS/threeDSSession.d.ts +10 -0
- package/dist/typescript/src/components/3DS/threeDSSession.d.ts.map +1 -0
- package/dist/typescript/src/components/3DS/types.d.ts +42 -0
- package/dist/typescript/src/components/3DS/types.d.ts.map +1 -0
- package/dist/typescript/src/components/3DS/useThreeDSecure.d.ts +3 -0
- package/dist/typescript/src/components/3DS/useThreeDSecure.d.ts.map +1 -0
- package/dist/typescript/src/components/Card/Card.d.ts +8 -8
- package/dist/typescript/src/components/Card/Card.d.ts.map +1 -1
- package/dist/typescript/src/components/Card/CardCVC.d.ts +2 -2
- package/dist/typescript/src/components/Card/CardExpiry.d.ts +2 -2
- package/dist/typescript/src/components/Card/CardHolder.d.ts +2 -2
- package/dist/typescript/src/components/Card/CardNumber.d.ts +2 -2
- package/dist/typescript/src/components/Card/context.d.ts +4 -4
- package/dist/typescript/src/components/Card/index.d.ts +1 -1
- package/dist/typescript/src/components/Card/types.d.ts +2 -2
- package/dist/typescript/src/components/Card/types.d.ts.map +1 -1
- package/dist/typescript/src/components/Card/utilities.d.ts +3 -3
- package/dist/typescript/src/components/EvervaultProvider.d.ts +29 -0
- package/dist/typescript/src/components/EvervaultProvider.d.ts.map +1 -0
- package/dist/typescript/src/index.d.ts +5 -3
- package/dist/typescript/src/index.d.ts.map +1 -1
- package/dist/typescript/src/sdk.d.ts +7 -0
- package/dist/typescript/src/sdk.d.ts.map +1 -1
- package/package.json +6 -80
- package/src/components/3DS/ThreeDSecure.tsx +32 -0
- package/src/components/3DS/ThreeDSecureFrame.tsx +39 -0
- package/src/components/3DS/config.ts +2 -0
- package/src/components/3DS/context.tsx +4 -0
- package/src/components/3DS/index.ts +2 -0
- package/src/components/3DS/styles.tsx +63 -0
- package/src/components/3DS/threeDSSession.ts +132 -0
- package/src/components/3DS/types.ts +46 -0
- package/src/components/3DS/useThreeDSecure.tsx +51 -0
- package/src/components/Card/Card.tsx +27 -27
- package/src/components/Card/CardCVC.tsx +13 -13
- package/src/components/Card/CardExpiry.tsx +11 -11
- package/src/components/Card/CardHolder.tsx +10 -10
- package/src/components/Card/CardNumber.tsx +12 -12
- package/src/components/Card/context.tsx +9 -9
- package/src/components/Card/index.ts +1 -1
- package/src/components/Card/types.ts +15 -14
- package/src/components/Card/utilities.ts +8 -8
- package/src/components/EvervaultProvider.tsx +64 -0
- package/src/index.tsx +5 -3
- package/src/native.ts +4 -4
- package/src/sdk.ts +12 -5
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { validateNumber, validateCVC, validateExpiry } from
|
|
2
|
-
import * as React from
|
|
3
|
-
import { useState } from
|
|
4
|
-
import { useForm } from
|
|
5
|
-
import { changePayload, isAcceptedBrand } from
|
|
6
|
-
import { CardNumber } from
|
|
7
|
-
import { CardContext } from
|
|
8
|
-
import { encrypt } from
|
|
9
|
-
import { CardCVC } from
|
|
10
|
-
import { CardHolder } from
|
|
11
|
-
import { CardExpiry } from
|
|
12
|
-
import { View } from
|
|
1
|
+
import { validateNumber, validateCVC, validateExpiry } from "@evervault/card-validator";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { useForm } from "../useForm";
|
|
5
|
+
import { changePayload, isAcceptedBrand } from "./utilities";
|
|
6
|
+
import { CardNumber } from "./CardNumber";
|
|
7
|
+
import { CardContext } from "./context";
|
|
8
|
+
import { encrypt } from "../../sdk";
|
|
9
|
+
import { CardCVC } from "./CardCVC";
|
|
10
|
+
import { CardHolder } from "./CardHolder";
|
|
11
|
+
import { CardExpiry } from "./CardExpiry";
|
|
12
|
+
import { View } from "react-native";
|
|
13
13
|
function Card({
|
|
14
14
|
initialValue,
|
|
15
15
|
config,
|
|
@@ -20,51 +20,51 @@ function Card({
|
|
|
20
20
|
const [registeredFields, setRegisteredFields] = useState(new Set());
|
|
21
21
|
const form = useForm({
|
|
22
22
|
initialValues: initialValue ?? {
|
|
23
|
-
cvc:
|
|
24
|
-
expiry:
|
|
25
|
-
number:
|
|
26
|
-
name:
|
|
23
|
+
cvc: "",
|
|
24
|
+
expiry: "",
|
|
25
|
+
number: "",
|
|
26
|
+
name: ""
|
|
27
27
|
},
|
|
28
28
|
validate: {
|
|
29
29
|
name: values => {
|
|
30
|
-
if (!registeredFields.has(
|
|
30
|
+
if (!registeredFields.has("name")) {
|
|
31
31
|
return undefined;
|
|
32
32
|
}
|
|
33
33
|
if (values.name.length === 0) {
|
|
34
|
-
return
|
|
34
|
+
return "invalid";
|
|
35
35
|
}
|
|
36
36
|
return undefined;
|
|
37
37
|
},
|
|
38
38
|
number: values => {
|
|
39
|
-
if (!registeredFields.has(
|
|
39
|
+
if (!registeredFields.has("number")) {
|
|
40
40
|
return undefined;
|
|
41
41
|
}
|
|
42
42
|
const cardValidation = validateNumber(values.number);
|
|
43
43
|
if (!cardValidation.isValid) {
|
|
44
|
-
return
|
|
44
|
+
return "invalid";
|
|
45
45
|
}
|
|
46
46
|
if (!isAcceptedBrand(config?.acceptedBrands, cardValidation)) {
|
|
47
|
-
return
|
|
47
|
+
return "unsupportedBrand";
|
|
48
48
|
}
|
|
49
49
|
return undefined;
|
|
50
50
|
},
|
|
51
51
|
expiry: values => {
|
|
52
|
-
if (!registeredFields.has(
|
|
52
|
+
if (!registeredFields.has("expiry")) {
|
|
53
53
|
return undefined;
|
|
54
54
|
}
|
|
55
55
|
const expiryValidation = validateExpiry(values.expiry);
|
|
56
56
|
if (!expiryValidation.isValid) {
|
|
57
|
-
return
|
|
57
|
+
return "invalid";
|
|
58
58
|
}
|
|
59
59
|
return undefined;
|
|
60
60
|
},
|
|
61
61
|
cvc: values => {
|
|
62
|
-
if (!registeredFields.has(
|
|
62
|
+
if (!registeredFields.has("cvc")) {
|
|
63
63
|
return undefined;
|
|
64
64
|
}
|
|
65
65
|
const cvcValidation = validateCVC(values.cvc, values.number);
|
|
66
66
|
if (!cvcValidation.isValid) {
|
|
67
|
-
return
|
|
67
|
+
return "invalid";
|
|
68
68
|
}
|
|
69
69
|
return undefined;
|
|
70
70
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["validateNumber","validateCVC","validateExpiry","React","useState","useForm","changePayload","isAcceptedBrand","CardNumber","CardContext","encrypt","CardCVC","CardHolder","CardExpiry","View","Card","initialValue","config","children","onChange","style","registeredFields","setRegisteredFields","Set","form","initialValues","cvc","expiry","number","name","validate","values","has","undefined","length","cardValidation","isValid","acceptedBrands","expiryValidation","cvcValidation","formState","triggerChange","cardData","Array","from","createElement","Provider","value","register","CardNamespace","Object","assign","Number","CVC","Holder","Expiry"],"sourceRoot":"../../../../src","sources":["components/Card/Card.tsx"],"mappings":"AAAA,SACEA,cAAc,EACdC,WAAW,EACXC,cAAc,QACT,2BAA2B;AAClC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,
|
|
1
|
+
{"version":3,"names":["validateNumber","validateCVC","validateExpiry","React","useState","useForm","changePayload","isAcceptedBrand","CardNumber","CardContext","encrypt","CardCVC","CardHolder","CardExpiry","View","Card","initialValue","config","children","onChange","style","registeredFields","setRegisteredFields","Set","form","initialValues","cvc","expiry","number","name","validate","values","has","undefined","length","cardValidation","isValid","acceptedBrands","expiryValidation","cvcValidation","formState","triggerChange","cardData","Array","from","createElement","Provider","value","register","CardNamespace","Object","assign","Number","CVC","Holder","Expiry"],"sourceRoot":"../../../../src","sources":["components/Card/Card.tsx"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
import { validateNumber } from
|
|
3
|
-
import * as React from
|
|
4
|
-
import { useEffect, useMemo } from
|
|
5
|
-
import { TextInputMask } from
|
|
6
|
-
import { removeFieldFromSet, useCardContext } from
|
|
2
|
+
import { validateNumber } from "@evervault/card-validator";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { useEffect, useMemo } from "react";
|
|
5
|
+
import { TextInputMask } from "react-native-masked-text";
|
|
6
|
+
import { removeFieldFromSet, useCardContext } from "./context";
|
|
7
7
|
export const CardCVC = props => {
|
|
8
8
|
const context = useCardContext();
|
|
9
9
|
const mask = useMemo(() => {
|
|
10
10
|
if (!context.values.number) {
|
|
11
|
-
return
|
|
11
|
+
return "9999";
|
|
12
12
|
}
|
|
13
13
|
const type = validateNumber(context.values.number).brand;
|
|
14
|
-
if (type ===
|
|
15
|
-
return
|
|
14
|
+
if (type === "american-express") {
|
|
15
|
+
return "9999";
|
|
16
16
|
}
|
|
17
|
-
return
|
|
17
|
+
return "999";
|
|
18
18
|
}, [context.values.number]);
|
|
19
19
|
const {
|
|
20
20
|
onChange,
|
|
21
21
|
onBlur
|
|
22
|
-
} = context.register(
|
|
22
|
+
} = context.register("cvc");
|
|
23
23
|
useEffect(() => {
|
|
24
|
-
context.setRegisteredFields(prev => new Set(prev).add(
|
|
25
|
-
return () => context.setRegisteredFields(prev => removeFieldFromSet(prev,
|
|
24
|
+
context.setRegisteredFields(prev => new Set(prev).add("cvc"));
|
|
25
|
+
return () => context.setRegisteredFields(prev => removeFieldFromSet(prev, "cvc"));
|
|
26
26
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
27
27
|
}, []);
|
|
28
28
|
return /*#__PURE__*/React.createElement(TextInputMask, _extends({}, props, {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
import { TextInputMask } from
|
|
3
|
-
import { removeFieldFromSet, useCardContext } from
|
|
4
|
-
import * as React from
|
|
5
|
-
import { useEffect } from
|
|
2
|
+
import { TextInputMask } from "react-native-masked-text";
|
|
3
|
+
import { removeFieldFromSet, useCardContext } from "./context";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { useEffect } from "react";
|
|
6
6
|
export function CardExpiry(props) {
|
|
7
7
|
const context = useCardContext();
|
|
8
8
|
const {
|
|
9
9
|
onBlur,
|
|
10
10
|
onChange
|
|
11
|
-
} = context.register(
|
|
11
|
+
} = context.register("expiry");
|
|
12
12
|
useEffect(() => {
|
|
13
|
-
context.setRegisteredFields(prev => new Set(prev).add(
|
|
14
|
-
return () => context.setRegisteredFields(prev => removeFieldFromSet(prev,
|
|
13
|
+
context.setRegisteredFields(prev => new Set(prev).add("expiry"));
|
|
14
|
+
return () => context.setRegisteredFields(prev => removeFieldFromSet(prev, "expiry"));
|
|
15
15
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
16
16
|
}, []);
|
|
17
17
|
return /*#__PURE__*/React.createElement(TextInputMask, _extends({}, props, {
|
|
@@ -19,16 +19,16 @@ export function CardExpiry(props) {
|
|
|
19
19
|
value: context.values.expiry
|
|
20
20
|
// store the expiry as MMYY not MM / YY
|
|
21
21
|
,
|
|
22
|
-
onChangeText: rawExpiry => onChange(rawExpiry.replace(
|
|
22
|
+
onChangeText: rawExpiry => onChange(rawExpiry.replace(" / ", "")),
|
|
23
23
|
options: {
|
|
24
|
-
format:
|
|
24
|
+
format: "99 / 99"
|
|
25
25
|
},
|
|
26
26
|
id: "expiry",
|
|
27
27
|
onBlur: e => {
|
|
28
28
|
onBlur(e);
|
|
29
29
|
props.onBlur?.(e);
|
|
30
30
|
},
|
|
31
|
-
placeholder: props.placeholder ??
|
|
31
|
+
placeholder: props.placeholder ?? "MM / YY",
|
|
32
32
|
inputMode: "numeric",
|
|
33
33
|
autoComplete: "cc-exp"
|
|
34
34
|
}));
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
import { useEffect } from
|
|
3
|
-
import * as React from
|
|
4
|
-
import { Platform, TextInput } from
|
|
5
|
-
import { removeFieldFromSet, useCardContext } from
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Platform, TextInput } from "react-native";
|
|
5
|
+
import { removeFieldFromSet, useCardContext } from "./context";
|
|
6
6
|
export function CardHolder(props) {
|
|
7
7
|
const context = useCardContext();
|
|
8
8
|
const {
|
|
9
9
|
onBlur,
|
|
10
10
|
onChange
|
|
11
|
-
} = context.register(
|
|
11
|
+
} = context.register("name");
|
|
12
12
|
useEffect(() => {
|
|
13
|
-
context.setRegisteredFields(prev => new Set(prev).add(
|
|
14
|
-
return () => context.setRegisteredFields(prev => removeFieldFromSet(prev,
|
|
13
|
+
context.setRegisteredFields(prev => new Set(prev).add("name"));
|
|
14
|
+
return () => context.setRegisteredFields(prev => removeFieldFromSet(prev, "name"));
|
|
15
15
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
16
16
|
}, []);
|
|
17
17
|
return /*#__PURE__*/React.createElement(TextInput, _extends({}, props, {
|
|
@@ -22,8 +22,8 @@ export function CardHolder(props) {
|
|
|
22
22
|
props.onBlur?.(e);
|
|
23
23
|
},
|
|
24
24
|
autoComplete: Platform.select({
|
|
25
|
-
ios:
|
|
26
|
-
android:
|
|
25
|
+
ios: "cc-name",
|
|
26
|
+
android: "name"
|
|
27
27
|
}),
|
|
28
28
|
onChangeText: v => onChange(v)
|
|
29
29
|
}));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
import { validateNumber } from
|
|
3
|
-
import * as React from
|
|
4
|
-
import { useEffect, useMemo, useRef } from
|
|
5
|
-
import { TextInputMask } from
|
|
6
|
-
import { removeFieldFromSet, useCardContext } from
|
|
2
|
+
import { validateNumber } from "@evervault/card-validator";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { useEffect, useMemo, useRef } from "react";
|
|
5
|
+
import { TextInputMask } from "react-native-masked-text";
|
|
6
|
+
import { removeFieldFromSet, useCardContext } from "./context";
|
|
7
7
|
export function CardNumber(props) {
|
|
8
8
|
const context = useCardContext();
|
|
9
9
|
const ref = useRef(null);
|
|
@@ -13,9 +13,9 @@ export function CardNumber(props) {
|
|
|
13
13
|
brand
|
|
14
14
|
} = validateNumber(value);
|
|
15
15
|
const masks = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
default: "9999 9999 9999 9999",
|
|
17
|
+
unionpay: "9999 9999 9999 9999 999",
|
|
18
|
+
"american-express": "9999 999999 99999"
|
|
19
19
|
};
|
|
20
20
|
if (brand && !!masks[brand]) {
|
|
21
21
|
return [value, masks[brand]];
|
|
@@ -25,10 +25,10 @@ export function CardNumber(props) {
|
|
|
25
25
|
const {
|
|
26
26
|
onBlur,
|
|
27
27
|
onChange
|
|
28
|
-
} = context.register(
|
|
28
|
+
} = context.register("number");
|
|
29
29
|
useEffect(() => {
|
|
30
|
-
context.setRegisteredFields(prev => new Set(prev).add(
|
|
31
|
-
return () => context.setRegisteredFields(prev => removeFieldFromSet(prev,
|
|
30
|
+
context.setRegisteredFields(prev => new Set(prev).add("number"));
|
|
31
|
+
return () => context.setRegisteredFields(prev => removeFieldFromSet(prev, "number"));
|
|
32
32
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
33
33
|
}, []);
|
|
34
34
|
return /*#__PURE__*/React.createElement(TextInputMask, _extends({}, props, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["validateNumber","React","useEffect","useMemo","useRef","TextInputMask","removeFieldFromSet","useCardContext","CardNumber","props","context","ref","innerValue","mask","value","values","number","brand","masks","default","onBlur","onChange","register","setRegisteredFields","prev","Set","add","createElement","_extends","type","options","id","onChangeText","e","inputMode","autoComplete"],"sourceRoot":"../../../../src","sources":["components/Card/CardNumber.tsx"],"mappings":";AAAA,SAASA,cAAc,QAAQ,2BAA2B;AAC1D,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AAClD,SAASC,aAAa,QAAQ,0BAA0B;AACxD,SAASC,kBAAkB,EAAEC,cAAc,QAAQ,WAAW;AAK9D,OAAO,SAASC,UAAUA,CAACC,KAAsB,EAAE;EACjD,MAAMC,OAAO,GAAGH,cAAc,CAAC,CAAC;EAChC,MAAMI,GAAG,GAAGP,MAAM,CAAgB,IAAI,CAAC;EAEvC,MAAM,CAACQ,UAAU,EAAEC,IAAI,CAAC,GAAGV,OAAO,CAAC,MAAM;IACvC,MAAMW,KAAK,GAAGJ,OAAO,CAACK,MAAM,CAACC,MAAM;IAEnC,MAAM;MAAEC;IAAM,CAAC,GAAGjB,cAAc,CAACc,KAAK,CAAC;IAEvC,MAAMI,KAAK,GAAG;
|
|
1
|
+
{"version":3,"names":["validateNumber","React","useEffect","useMemo","useRef","TextInputMask","removeFieldFromSet","useCardContext","CardNumber","props","context","ref","innerValue","mask","value","values","number","brand","masks","default","unionpay","onBlur","onChange","register","setRegisteredFields","prev","Set","add","createElement","_extends","type","options","id","onChangeText","e","inputMode","autoComplete"],"sourceRoot":"../../../../src","sources":["components/Card/CardNumber.tsx"],"mappings":";AAAA,SAASA,cAAc,QAAQ,2BAA2B;AAC1D,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AAClD,SAASC,aAAa,QAAQ,0BAA0B;AACxD,SAASC,kBAAkB,EAAEC,cAAc,QAAQ,WAAW;AAK9D,OAAO,SAASC,UAAUA,CAACC,KAAsB,EAAE;EACjD,MAAMC,OAAO,GAAGH,cAAc,CAAC,CAAC;EAChC,MAAMI,GAAG,GAAGP,MAAM,CAAgB,IAAI,CAAC;EAEvC,MAAM,CAACQ,UAAU,EAAEC,IAAI,CAAC,GAAGV,OAAO,CAAC,MAAM;IACvC,MAAMW,KAAK,GAAGJ,OAAO,CAACK,MAAM,CAACC,MAAM;IAEnC,MAAM;MAAEC;IAAM,CAAC,GAAGjB,cAAc,CAACc,KAAK,CAAC;IAEvC,MAAMI,KAAK,GAAG;MACZC,OAAO,EAAE,qBAAqB;MAC9BC,QAAQ,EAAE,yBAAyB;MACnC,kBAAkB,EAAE;IACtB,CAA2B;IAE3B,IAAIH,KAAK,IAAI,CAAC,CAACC,KAAK,CAACD,KAAK,CAAC,EAAE;MAC3B,OAAO,CAACH,KAAK,EAAEI,KAAK,CAACD,KAAK,CAAC,CAAC;IAC9B;IACA,OAAO,CAACH,KAAK,EAAEI,KAAK,CAACC,OAAO,CAAC;EAC/B,CAAC,EAAE,CAACT,OAAO,CAACK,MAAM,CAACC,MAAM,CAAC,CAAC;EAE3B,MAAM;IAAEK,MAAM;IAAEC;EAAS,CAAC,GAAGZ,OAAO,CAACa,QAAQ,CAAC,QAAQ,CAAC;EAEvDrB,SAAS,CAAC,MAAM;IACdQ,OAAO,CAACc,mBAAmB,CAAEC,IAAI,IAAK,IAAIC,GAAG,CAACD,IAAI,CAAC,CAACE,GAAG,CAAC,QAAQ,CAAC,CAAC;IAElE,OAAO,MACLjB,OAAO,CAACc,mBAAmB,CAAEC,IAAI,IAAKnB,kBAAkB,CAACmB,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC3E;EACF,CAAC,EAAE,EAAE,CAAC;EAEN,oBACExB,KAAA,CAAA2B,aAAA,CAACvB,aAAa,EAAAwB,QAAA,KACRpB,KAAK;IACTE,GAAG,EAAEA,GAAI;IACTmB,IAAI,EAAC,QAAQ;IACbC,OAAO,EAAE;MAAElB;IAAK,CAAE;IAClBmB,EAAE,EAAC,QAAQ;IACXlB,KAAK,EAAEF,UAAW;IAClBqB,YAAY,EAAEX,QAAS;IACvBD,MAAM,EAAGa,CAAC,IAAK;MACbb,MAAM,CAACa,CAAC,CAAC;MACTzB,KAAK,CAACY,MAAM,GAAGa,CAAC,CAAC;IACnB,CAAE;IACFC,SAAS,EAAC,SAAS;IACnBC,YAAY,EAAC;EAAW,EACzB,CAAC;AAEN","ignoreList":[]}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { createContext, useContext } from
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
2
|
export const removeFieldFromSet = (prev, field) => {
|
|
3
3
|
const next = new Set(prev);
|
|
4
|
-
next.delete(
|
|
4
|
+
next.delete("name");
|
|
5
5
|
return next;
|
|
6
6
|
};
|
|
7
7
|
export const CardContext = /*#__PURE__*/createContext({
|
|
8
8
|
values: {
|
|
9
|
-
name:
|
|
10
|
-
number:
|
|
11
|
-
cvc:
|
|
12
|
-
expiry:
|
|
9
|
+
name: "",
|
|
10
|
+
number: "",
|
|
11
|
+
cvc: "",
|
|
12
|
+
expiry: ""
|
|
13
13
|
},
|
|
14
14
|
register: () => ({
|
|
15
15
|
onChange: () => {},
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Card } from
|
|
1
|
+
export { Card } from "./Card";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { validateNumber, validateExpiry, validateCVC } from
|
|
1
|
+
import { validateNumber, validateExpiry, validateCVC } from "@evervault/card-validator";
|
|
2
2
|
export async function changePayload(encrypt, form, fields) {
|
|
3
3
|
const {
|
|
4
4
|
name,
|
|
@@ -6,7 +6,7 @@ export async function changePayload(encrypt, form, fields) {
|
|
|
6
6
|
expiry,
|
|
7
7
|
cvc
|
|
8
8
|
} = form.values;
|
|
9
|
-
const number = rawNumber.replace(/\s/g,
|
|
9
|
+
const number = rawNumber.replace(/\s/g, "");
|
|
10
10
|
const {
|
|
11
11
|
brand,
|
|
12
12
|
localBrands,
|
|
@@ -31,18 +31,18 @@ export async function changePayload(encrypt, form, fields) {
|
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
export function isComplete(form, fields) {
|
|
34
|
-
if (fields.includes(
|
|
34
|
+
if (fields.includes("name")) {
|
|
35
35
|
if (form.values.name.length === 0) return false;
|
|
36
36
|
}
|
|
37
|
-
if (fields.includes(
|
|
37
|
+
if (fields.includes("number")) {
|
|
38
38
|
const cardValidation = validateNumber(form.values.number);
|
|
39
39
|
if (!cardValidation.isValid) return false;
|
|
40
40
|
}
|
|
41
|
-
if (fields.includes(
|
|
41
|
+
if (fields.includes("expiry")) {
|
|
42
42
|
const expiryValidation = validateExpiry(form.values.expiry);
|
|
43
43
|
if (!expiryValidation.isValid) return false;
|
|
44
44
|
}
|
|
45
|
-
if (fields.includes(
|
|
45
|
+
if (fields.includes("cvc")) {
|
|
46
46
|
const cvcValidation = validateCVC(form.values.cvc, form.values.number);
|
|
47
47
|
if (!cvcValidation.isValid) return false;
|
|
48
48
|
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { createContext, useContext, useEffect } from "react";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { EvervaultSdk } from "../native";
|
|
4
|
+
const Ctx = /*#__PURE__*/createContext({
|
|
5
|
+
teamUuid: undefined,
|
|
6
|
+
appUuid: undefined
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
// this isn't publicly exposed
|
|
10
|
+
export const useEvervault = () => useContext(Ctx);
|
|
11
|
+
/**
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* function App() {
|
|
15
|
+
* return (
|
|
16
|
+
* <EvervaultProvider teamId="team_123" appId="app_123">
|
|
17
|
+
* <Card onChange={(card) => console.log(card)}>
|
|
18
|
+
* <Card.Number />
|
|
19
|
+
* </Card>
|
|
20
|
+
* </EvervaultProvider>
|
|
21
|
+
* );
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
const EvervaultProvider = ({
|
|
26
|
+
teamId,
|
|
27
|
+
appId,
|
|
28
|
+
children
|
|
29
|
+
}) => {
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
async function initEvervault() {
|
|
32
|
+
try {
|
|
33
|
+
if (!teamId || !appId) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
return EvervaultSdk.initialize(teamId, appId);
|
|
37
|
+
} catch (error) {
|
|
38
|
+
throw new Error(`Failed to initialize the Evervault SDK ${error}`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (teamId || appId) {
|
|
42
|
+
initEvervault();
|
|
43
|
+
}
|
|
44
|
+
}, [teamId, appId]);
|
|
45
|
+
return /*#__PURE__*/React.createElement(Ctx.Provider, {
|
|
46
|
+
value: {
|
|
47
|
+
teamUuid: teamId,
|
|
48
|
+
appUuid: appId
|
|
49
|
+
}
|
|
50
|
+
}, children);
|
|
51
|
+
};
|
|
52
|
+
export default EvervaultProvider;
|
|
53
|
+
//# sourceMappingURL=EvervaultProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createContext","useContext","useEffect","React","EvervaultSdk","Ctx","teamUuid","undefined","appUuid","useEvervault","EvervaultProvider","teamId","appId","children","initEvervault","initialize","error","Error","createElement","Provider","value"],"sourceRoot":"../../../src","sources":["components/EvervaultProvider.tsx"],"mappings":"AAAA,SAAoBA,aAAa,EAAEC,UAAU,EAAEC,SAAS,QAAQ,OAAO;AACvE,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,YAAY,QAAQ,WAAW;AAOxC,MAAMC,GAAG,gBAAGL,aAAa,CAAmB;EAC1CM,QAAQ,EAAEC,SAAS;EACnBC,OAAO,EAAED;AACX,CAAC,CAAC;;AAEF;AACA,OAAO,MAAME,YAAY,GAAGA,CAAA,KAAMR,UAAU,CAACI,GAAG,CAAC;AAQjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMK,iBAAiB,GAAGA,CAAC;EAAEC,MAAM;EAAEC,KAAK;EAAEC;AAAyB,CAAC,KAAK;EACzEX,SAAS,CAAC,MAAM;IACd,eAAeY,aAAaA,CAAA,EAAG;MAC7B,IAAI;QACF,IAAI,CAACH,MAAM,IAAI,CAACC,KAAK,EAAE;UACrB;QACF;QAEA,OAAOR,YAAY,CAACW,UAAU,CAACJ,MAAM,EAAEC,KAAK,CAAC;MAC/C,CAAC,CAAC,OAAOI,KAAK,EAAE;QACd,MAAM,IAAIC,KAAK,CAAE,0CAAyCD,KAAM,EAAC,CAAC;MACpE;IACF;IAEA,IAAIL,MAAM,IAAIC,KAAK,EAAE;MACnBE,aAAa,CAAC,CAAC;IACjB;EACF,CAAC,EAAE,CAACH,MAAM,EAAEC,KAAK,CAAC,CAAC;EAEnB,oBACET,KAAA,CAAAe,aAAA,CAACb,GAAG,CAACc,QAAQ;IAACC,KAAK,EAAE;MAAEd,QAAQ,EAAEK,MAAM;MAAEH,OAAO,EAAEI;IAAM;EAAE,GACvDC,QACW,CAAC;AAEnB,CAAC;AAED,eAAeH,iBAAiB","ignoreList":[]}
|
package/dist/module/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export { Card } from
|
|
2
|
-
export {
|
|
1
|
+
export { Card } from "./components/Card";
|
|
2
|
+
export { ThreeDSecure, useThreeDSecure } from "./components/3DS";
|
|
3
|
+
export { init, encrypt } from "./sdk";
|
|
4
|
+
export { default as EvervaultProvider } from "./components/EvervaultProvider";
|
|
3
5
|
//# sourceMappingURL=index.js.map
|
package/dist/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Card","init","encrypt"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SAAyBA,IAAI,QAAQ,mBAAmB;AACxD,SAASC,IAAI,EAAEC,OAAO,QAAQ,OAAO","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["Card","ThreeDSecure","useThreeDSecure","init","encrypt","default","EvervaultProvider"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SAAyBA,IAAI,QAAQ,mBAAmB;AACxD,SAASC,YAAY,EAAEC,eAAe,QAAQ,kBAAkB;AAChE,SAASC,IAAI,EAAEC,OAAO,QAAQ,OAAO;AASrC,SAASC,OAAO,IAAIC,iBAAiB,QAAQ,gCAAgC","ignoreList":[]}
|
package/dist/module/native.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { NativeModules, Platform } from
|
|
1
|
+
import { NativeModules, Platform } from "react-native";
|
|
2
2
|
const LINKING_ERROR = `The package '@evervault/evervault-react-native' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
|
|
3
3
|
ios: "- You have run 'pod install'\n",
|
|
4
|
-
default:
|
|
5
|
-
}) +
|
|
4
|
+
default: ""
|
|
5
|
+
}) + "- You rebuilt the app after installing the package\n" + "- You are not using Expo Go\n";
|
|
6
6
|
export const EvervaultSdk = NativeModules.EvervaultSdk ? NativeModules.EvervaultSdk : new Proxy({}, {
|
|
7
7
|
get() {
|
|
8
8
|
throw new Error(LINKING_ERROR);
|
package/dist/module/sdk.js
CHANGED
|
@@ -1,16 +1,24 @@
|
|
|
1
|
-
import { Platform } from
|
|
2
|
-
import { EvervaultSdk } from
|
|
1
|
+
import { Platform } from "react-native";
|
|
2
|
+
import { EvervaultSdk } from "./native";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Deprecated since version 1.1.0. Use `EvervaultProvider` instead.
|
|
6
|
+
* @see `EvervaultProvider` instead
|
|
7
|
+
* ```tsx
|
|
8
|
+
* import { EvervaultProvider } from "@evervault/evervault-react-native";
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
3
11
|
export async function init(teamUuid, appUuid) {
|
|
4
|
-
if (!teamUuid
|
|
12
|
+
if (!teamUuid?.startsWith("team_")) {
|
|
5
13
|
throw new Error("Invalid Evervault Team UUID");
|
|
6
14
|
}
|
|
7
|
-
if (!appUuid
|
|
15
|
+
if (!appUuid?.startsWith("app_")) {
|
|
8
16
|
throw new Error("Invalid Evervault App UUID");
|
|
9
17
|
}
|
|
10
18
|
return EvervaultSdk.initialize(teamUuid, appUuid);
|
|
11
19
|
}
|
|
12
20
|
export async function encrypt(data) {
|
|
13
|
-
if (Platform.OS ===
|
|
21
|
+
if (Platform.OS === "android" && typeof data !== "string") {
|
|
14
22
|
throw new Error(`The Evervault SDK does not currently support encrypting non-string data on Android.
|
|
15
23
|
If this is required for your use case, please get in touch with us at support@evervault.com. Please do not
|
|
16
24
|
serialize other data types to strings and pass them to this method as this will result in the data
|
package/dist/module/sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","EvervaultSdk","init","teamUuid","appUuid","startsWith","Error","initialize","encrypt","data","OS"],"sourceRoot":"../../src","sources":["sdk.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,YAAY,QAAQ,UAAU;
|
|
1
|
+
{"version":3,"names":["Platform","EvervaultSdk","init","teamUuid","appUuid","startsWith","Error","initialize","encrypt","data","OS"],"sourceRoot":"../../src","sources":["sdk.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,YAAY,QAAQ,UAAU;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,IAAIA,CAACC,QAAgB,EAAEC,OAAe,EAAiB;EAC3E,IAAI,CAACD,QAAQ,EAAEE,UAAU,CAAC,OAAO,CAAC,EAAE;IAClC,MAAM,IAAIC,KAAK,CAAC,6BAA6B,CAAC;EAChD;EAEA,IAAI,CAACF,OAAO,EAAEC,UAAU,CAAC,MAAM,CAAC,EAAE;IAChC,MAAM,IAAIC,KAAK,CAAC,4BAA4B,CAAC;EAC/C;EAEA,OAAOL,YAAY,CAACM,UAAU,CAACJ,QAAQ,EAAEC,OAAO,CAAC;AACnD;AAEA,OAAO,eAAeI,OAAOA,CAACC,IAAS,EAAmB;EACxD,IAAIT,QAAQ,CAACU,EAAE,KAAK,SAAS,IAAI,OAAOD,IAAI,KAAK,QAAQ,EAAE;IACzD,MAAM,IAAIH,KAAK,CAAE;AACrB;AACA;AACA,2EAA2E,CAAC;EAC1E;EAEA,OAAOL,YAAY,CAACO,OAAO,CAACC,IAAI,CAAC;AACnC","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ThreeDSecureProviderProps } from "./types";
|
|
3
|
+
import { ThreeDSecureFrame } from "./ThreeDSecureFrame";
|
|
4
|
+
declare const ThreeDSecureNamespace: (({ state, children }: ThreeDSecureProviderProps) => React.JSX.Element | null) & {
|
|
5
|
+
Frame: typeof ThreeDSecureFrame;
|
|
6
|
+
};
|
|
7
|
+
export { ThreeDSecureNamespace as ThreeDSecure };
|
|
8
|
+
//# sourceMappingURL=ThreeDSecure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThreeDSecure.d.ts","sourceRoot":"","sources":["../../../../../src/components/3DS/ThreeDSecure.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAwBxD,QAAA,MAAM,qBAAqB,yBApBgB,yBAAyB;;CAsBlE,CAAC;AAEH,OAAO,EAAE,qBAAqB,IAAI,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThreeDSecureFrame.d.ts","sourceRoot":"","sources":["../../../../../src/components/3DS/ThreeDSecureFrame.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAQpD,wBAAgB,iBAAiB,6BA8BhC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/components/3DS/config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,QAAmD,CAAC;AAC9E,eAAO,MAAM,oBAAoB,QAA0F,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../../src/components/3DS/context.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,mBAAmB,mDAAgD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/3DS/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
declare const defaultModalStyles: {
|
|
2
|
+
modalContainer: {
|
|
3
|
+
flex: number;
|
|
4
|
+
justifyContent: "flex-end";
|
|
5
|
+
backgroundColor: string;
|
|
6
|
+
};
|
|
7
|
+
modalContent: {
|
|
8
|
+
width: "100%";
|
|
9
|
+
height: "95%";
|
|
10
|
+
backgroundColor: string;
|
|
11
|
+
padding: number;
|
|
12
|
+
justifyContent: "flex-start";
|
|
13
|
+
borderTopLeftRadius: number;
|
|
14
|
+
borderTopRightRadius: number;
|
|
15
|
+
};
|
|
16
|
+
titleBar: {
|
|
17
|
+
justifyContent: "center";
|
|
18
|
+
alignItems: "center";
|
|
19
|
+
padding: number;
|
|
20
|
+
backgroundColor: string;
|
|
21
|
+
borderBottomWidth: number;
|
|
22
|
+
borderBottomColor: string;
|
|
23
|
+
position: "relative";
|
|
24
|
+
width: "100%";
|
|
25
|
+
borderTopLeftRadius: number;
|
|
26
|
+
borderTopRightRadius: number;
|
|
27
|
+
};
|
|
28
|
+
titleText: {
|
|
29
|
+
fontSize: number;
|
|
30
|
+
fontWeight: "bold";
|
|
31
|
+
};
|
|
32
|
+
closeButton: {
|
|
33
|
+
position: "absolute";
|
|
34
|
+
left: number;
|
|
35
|
+
padding: number;
|
|
36
|
+
};
|
|
37
|
+
closeButtonText: {
|
|
38
|
+
fontSize: number;
|
|
39
|
+
fontWeight: "bold";
|
|
40
|
+
color: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
declare const defaultThreeDSecureFrameStyles: {
|
|
44
|
+
threeDSFrame: {
|
|
45
|
+
flex: number;
|
|
46
|
+
};
|
|
47
|
+
webView: {
|
|
48
|
+
flex: number;
|
|
49
|
+
};
|
|
50
|
+
spinnerOverlay: {
|
|
51
|
+
flex: number;
|
|
52
|
+
justifyContent: "center";
|
|
53
|
+
alignItems: "center";
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
export { defaultModalStyles, defaultThreeDSecureFrameStyles };
|
|
57
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/3DS/styles.tsx"],"names":[],"mappings":"AAEA,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyCtB,CAAC;AAEH,QAAA,MAAM,8BAA8B;;;;;;;;;;;;CAYlC,CAAC;AAEH,OAAO,EACH,kBAAkB,EAClB,8BAA8B,EACjC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
/// <reference types="node" />
|
|
4
|
+
/// <reference types="node" />
|
|
5
|
+
/// <reference types="node" />
|
|
6
|
+
import { ThreeDSecureCallbacks, ThreeDSecureSessionsParams, ThreeDSecureSession } from "./types";
|
|
7
|
+
export declare const startSession: (session: ThreeDSecureSession, callbacks: ThreeDSecureCallbacks, intervalRef: React.MutableRefObject<NodeJS.Timeout | null>, setIsVisible: (show: boolean) => void) => Promise<void>;
|
|
8
|
+
export declare const pollSession: (session: ThreeDSecureSession, callbacks: ThreeDSecureCallbacks, intervalRef: React.MutableRefObject<NodeJS.Timeout | null>, setIsVisible: (show: boolean) => void, interval?: number) => void;
|
|
9
|
+
export declare function threeDSecureSession({ sessionId, appId, callbacks, intervalRef, setIsVisible, }: ThreeDSecureSessionsParams): ThreeDSecureSession;
|
|
10
|
+
//# sourceMappingURL=threeDSSession.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"threeDSSession.d.ts","sourceRoot":"","sources":["../../../../../src/components/3DS/threeDSSession.ts"],"names":[],"mappings":";;;;;AAAA,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EAEpB,MAAM,SAAS,CAAC;AAYjB,eAAO,MAAM,YAAY,YACd,mBAAmB,aACjB,qBAAqB,eACnB,MAAM,gBAAgB,CAAC,OAAO,OAAO,GAAG,IAAI,CAAC,gBAC5C,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,kBAyBtC,CAAC;AAEF,eAAO,MAAM,WAAW,YACb,mBAAmB,aACjB,qBAAqB,eACnB,MAAM,gBAAgB,CAAC,OAAO,OAAO,GAAG,IAAI,CAAC,gBAC5C,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,aAC3B,MAAM,SAoBjB,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,EAClC,SAAS,EACT,KAAK,EACL,SAAS,EACT,WAAW,EACX,YAAY,GACb,EAAE,0BAA0B,GAAG,mBAAmB,CAkDlD"}
|