@test-glide/payment-react-native 0.1.2 → 0.1.4
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 +1 -1
- package/lib/module/components/BivoCVCInput.js +21 -28
- package/lib/module/components/BivoCVCInput.js.map +1 -1
- package/lib/module/components/BivoCardInput.js +27 -34
- package/lib/module/components/BivoCardInput.js.map +1 -1
- package/lib/module/components/BivoTextInput.js +22 -29
- package/lib/module/components/BivoTextInput.js.map +1 -1
- package/lib/module/core/{Collector.js → BivoSecureStore.js} +40 -27
- package/lib/module/core/BivoSecureStore.js.map +1 -0
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/components/BivoCVCInput.d.ts +4 -4
- package/lib/typescript/src/components/BivoCVCInput.d.ts.map +1 -1
- package/lib/typescript/src/components/BivoCardInput.d.ts +4 -4
- package/lib/typescript/src/components/BivoCardInput.d.ts.map +1 -1
- package/lib/typescript/src/components/BivoTextInput.d.ts +4 -4
- package/lib/typescript/src/components/BivoTextInput.d.ts.map +1 -1
- package/lib/typescript/src/core/{Collector.d.ts → BivoSecureStore.d.ts} +5 -13
- package/lib/typescript/src/core/BivoSecureStore.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/BivoCVCInput.tsx +41 -26
- package/src/components/BivoCardInput.tsx +60 -38
- package/src/components/BivoTextInput.tsx +80 -66
- package/src/core/BivoSecureStore.ts +164 -0
- package/src/index.ts +1 -1
- package/lib/module/core/Collector.js.map +0 -1
- package/lib/typescript/src/core/Collector.d.ts.map +0 -1
- package/src/core/Collector.ts +0 -130
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ npm install @bivo/payment-react-native
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
```js
|
|
17
|
-
import {
|
|
17
|
+
import { BivoSecureStore, BivoTextInput, BivoCardInput, BivoCVCInput } from '@bivo/payment-react-native';
|
|
18
18
|
|
|
19
19
|
```
|
|
20
20
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React, { useState } from
|
|
4
|
-
import { View, TextInput, Text, StyleSheet, Image } from
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
import { View, TextInput, Text, StyleSheet, Image } from 'react-native';
|
|
5
5
|
import { Icons } from "../assets/index.js";
|
|
6
|
-
import { jsx as _jsx,
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
7
|
export const BivoCVCInput = ({
|
|
8
|
-
|
|
8
|
+
bivoStore,
|
|
9
9
|
fieldName,
|
|
10
10
|
placeholder,
|
|
11
11
|
onStateChange,
|
|
@@ -15,15 +15,15 @@ export const BivoCVCInput = ({
|
|
|
15
15
|
containerStyle,
|
|
16
16
|
textStyle
|
|
17
17
|
}) => {
|
|
18
|
-
const [value, setValue] = useState(
|
|
18
|
+
const [value, setValue] = useState('');
|
|
19
19
|
const handleChange = text => {
|
|
20
20
|
setValue(text);
|
|
21
|
-
|
|
21
|
+
bivoStore.setField(fieldName, text, onStateChange, required, regex, errorMsg);
|
|
22
22
|
};
|
|
23
23
|
const handleBlur = () => {
|
|
24
|
-
|
|
24
|
+
bivoStore.setField(fieldName, value, onStateChange, required, regex, errorMsg);
|
|
25
25
|
};
|
|
26
|
-
const error =
|
|
26
|
+
const error = bivoStore.errors[fieldName];
|
|
27
27
|
return /*#__PURE__*/_jsxs(View, {
|
|
28
28
|
style: [styles.container, containerStyle],
|
|
29
29
|
children: [/*#__PURE__*/_jsx(TextInput, {
|
|
@@ -34,24 +34,17 @@ export const BivoCVCInput = ({
|
|
|
34
34
|
secureTextEntry: true,
|
|
35
35
|
keyboardType: "number-pad",
|
|
36
36
|
style: [styles.input, textStyle, error ? {
|
|
37
|
-
borderColor:
|
|
37
|
+
borderColor: 'red'
|
|
38
38
|
} : {}]
|
|
39
|
-
}), /*#__PURE__*/
|
|
39
|
+
}), error && /*#__PURE__*/_jsxs(View, {
|
|
40
40
|
style: styles.errorContainer,
|
|
41
|
-
children:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
})]
|
|
49
|
-
}) : /*#__PURE__*/_jsx(Text, {
|
|
50
|
-
style: [styles.error, {
|
|
51
|
-
opacity: 0
|
|
52
|
-
}],
|
|
53
|
-
children: "placeholder"
|
|
54
|
-
})
|
|
41
|
+
children: [/*#__PURE__*/_jsx(Image, {
|
|
42
|
+
source: Icons.alert,
|
|
43
|
+
style: styles.errorIcon
|
|
44
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
45
|
+
style: styles.error,
|
|
46
|
+
children: error
|
|
47
|
+
})]
|
|
55
48
|
})]
|
|
56
49
|
});
|
|
57
50
|
};
|
|
@@ -61,13 +54,13 @@ const styles = StyleSheet.create({
|
|
|
61
54
|
},
|
|
62
55
|
input: {
|
|
63
56
|
borderWidth: 1,
|
|
64
|
-
borderColor:
|
|
57
|
+
borderColor: '#ccc',
|
|
65
58
|
borderRadius: 6,
|
|
66
59
|
padding: 10
|
|
67
60
|
},
|
|
68
61
|
errorContainer: {
|
|
69
|
-
flexDirection:
|
|
70
|
-
alignItems:
|
|
62
|
+
flexDirection: 'row',
|
|
63
|
+
alignItems: 'center',
|
|
71
64
|
marginTop: 4,
|
|
72
65
|
minHeight: 12
|
|
73
66
|
},
|
|
@@ -77,7 +70,7 @@ const styles = StyleSheet.create({
|
|
|
77
70
|
marginRight: 4
|
|
78
71
|
},
|
|
79
72
|
error: {
|
|
80
|
-
color:
|
|
73
|
+
color: 'red',
|
|
81
74
|
fontSize: 12
|
|
82
75
|
}
|
|
83
76
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useState","View","TextInput","Text","StyleSheet","Image","Icons","jsx","_jsx","
|
|
1
|
+
{"version":3,"names":["React","useState","View","TextInput","Text","StyleSheet","Image","Icons","jsx","_jsx","jsxs","_jsxs","BivoCVCInput","bivoStore","fieldName","placeholder","onStateChange","required","regex","errorMsg","containerStyle","textStyle","value","setValue","handleChange","text","setField","handleBlur","error","errors","style","styles","container","children","onChangeText","onBlur","secureTextEntry","keyboardType","input","borderColor","errorContainer","source","alert","errorIcon","create","marginVertical","borderWidth","borderRadius","padding","flexDirection","alignItems","marginTop","minHeight","width","height","marginRight","color","fontSize"],"sourceRoot":"../../../src","sources":["components/BivoCVCInput.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,IAAI,EAAEC,SAAS,EAAEC,IAAI,EAAEC,UAAU,EAAEC,KAAK,QAAQ,cAAc;AAGvE,SAASC,KAAK,QAAQ,oBAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAclC,OAAO,MAAMC,YAA6B,GAAGA,CAAC;EAC5CC,SAAS;EACTC,SAAS;EACTC,WAAW;EACXC,aAAa;EACbC,QAAQ;EACRC,KAAK;EACLC,QAAQ;EACRC,cAAc;EACdC;AACF,CAAC,KAAK;EACJ,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGtB,QAAQ,CAAC,EAAE,CAAC;EAEtC,MAAMuB,YAAY,GAAIC,IAAY,IAAK;IACrCF,QAAQ,CAACE,IAAI,CAAC;IACdZ,SAAS,CAACa,QAAQ,CAChBZ,SAAS,EACTW,IAAI,EACJT,aAAa,EACbC,QAAQ,EACRC,KAAK,EACLC,QACF,CAAC;EACH,CAAC;EAED,MAAMQ,UAAU,GAAGA,CAAA,KAAM;IACvBd,SAAS,CAACa,QAAQ,CAChBZ,SAAS,EACTQ,KAAK,EACLN,aAAa,EACbC,QAAQ,EACRC,KAAK,EACLC,QACF,CAAC;EACH,CAAC;EAED,MAAMS,KAAK,GAAGf,SAAS,CAACgB,MAAM,CAACf,SAAS,CAAC;EAEzC,o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CAAC;EACpD3B,KAAK,EAAE;IAAE4B,KAAK,EAAE,KAAK;IAAEC,QAAQ,EAAE;EAAG;AACtC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React, { useState } from
|
|
4
|
-
import { View, TextInput, Image, Text, StyleSheet } from
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
import { View, TextInput, Image, Text, StyleSheet } from 'react-native';
|
|
5
5
|
import { Icons } from "../assets/index.js";
|
|
6
6
|
import { formatCardNumber } from "../utils/utils.js";
|
|
7
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
8
|
const cardIcons = {
|
|
9
9
|
visa: Icons.visa,
|
|
10
10
|
mastercard: Icons.mastercard,
|
|
@@ -13,7 +13,7 @@ const cardIcons = {
|
|
|
13
13
|
unknown: Icons.card
|
|
14
14
|
};
|
|
15
15
|
export const BivoCardInput = ({
|
|
16
|
-
|
|
16
|
+
bivoStore,
|
|
17
17
|
fieldName,
|
|
18
18
|
placeholder,
|
|
19
19
|
onStateChange,
|
|
@@ -23,20 +23,20 @@ export const BivoCardInput = ({
|
|
|
23
23
|
containerStyle,
|
|
24
24
|
textStyle
|
|
25
25
|
}) => {
|
|
26
|
-
const [value, setValue] = useState(
|
|
27
|
-
const [cardType, setCardType] = useState(
|
|
26
|
+
const [value, setValue] = useState('');
|
|
27
|
+
const [cardType, setCardType] = useState('unknown'); //cardType
|
|
28
28
|
|
|
29
29
|
const handleChange = text => {
|
|
30
30
|
const formatted = formatCardNumber(text);
|
|
31
31
|
setValue(formatted);
|
|
32
|
-
const cleaned = text.replace(/\D/g,
|
|
33
|
-
if (/^4/.test(cleaned)) setCardType(
|
|
34
|
-
|
|
32
|
+
const cleaned = text.replace(/\D/g, '');
|
|
33
|
+
if (/^4/.test(cleaned)) setCardType('visa');else if (/^5[1-5]/.test(cleaned)) setCardType('mastercard');else if (/^3[47]/.test(cleaned)) setCardType('amex');else if (/^6(?:011|5)/.test(cleaned)) setCardType('discover');else setCardType('unknown');
|
|
34
|
+
bivoStore.setField(fieldName, text, onStateChange, required, regex, errorMsg);
|
|
35
35
|
};
|
|
36
36
|
const handleBlur = () => {
|
|
37
|
-
|
|
37
|
+
bivoStore.setField(fieldName, value, onStateChange, required, regex, errorMsg);
|
|
38
38
|
};
|
|
39
|
-
const error =
|
|
39
|
+
const error = bivoStore.errors[fieldName];
|
|
40
40
|
return /*#__PURE__*/_jsxs(View, {
|
|
41
41
|
style: [styles.container, containerStyle],
|
|
42
42
|
children: [/*#__PURE__*/_jsxs(View, {
|
|
@@ -51,25 +51,18 @@ export const BivoCardInput = ({
|
|
|
51
51
|
placeholder: placeholder,
|
|
52
52
|
keyboardType: "number-pad",
|
|
53
53
|
style: [styles.input, textStyle, error ? {
|
|
54
|
-
borderColor:
|
|
54
|
+
borderColor: 'red'
|
|
55
55
|
} : {}]
|
|
56
56
|
})]
|
|
57
|
-
}), /*#__PURE__*/
|
|
57
|
+
}), error && /*#__PURE__*/_jsxs(View, {
|
|
58
58
|
style: styles.errorContainer,
|
|
59
|
-
children:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
})]
|
|
67
|
-
}) : /*#__PURE__*/_jsx(Text, {
|
|
68
|
-
style: [styles.error, {
|
|
69
|
-
opacity: 0
|
|
70
|
-
}],
|
|
71
|
-
children: "placeholder"
|
|
72
|
-
})
|
|
59
|
+
children: [/*#__PURE__*/_jsx(Image, {
|
|
60
|
+
source: Icons.alert,
|
|
61
|
+
style: styles.errorIcon
|
|
62
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
63
|
+
style: styles.error,
|
|
64
|
+
children: error
|
|
65
|
+
})]
|
|
73
66
|
})]
|
|
74
67
|
});
|
|
75
68
|
};
|
|
@@ -78,25 +71,25 @@ const styles = StyleSheet.create({
|
|
|
78
71
|
marginVertical: 8
|
|
79
72
|
},
|
|
80
73
|
row: {
|
|
81
|
-
flexDirection:
|
|
82
|
-
alignItems:
|
|
74
|
+
flexDirection: 'row',
|
|
75
|
+
alignItems: 'center'
|
|
83
76
|
},
|
|
84
77
|
input: {
|
|
85
78
|
flex: 1,
|
|
86
79
|
borderWidth: 1,
|
|
87
|
-
borderColor:
|
|
80
|
+
borderColor: '#ccc',
|
|
88
81
|
borderRadius: 6,
|
|
89
82
|
padding: 10
|
|
90
83
|
},
|
|
91
84
|
icon: {
|
|
92
85
|
width: 40,
|
|
93
86
|
height: 25,
|
|
94
|
-
resizeMode:
|
|
87
|
+
resizeMode: 'contain',
|
|
95
88
|
marginRight: 8
|
|
96
89
|
},
|
|
97
90
|
errorContainer: {
|
|
98
|
-
flexDirection:
|
|
99
|
-
alignItems:
|
|
91
|
+
flexDirection: 'row',
|
|
92
|
+
alignItems: 'center',
|
|
100
93
|
marginLeft: 40,
|
|
101
94
|
marginTop: 4,
|
|
102
95
|
minHeight: 12
|
|
@@ -107,7 +100,7 @@ const styles = StyleSheet.create({
|
|
|
107
100
|
marginRight: 4
|
|
108
101
|
},
|
|
109
102
|
error: {
|
|
110
|
-
color:
|
|
103
|
+
color: 'red',
|
|
111
104
|
fontSize: 12
|
|
112
105
|
}
|
|
113
106
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useState","View","TextInput","Image","Text","StyleSheet","Icons","formatCardNumber","jsx","_jsx","jsxs","_jsxs","
|
|
1
|
+
{"version":3,"names":["React","useState","View","TextInput","Image","Text","StyleSheet","Icons","formatCardNumber","jsx","_jsx","jsxs","_jsxs","cardIcons","visa","mastercard","amex","discover","unknown","card","BivoCardInput","bivoStore","fieldName","placeholder","onStateChange","required","regex","errorMsg","containerStyle","textStyle","value","setValue","cardType","setCardType","handleChange","text","formatted","cleaned","replace","test","setField","handleBlur","error","errors","style","styles","container","children","row","source","icon","onChangeText","onBlur","keyboardType","input","borderColor","errorContainer","alert","errorIcon","create","marginVertical","flexDirection","alignItems","flex","borderWidth","borderRadius","padding","width","height","resizeMode","marginRight","marginLeft","marginTop","minHeight","color","fontSize"],"sourceRoot":"../../../src","sources":["components/BivoCardInput.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,IAAI,EAAEC,SAAS,EAAEC,KAAK,EAAEC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAGvE,SAASC,KAAK,QAAQ,oBAAW;AACjC,SAASC,gBAAgB,QAAQ,mBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAclD,MAAMC,SAAc,GAAG;EACrBC,IAAI,EAAEP,KAAK,CAACO,IAAI;EAChBC,UAAU,EAAER,KAAK,CAACQ,UAAU;EAC5BC,IAAI,EAAET,KAAK,CAACS,IAAI;EAChBC,QAAQ,EAAEV,KAAK,CAACU,QAAQ;EACxBC,OAAO,EAAEX,KAAK,CAACY;AACjB,CAAC;AAED,OAAO,MAAMC,aAA8B,GAAGA,CAAC;EAC7CC,SAAS;EACTC,SAAS;EACTC,WAAW;EACXC,aAAa;EACbC,QAAQ;EACRC,KAAK;EACLC,QAAQ;EACRC,cAAc;EACdC;AACF,CAAC,KAAK;EACJ,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAG9B,QAAQ,CAAC,EAAE,CAAC;EACtC,MAAM,CAAC+B,QAAQ,EAAEC,WAAW,CAAC,GAAGhC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;;EAErD,MAAMiC,YAAY,GAAIC,IAAY,IAAK;IACrC,MAAMC,SAAS,GAAG5B,gBAAgB,CAAC2B,IAAI,CAAC;IACxCJ,QAAQ,CAACK,SAAS,CAAC;IACnB,MAAMC,OAAO,GAAGF,IAAI,CAACG,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;IACvC,IAAI,IAAI,CAACC,IAA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,EAAE;EAAG;AACtC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React, { useState } from
|
|
4
|
-
import { View, TextInput, Text, StyleSheet, Image } from
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
import { View, TextInput, Text, StyleSheet, Image } from 'react-native';
|
|
5
5
|
import { Icons } from "../assets/index.js";
|
|
6
6
|
import { formatExpiry } from "../utils/utils.js";
|
|
7
|
-
import { jsx as _jsx,
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
8
|
export const BivoTextInput = ({
|
|
9
|
-
|
|
9
|
+
bivoStore,
|
|
10
10
|
fieldName,
|
|
11
11
|
placeholder,
|
|
12
12
|
onStateChange,
|
|
@@ -16,21 +16,21 @@ export const BivoTextInput = ({
|
|
|
16
16
|
containerStyle,
|
|
17
17
|
textStyle
|
|
18
18
|
}) => {
|
|
19
|
-
const [value, setValue] = useState(
|
|
19
|
+
const [value, setValue] = useState('');
|
|
20
20
|
const handleChange = text => {
|
|
21
21
|
let updatedValue;
|
|
22
|
-
if (fieldName ===
|
|
22
|
+
if (fieldName === 'exp') {
|
|
23
23
|
updatedValue = formatExpiry(text);
|
|
24
24
|
} else {
|
|
25
25
|
updatedValue = text;
|
|
26
26
|
}
|
|
27
27
|
setValue(updatedValue);
|
|
28
|
-
|
|
28
|
+
bivoStore.setField(fieldName, updatedValue, onStateChange, required, regex, errorMsg);
|
|
29
29
|
};
|
|
30
30
|
const handleBlur = () => {
|
|
31
|
-
|
|
31
|
+
bivoStore.setField(fieldName, value, onStateChange, required, regex, errorMsg);
|
|
32
32
|
};
|
|
33
|
-
const error =
|
|
33
|
+
const error = bivoStore.errors[fieldName];
|
|
34
34
|
return /*#__PURE__*/_jsxs(View, {
|
|
35
35
|
style: [styles.container, containerStyle],
|
|
36
36
|
children: [/*#__PURE__*/_jsx(TextInput, {
|
|
@@ -39,24 +39,17 @@ export const BivoTextInput = ({
|
|
|
39
39
|
onBlur: handleBlur,
|
|
40
40
|
placeholder: placeholder,
|
|
41
41
|
style: [styles.input, textStyle, error ? {
|
|
42
|
-
borderColor:
|
|
42
|
+
borderColor: 'red'
|
|
43
43
|
} : {}]
|
|
44
|
-
}), /*#__PURE__*/
|
|
44
|
+
}), error && /*#__PURE__*/_jsxs(View, {
|
|
45
45
|
style: styles.errorContainer,
|
|
46
|
-
children:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
})]
|
|
54
|
-
}) : /*#__PURE__*/_jsx(Text, {
|
|
55
|
-
style: [styles.error, {
|
|
56
|
-
opacity: 0
|
|
57
|
-
}],
|
|
58
|
-
children: "placeholder"
|
|
59
|
-
})
|
|
46
|
+
children: [/*#__PURE__*/_jsx(Image, {
|
|
47
|
+
source: Icons.alert,
|
|
48
|
+
style: styles.errorIcon
|
|
49
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
50
|
+
style: styles.error,
|
|
51
|
+
children: error
|
|
52
|
+
})]
|
|
60
53
|
})]
|
|
61
54
|
});
|
|
62
55
|
};
|
|
@@ -66,13 +59,13 @@ const styles = StyleSheet.create({
|
|
|
66
59
|
},
|
|
67
60
|
input: {
|
|
68
61
|
borderWidth: 1,
|
|
69
|
-
borderColor:
|
|
62
|
+
borderColor: '#ccc',
|
|
70
63
|
borderRadius: 6,
|
|
71
64
|
padding: 10
|
|
72
65
|
},
|
|
73
66
|
errorContainer: {
|
|
74
|
-
flexDirection:
|
|
75
|
-
alignItems:
|
|
67
|
+
flexDirection: 'row',
|
|
68
|
+
alignItems: 'center',
|
|
76
69
|
marginTop: 4,
|
|
77
70
|
minHeight: 12
|
|
78
71
|
},
|
|
@@ -82,7 +75,7 @@ const styles = StyleSheet.create({
|
|
|
82
75
|
marginRight: 4
|
|
83
76
|
},
|
|
84
77
|
error: {
|
|
85
|
-
color:
|
|
78
|
+
color: 'red',
|
|
86
79
|
fontSize: 12
|
|
87
80
|
}
|
|
88
81
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useState","View","TextInput","Text","StyleSheet","Image","Icons","formatExpiry","jsx","_jsx","
|
|
1
|
+
{"version":3,"names":["React","useState","View","TextInput","Text","StyleSheet","Image","Icons","formatExpiry","jsx","_jsx","jsxs","_jsxs","BivoTextInput","bivoStore","fieldName","placeholder","onStateChange","required","regex","errorMsg","containerStyle","textStyle","value","setValue","handleChange","text","updatedValue","setField","handleBlur","error","errors","style","styles","container","children","onChangeText","onBlur","input","borderColor","errorContainer","source","alert","errorIcon","create","marginVertical","borderWidth","borderRadius","padding","flexDirection","alignItems","marginTop","minHeight","width","height","marginRight","color","fontSize"],"sourceRoot":"../../../src","sources":["components/BivoTextInput.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,IAAI,EAAEC,SAAS,EAAEC,IAAI,EAAEC,UAAU,EAAEC,KAAK,QAAQ,cAAc;AAGvE,SAASC,KAAK,QAAQ,oBAAW;AACjC,SAASC,YAAY,QAAQ,mBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAc9C,OAAO,MAAMC,aAA8B,GAAGA,CAAC;EAC7CC,SAAS;EACTC,SAAS;EACTC,WAAW;EACXC,aAAa;EACbC,QAAQ;EACRC,KAAK;EACLC,QAAQ;EACRC,cAAc;EACdC;AACF,CAAC,KAAK;EACJ,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGvB,QAAQ,CAAC,EAAE,CAAC;EAEtC,MAAMwB,YAAY,GAAIC,IAAY,IAAK;IACrC,IAAIC,YAAY;IAChB,IAAIZ,SAAS,KAAK,KAAK,EAAE;MACvBY,YAAY,GAAGnB,YAAY,CAACkB,IAAI,CAAC;IACnC,CAAC,MAAM;MACLC,YAAY,GAAGD,IAAI;IACrB;IAC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AE;IAAEQ,WAAW,EAAE,CAAC;IAAEP,WAAW,EAAE,MAAM;IAAEQ,YAAY,EAAE,CAAC;IAAEC,OAAO,EAAE;EAAG,CAAC;EAC5ER,cAAc,EAAE;IACdS,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,SAAS,EAAE,CAAC;IACZC,SAAS,EAAE;EACb,CAAC;EACDT,SAAS,EAAE;IAAEU,KAAK,EAAE,EAAE;IAAEC,MAAM,EAAE,EAAE;IAAEC,WAAW,EAAE;EAAE,CAAC;EACpDzB,KAAK,EAAE;IAAE0B,KAAK,EAAE,KAAK;IAAEC,QAAQ,EAAE;EAAG;AACtC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { fetchData } from "../utils/fetch.js";
|
|
4
4
|
import { formatCardYear, formatString } from "../utils/utils.js";
|
|
5
|
-
export class
|
|
5
|
+
export class BivoSecureStore {
|
|
6
6
|
form = {};
|
|
7
7
|
errors = {};
|
|
8
8
|
fieldConfig = {};
|
|
@@ -12,13 +12,24 @@ export class BivoCollect {
|
|
|
12
12
|
}
|
|
13
13
|
setField(fieldName, value, onStateChange, required = false, regex, errorMsg) {
|
|
14
14
|
this.form[fieldName] = value;
|
|
15
|
+
// convert string regex to RegExp
|
|
16
|
+
let parsedRegex = undefined;
|
|
17
|
+
if (typeof regex === 'string') {
|
|
18
|
+
try {
|
|
19
|
+
parsedRegex = new RegExp(regex);
|
|
20
|
+
} catch (e) {
|
|
21
|
+
console.error('Invalid regex:', regex, e);
|
|
22
|
+
}
|
|
23
|
+
} else {
|
|
24
|
+
parsedRegex = regex;
|
|
25
|
+
}
|
|
15
26
|
this.fieldConfig[fieldName] = {
|
|
16
27
|
required,
|
|
17
|
-
regex,
|
|
28
|
+
regex: parsedRegex,
|
|
18
29
|
errorMsg
|
|
19
30
|
};
|
|
20
|
-
const error = this.validateField(fieldName, value, required,
|
|
21
|
-
this.errors[fieldName] = error ||
|
|
31
|
+
const error = this.validateField(fieldName, value, required, parsedRegex, errorMsg);
|
|
32
|
+
this.errors[fieldName] = error || '';
|
|
22
33
|
onStateChange?.({
|
|
23
34
|
value,
|
|
24
35
|
error
|
|
@@ -28,45 +39,45 @@ export class BivoCollect {
|
|
|
28
39
|
const trimmedValue = value?.trim();
|
|
29
40
|
|
|
30
41
|
// Required check
|
|
31
|
-
if (!trimmedValue && required) return
|
|
42
|
+
if (!trimmedValue && required) return 'Required';
|
|
32
43
|
|
|
33
44
|
// If custom regex is provided → use it first
|
|
34
45
|
if (regex && trimmedValue) {
|
|
35
46
|
if (!regex.test(trimmedValue)) {
|
|
36
|
-
return errorMsg ||
|
|
47
|
+
return errorMsg || 'Invalid value';
|
|
37
48
|
}
|
|
38
|
-
return
|
|
49
|
+
return '';
|
|
39
50
|
}
|
|
40
51
|
|
|
41
52
|
// Default validations
|
|
42
53
|
switch (fieldName) {
|
|
43
|
-
case
|
|
54
|
+
case 'card':
|
|
44
55
|
{
|
|
45
|
-
const digits = trimmedValue.replace(/\D/g,
|
|
46
|
-
if (digits.length < 12) return
|
|
56
|
+
const digits = trimmedValue.replace(/\D/g, '');
|
|
57
|
+
if (digits.length < 12) return 'Invalid card number';
|
|
47
58
|
break;
|
|
48
59
|
}
|
|
49
|
-
case
|
|
60
|
+
case 'cvv':
|
|
50
61
|
{
|
|
51
62
|
if (!/^\d{3,4}$/.test(trimmedValue)) {
|
|
52
|
-
return
|
|
63
|
+
return 'Invalid CVV';
|
|
53
64
|
}
|
|
54
65
|
break;
|
|
55
66
|
}
|
|
56
|
-
case
|
|
67
|
+
case 'exp':
|
|
57
68
|
{
|
|
58
69
|
// Format check MM/YY
|
|
59
70
|
if (!/^\d{2}\/\d{2}$/.test(trimmedValue)) {
|
|
60
|
-
return
|
|
71
|
+
return 'Invalid expiry';
|
|
61
72
|
}
|
|
62
|
-
const [monthStr, yearStr] = trimmedValue.split(
|
|
73
|
+
const [monthStr, yearStr] = trimmedValue.split('/');
|
|
63
74
|
if (!monthStr || !yearStr) {
|
|
64
|
-
return
|
|
75
|
+
return 'Invalid expiry';
|
|
65
76
|
}
|
|
66
77
|
const month = parseInt(monthStr, 10);
|
|
67
78
|
const year = parseInt(yearStr, 10);
|
|
68
79
|
if (month < 1 || month > 12) {
|
|
69
|
-
return
|
|
80
|
+
return 'Invalid month';
|
|
70
81
|
}
|
|
71
82
|
|
|
72
83
|
// Convert YY → YYYY (assume 2000-2099)
|
|
@@ -77,32 +88,32 @@ export class BivoCollect {
|
|
|
77
88
|
|
|
78
89
|
// Expiry check
|
|
79
90
|
if (fullYear < currentYear || fullYear === currentYear && month < currentMonth) {
|
|
80
|
-
return
|
|
91
|
+
return 'Card expired';
|
|
81
92
|
}
|
|
82
93
|
break;
|
|
83
94
|
}
|
|
84
95
|
}
|
|
85
|
-
return
|
|
96
|
+
return '';
|
|
86
97
|
}
|
|
87
98
|
isSubmitDisabled(fieldNames) {
|
|
88
99
|
return fieldNames.some(fieldName => {
|
|
89
|
-
const value = this.form[fieldName]?.trim() ??
|
|
100
|
+
const value = this.form[fieldName]?.trim() ?? '';
|
|
90
101
|
const error = this.errors[fieldName];
|
|
91
102
|
return !value || !!error;
|
|
92
103
|
});
|
|
93
104
|
}
|
|
94
105
|
async submit(endpoint, token) {
|
|
95
106
|
// console.log("Submitting form:", this.form, this.errors);
|
|
96
|
-
const expiry = this.form.expiryDate?.split(
|
|
107
|
+
const expiry = this.form.expiryDate?.split('/') || [];
|
|
97
108
|
|
|
98
109
|
// Replace fetchData with your API call
|
|
99
110
|
const response = await fetchData(endpoint, {
|
|
100
|
-
method:
|
|
111
|
+
method: 'POST',
|
|
101
112
|
body: {
|
|
102
113
|
token,
|
|
103
|
-
pan: formatString(this.form.cardNumber ||
|
|
114
|
+
pan: formatString(this.form.cardNumber || ''),
|
|
104
115
|
expiry_month: Number(expiry[0] || 0) || null,
|
|
105
|
-
expiry_year: formatCardYear(expiry[1] ||
|
|
116
|
+
expiry_year: formatCardYear(expiry[1] || '') || null,
|
|
106
117
|
cvv: this.form.cvc ? formatString(this.form.cvc) : null,
|
|
107
118
|
address: {
|
|
108
119
|
postal_code: this.form.zipCode ? formatString(this.form.zipCode) : null
|
|
@@ -112,15 +123,17 @@ export class BivoCollect {
|
|
|
112
123
|
if (response.error) {
|
|
113
124
|
return {
|
|
114
125
|
success: false,
|
|
115
|
-
error: response.error
|
|
126
|
+
error: response.error,
|
|
127
|
+
data: response
|
|
116
128
|
};
|
|
117
129
|
} else {
|
|
118
130
|
return {
|
|
119
131
|
success: true,
|
|
120
|
-
data: response.data
|
|
132
|
+
data: response.data,
|
|
133
|
+
info: response
|
|
121
134
|
};
|
|
122
135
|
}
|
|
123
136
|
// return response.json();
|
|
124
137
|
}
|
|
125
138
|
}
|
|
126
|
-
//# sourceMappingURL=
|
|
139
|
+
//# sourceMappingURL=BivoSecureStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["fetchData","formatCardYear","formatString","BivoSecureStore","form","errors","fieldConfig","constructor","vaultId","environment","setField","fieldName","value","onStateChange","required","regex","errorMsg","parsedRegex","undefined","RegExp","e","console","error","validateField","trimmedValue","trim","test","digits","replace","length","monthStr","yearStr","split","month","parseInt","year","fullYear","now","Date","currentMonth","getMonth","currentYear","getFullYear","isSubmitDisabled","fieldNames","some","submit","endpoint","token","expiry","expiryDate","response","method","body","pan","cardNumber","expiry_month","Number","expiry_year","cvv","cvc","address","postal_code","zipCode","success","data","info"],"sourceRoot":"../../../src","sources":["core/BivoSecureStore.ts"],"mappings":";;AAAA,SAASA,SAAS,QAAQ,mBAAgB;AAC1C,SAASC,cAAc,EAAEC,YAAY,QAAQ,mBAAgB;AAI7D,OAAO,MAAMC,eAAe,CAAC;EAG3BC,IAAI,GAA2B,CAAC,CAAC;EACjCC,MAAM,GAA2B,CAAC,CAAC;EACnCC,WAAW,GAGP,CAAC,CAAC;EAENC,WAAWA,CAACC,OAAe,EAAEC,WAA+B,EAAE;IAC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QAAE0C,OAAO,EAAE,KAAK;QAAE1C,KAAK,EAAE6B,QAAQ,CAAC7B,KAAK;QAAE2C,IAAI,EAACd;MAAS,CAAC;IACjE,CAAC,MAAM;MACL,OAAO;QAAEa,OAAO,EAAE,IAAI;QAAEC,IAAI,EAAEd,QAAQ,CAACc,IAAI;QAAEC,IAAI,EAACf;MAAS,CAAC;IAC9D;IACA;EACF;AACF","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { BivoSecureStore } from "./core/BivoSecureStore.js";
|
|
4
4
|
export { BivoTextInput } from "./components/BivoTextInput.js";
|
|
5
5
|
export { BivoCardInput } from "./components/BivoCardInput.js";
|
|
6
6
|
export { BivoCVCInput } from "./components/BivoCVCInput.js";
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["BivoSecureStore","BivoTextInput","BivoCardInput","BivoCVCInput"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,eAAe,QAAQ,2BAAwB;AAExD,SAASC,aAAa,QAAQ,+BAA4B;AAC1D,SAASC,aAAa,QAAQ,+BAA4B;AAC1D,SAASC,YAAY,QAAQ,8BAA2B","ignoreList":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import type { ViewStyle, TextStyle } from
|
|
3
|
-
import {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ViewStyle, TextStyle } from 'react-native';
|
|
3
|
+
import { BivoSecureStore } from '../core/BivoSecureStore';
|
|
4
4
|
interface Props {
|
|
5
|
-
|
|
5
|
+
bivoStore: BivoSecureStore;
|
|
6
6
|
fieldName: string;
|
|
7
7
|
placeholder?: string;
|
|
8
8
|
onStateChange?: (state: any) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BivoCVCInput.d.ts","sourceRoot":"","sources":["../../../../src/components/BivoCVCInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"BivoCVCInput.d.ts","sourceRoot":"","sources":["../../../../src/components/BivoCVCInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG1D,UAAU,KAAK;IACb,SAAS,EAAE,eAAe,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAyDxC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import type { ViewStyle, TextStyle } from
|
|
3
|
-
import {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ViewStyle, TextStyle } from 'react-native';
|
|
3
|
+
import { BivoSecureStore } from '../core/BivoSecureStore';
|
|
4
4
|
interface Props {
|
|
5
|
-
|
|
5
|
+
bivoStore: BivoSecureStore;
|
|
6
6
|
fieldName: string;
|
|
7
7
|
placeholder?: string;
|
|
8
8
|
onStateChange?: (state: any) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BivoCardInput.d.ts","sourceRoot":"","sources":["../../../../src/components/BivoCardInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"BivoCardInput.d.ts","sourceRoot":"","sources":["../../../../src/components/BivoCardInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAI1D,UAAU,KAAK;IACb,SAAS,EAAE,eAAe,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAUD,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAoEzC,CAAC"}
|