react-native-bootpay-api 4.1.2 → 4.1.5
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/index.js +4 -0
- package/lib/Bootpay.d.ts +43 -0
- package/lib/Bootpay.d.ts.map +1 -0
- package/lib/Bootpay.js +413 -0
- package/lib/BootpayModal.d.ts +72 -0
- package/lib/BootpayModal.d.ts.map +1 -0
- package/lib/BootpayModal.js +710 -0
- package/lib/BootpayShared.d.ts +1 -0
- package/lib/BootpayShared.d.ts.map +1 -0
- package/lib/BootpayShared.js +1 -0
- package/lib/BootpayTypes.d.ts +97 -0
- package/lib/BootpayTypes.d.ts.map +1 -0
- package/lib/BootpayTypes.js +69 -0
- package/{src → lib}/UserInfo.d.ts +2 -3
- package/lib/UserInfo.d.ts.map +1 -0
- package/lib/UserInfo.js +136 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +5 -0
- package/package.json +47 -52
- package/react-native-bootpay-api.podspec +20 -0
- package/react-native.config.js +34 -0
- package/images/close.png +0 -0
- package/src/BootpayAnalytics.js +0 -130
- package/src/BootpayWebView.js +0 -440
- package/src/UserInfo.d.ts.map +0 -1
- package/src/UserInfo.js +0 -67
- package/src/UserInfo.tsx +0 -78
- package/src/index.d.ts +0 -11
- package/src/index.js +0 -6
package/src/UserInfo.tsx
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { Component } from 'react';
|
|
2
|
-
import DeviceInfo from 'react-native-device-info';
|
|
3
|
-
import SInfo from 'react-native-sensitive-info';
|
|
4
|
-
|
|
5
|
-
export default class UserInfo extends Component {
|
|
6
|
-
static getBootpayInfo = (key: string, defaultVal: any) => {
|
|
7
|
-
return new Promise((resolve, reject) => {
|
|
8
|
-
SInfo.getItem(key, {
|
|
9
|
-
sharedPreferencesName: 'bootpaySharedPrefs',
|
|
10
|
-
keychainService: 'bootpayKeychain'
|
|
11
|
-
}).then((res: any) => {
|
|
12
|
-
res == undefined ? resolve(defaultVal) : resolve(res);
|
|
13
|
-
resolve(res);
|
|
14
|
-
}).catch((error: any) => {
|
|
15
|
-
reject(error);
|
|
16
|
-
});
|
|
17
|
-
})
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
static setBootpayInfo = (key: string, val: any) => {
|
|
21
|
-
return new Promise((resolve, reject) => {
|
|
22
|
-
SInfo.setItem(String(key), String(val), {
|
|
23
|
-
sharedPreferencesName: 'bootpaySharedPrefs',
|
|
24
|
-
keychainService: 'bootpayKeychain'
|
|
25
|
-
}).then((res: any) => {
|
|
26
|
-
resolve(res);
|
|
27
|
-
}).catch((error: any) => {
|
|
28
|
-
reject(error);
|
|
29
|
-
});
|
|
30
|
-
})
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
static getBootpayUUID = () => {
|
|
34
|
-
let uuid = DeviceInfo.getUniqueId();
|
|
35
|
-
return UserInfo.setBootpayInfo('uuid', uuid);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
static getBootpaySK = () => {
|
|
39
|
-
return UserInfo.getBootpayInfo('bootpay_sk', '');
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
static setBootpaySK = (val: string) => {
|
|
43
|
-
return UserInfo.setBootpayInfo('bootpay_sk', val);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
static newBootpaySK = (uuid: string, time: number) => {
|
|
47
|
-
return UserInfo.setBootpaySK(`${uuid}_${time}`);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
static getBootpayLastTime = async () => {
|
|
51
|
-
return await UserInfo.getBootpayInfo('bootpay_last_time', 0);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
static setBootpayLastTime(val: number){
|
|
55
|
-
return UserInfo.setBootpayInfo('bootpay_last_time', val);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
static getBootpayUserId() {
|
|
59
|
-
return UserInfo.getBootpayInfo('bootpay_user_id', '');
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
static setBootpayUserId = (val: string) => {
|
|
63
|
-
return UserInfo.setBootpayInfo('bootpay_user_id', val);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
static updateInfo = async () => {
|
|
67
|
-
const uuid = await UserInfo.getBootpayUUID() as string;
|
|
68
|
-
const bootpaySK = await UserInfo.getBootpaySK() as string;
|
|
69
|
-
const lastTime = await UserInfo.getBootpayLastTime() as number;
|
|
70
|
-
|
|
71
|
-
let current = Date.now();
|
|
72
|
-
|
|
73
|
-
if(bootpaySK == '') await UserInfo.newBootpaySK(uuid, current);
|
|
74
|
-
const isExpired = current - lastTime > 30 * 60 * 1000;
|
|
75
|
-
if(isExpired) await UserInfo.newBootpaySK(uuid, current);
|
|
76
|
-
await UserInfo.setBootpayLastTime(current);
|
|
77
|
-
}
|
|
78
|
-
}
|
package/src/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Component, ReactNode } from 'react';
|
|
2
|
-
import { ViewProperties, EmitterSubscription } from 'react-native';
|
|
3
|
-
import { EventEmitter } from 'events';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { BootpayWebView } from './BootpayWebView'
|
|
7
|
-
import { userTrace, pageTrace } from './BootpayAnalytics'
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export { BootpayWebView, userTrace, pageTrace }
|
|
11
|
-
|