react-native-bootpay-api 4.1.4 → 4.1.52
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 +48 -52
- package/react-native-bootpay-api.podspec +20 -0
- package/react-native.config.js +34 -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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=BootpayShared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BootpayShared.d.ts","sourceRoot":"","sources":["../src/BootpayShared.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { ViewProps } from 'react-native';
|
|
2
|
+
export interface BootpayTypesProps extends ViewProps {
|
|
3
|
+
ios_application_id?: string;
|
|
4
|
+
android_application_id?: string;
|
|
5
|
+
onCancel?: (data: Object) => void;
|
|
6
|
+
onError?: (data: Object) => void;
|
|
7
|
+
onIssued?: (data: Object) => void;
|
|
8
|
+
onConfirm?: (data: Object) => boolean;
|
|
9
|
+
onDone?: (data: Object) => void;
|
|
10
|
+
onClose?: () => void;
|
|
11
|
+
}
|
|
12
|
+
export declare class User {
|
|
13
|
+
id?: string;
|
|
14
|
+
username?: string;
|
|
15
|
+
email?: string;
|
|
16
|
+
gender?: number;
|
|
17
|
+
birth?: string;
|
|
18
|
+
phone?: string;
|
|
19
|
+
area?: string;
|
|
20
|
+
addr?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare class Item {
|
|
23
|
+
name?: string;
|
|
24
|
+
qty?: number;
|
|
25
|
+
id?: string;
|
|
26
|
+
price?: number;
|
|
27
|
+
cat1?: string;
|
|
28
|
+
cat2?: string;
|
|
29
|
+
cat3?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare class StatItem {
|
|
32
|
+
item_name?: string;
|
|
33
|
+
item_img?: string;
|
|
34
|
+
unique?: string;
|
|
35
|
+
price?: number;
|
|
36
|
+
cat1?: string;
|
|
37
|
+
cat2?: string;
|
|
38
|
+
cat3?: string;
|
|
39
|
+
}
|
|
40
|
+
export declare class Onestore {
|
|
41
|
+
ad_id?: string;
|
|
42
|
+
sim_operator?: string;
|
|
43
|
+
installer_package_name?: string;
|
|
44
|
+
}
|
|
45
|
+
export declare class Extra {
|
|
46
|
+
card_quota?: string;
|
|
47
|
+
seller_name?: string;
|
|
48
|
+
delivery_day?: number;
|
|
49
|
+
locale?: string;
|
|
50
|
+
offer_period?: string;
|
|
51
|
+
display_cash_receipt?: boolean;
|
|
52
|
+
deposit_expiration?: string;
|
|
53
|
+
app_scheme?: string;
|
|
54
|
+
use_card_point?: boolean;
|
|
55
|
+
direct_card?: string;
|
|
56
|
+
use_order_id?: boolean;
|
|
57
|
+
international_card_only?: boolean;
|
|
58
|
+
phone_carrier?: string;
|
|
59
|
+
direct_app_card?: boolean;
|
|
60
|
+
direct_samsungpay?: boolean;
|
|
61
|
+
test_deposit?: boolean;
|
|
62
|
+
enable_error_webhook?: boolean;
|
|
63
|
+
separately_confirmed?: boolean;
|
|
64
|
+
confirmOnlyRestApi?: boolean;
|
|
65
|
+
open_type?: string;
|
|
66
|
+
use_bootpay_inapp_sdk?: boolean;
|
|
67
|
+
redirect_url?: string;
|
|
68
|
+
display_success_result?: boolean;
|
|
69
|
+
display_error_result?: boolean;
|
|
70
|
+
disposable_cup_deposit?: number;
|
|
71
|
+
use_welcomepayment?: number;
|
|
72
|
+
first_subscription_comment?: string;
|
|
73
|
+
except_card_companies?: [string];
|
|
74
|
+
enable_easy_payments?: [string];
|
|
75
|
+
confirm_grace_seconds?: number;
|
|
76
|
+
show_close_button: boolean;
|
|
77
|
+
}
|
|
78
|
+
export declare class Payload {
|
|
79
|
+
application_id?: string;
|
|
80
|
+
android_application_id?: string;
|
|
81
|
+
ios_application_id?: string;
|
|
82
|
+
pg?: string;
|
|
83
|
+
method?: string;
|
|
84
|
+
methods?: [string];
|
|
85
|
+
order_name?: string;
|
|
86
|
+
price?: number;
|
|
87
|
+
tax_free?: number;
|
|
88
|
+
order_id?: string;
|
|
89
|
+
subscription_id?: string;
|
|
90
|
+
authentication_id?: string;
|
|
91
|
+
metadata?: Object;
|
|
92
|
+
user_token?: string;
|
|
93
|
+
extra?: Extra;
|
|
94
|
+
user?: User;
|
|
95
|
+
items?: [Item];
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=BootpayTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BootpayTypes.d.ts","sourceRoot":"","sources":["../src/BootpayTypes.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EACV,MAAM,cAAc,CAAA;AAErB,MAAM,WAAW,iBAAkB,SAAQ,SAAS;IAChD,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,EAAE,CAAC,I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AAC,MAAM,CAAC,CAAA;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAI;IAClC,iBAAiB,EAAE,OAAO,CAAQ;CACrC;AAED,qBAAa,OAAO;IAChB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;CACjB"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
var User = /** @class */ (function () {
|
|
2
|
+
function User() {
|
|
3
|
+
}
|
|
4
|
+
return User;
|
|
5
|
+
}());
|
|
6
|
+
export { User };
|
|
7
|
+
var Item = /** @class */ (function () {
|
|
8
|
+
function Item() {
|
|
9
|
+
}
|
|
10
|
+
return Item;
|
|
11
|
+
}());
|
|
12
|
+
export { Item };
|
|
13
|
+
var StatItem = /** @class */ (function () {
|
|
14
|
+
function StatItem() {
|
|
15
|
+
}
|
|
16
|
+
return StatItem;
|
|
17
|
+
}());
|
|
18
|
+
export { StatItem };
|
|
19
|
+
var Onestore = /** @class */ (function () {
|
|
20
|
+
function Onestore() {
|
|
21
|
+
this.ad_id = "UNKNOWN_ADID";
|
|
22
|
+
this.sim_operator = "UNKNOWN_SIM_OPERATOR";
|
|
23
|
+
this.installer_package_name = "UNKNOWN_INSTALLER";
|
|
24
|
+
}
|
|
25
|
+
return Onestore;
|
|
26
|
+
}());
|
|
27
|
+
export { Onestore };
|
|
28
|
+
// export interface Extra {
|
|
29
|
+
// card_quota?: string;
|
|
30
|
+
// seller_name?: string;
|
|
31
|
+
// delivery_day?: number;
|
|
32
|
+
// }
|
|
33
|
+
var Extra = /** @class */ (function () {
|
|
34
|
+
function Extra() {
|
|
35
|
+
this.delivery_day = 1; // 배송일자
|
|
36
|
+
this.locale = 'ko'; //결제창 언어지원
|
|
37
|
+
this.display_cash_receipt = true; // 현금영수증 보일지 말지.. 가상계좌 KCP 옵션
|
|
38
|
+
this.use_card_point = true; //카드 포인트 사용 여부 (토스만 가능)
|
|
39
|
+
this.use_order_id = false; //가맹점 order_id로 PG로 전송
|
|
40
|
+
this.international_card_only = false; // 해외 결제카드 선택 여부 (토스만 가능)
|
|
41
|
+
this.phone_carrier = ""; //본인인증 시 고정할 통신사명, SKT,KT,LGT 중 1개만 가능
|
|
42
|
+
this.direct_app_card = false; // 카드사앱으로 direct 호출
|
|
43
|
+
this.direct_samsungpay = false; // 삼성페이 바로 띄우기
|
|
44
|
+
this.test_deposit = false; // 가상계좌 모의 입금
|
|
45
|
+
this.enable_error_webhook = false; //결제 오류시 Feedback URL로 webhook
|
|
46
|
+
this.separately_confirmed = true; // confirm 이벤트를 호출할지 말지, false일 경우 자동승인
|
|
47
|
+
this.confirmOnlyRestApi = false; // REST API로만 승인 처리
|
|
48
|
+
this.open_type = 'redirect'; // 페이지 오픈 type, [iframe, popup, redirect] 중 택 1
|
|
49
|
+
this.use_bootpay_inapp_sdk = true; // native app에서는 redirect를 완성도있게 지원하기 위한 옵션
|
|
50
|
+
this.redirect_url = 'https://api.bootpay.co.kr/v2'; //open_type이 redirect일 경우 페이지 이동할 URL ( 오류 및 결제 완료 모두 수신 가능 )
|
|
51
|
+
this.display_success_result = false; // 결제 완료되면 부트페이가 제공하는 완료창으로 보여주기 ( open_type이 iframe, popup 일때만 가능 )
|
|
52
|
+
this.display_error_result = true; // 결제 실패되면 부트페이가 제공하는 실패창으로 보여주기 ( open_type이 iframe, popup 일때만 가능 )
|
|
53
|
+
this.disposable_cup_deposit = 0; // 배달대행 플랫폼을 위한 컵 보증급 가격
|
|
54
|
+
// ExtraCardEasyOption cardEasyOption = ExtraCardEasyOption();
|
|
55
|
+
// List<BrowserOpenType>? browserOpenType = [];
|
|
56
|
+
this.use_welcomepayment = 0; //웰컴 재판모듈 진행시 1
|
|
57
|
+
this.first_subscription_comment = ''; // 자동결제 price > 0 조건일 때 첫 결제 관련 메세지
|
|
58
|
+
this.confirm_grace_seconds = 0; // 결제승인 유예시간 ( 승인 요청을 여러번하더라도 승인 이후 특정 시간동안 계속해서 결제 response_data 를 리턴한다 )
|
|
59
|
+
this.show_close_button = false; // x 닫기 버튼을 보여줄지 말지
|
|
60
|
+
}
|
|
61
|
+
return Extra;
|
|
62
|
+
}());
|
|
63
|
+
export { Extra };
|
|
64
|
+
var Payload = /** @class */ (function () {
|
|
65
|
+
function Payload() {
|
|
66
|
+
}
|
|
67
|
+
return Payload;
|
|
68
|
+
}());
|
|
69
|
+
export { Payload };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
export default class UserInfo extends Component {
|
|
1
|
+
export default class UserInfo {
|
|
3
2
|
static getBootpayInfo: (key: string, defaultVal: any) => Promise<unknown>;
|
|
4
3
|
static setBootpayInfo: (key: string, val: any) => Promise<unknown>;
|
|
5
4
|
static getBootpayUUID: () => Promise<unknown>;
|
|
6
5
|
static getBootpaySK: () => Promise<unknown>;
|
|
7
6
|
static setBootpaySK: (val: string) => Promise<unknown>;
|
|
8
7
|
static newBootpaySK: (uuid: string, time: number) => Promise<unknown>;
|
|
9
|
-
static getBootpayLastTime: () => Promise<
|
|
8
|
+
static getBootpayLastTime: () => Promise<number>;
|
|
10
9
|
static setBootpayLastTime(val: number): Promise<unknown>;
|
|
11
10
|
static getBootpayUserId(): Promise<unknown>;
|
|
12
11
|
static setBootpayUserId: (val: string) => Promise<unknown>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserInfo.d.ts","sourceRoot":"","sources":["../src/UserInfo.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,OAAO,OAAO,QAAQ;IACzB,MAAM,CAAC,cAAc,QAAS,MAAM,cAAc,GAAG,sBAYpD;IAED,MAAM,CAAC,cAAc,QAAS,MAAM,OAAO,GAAG,sBAW7C;IAED,MAAM,CAAC,cAAc,yBAGpB;IAED,MAAM,CAAC,YAAY,yBAElB;IAED,MAAM,CAAC,YAAY,QAAS,MAAM,sBAEjC;IAED,MAAM,CAAC,YAAY,SAAU,MAAM,QAAQ,MAAM,sBAEhD;IAED,MAAM,CAAC,kBAAkB,wBAExB;IAED,MAAM,CAAC,kBAAkB,CAAC,GAAG,EAAE,MAAM;IAIrC,MAAM,CAAC,gBAAgB;IAIvB,MAAM,CAAC,gBAAgB,QAAS,MAAM,sBAErC;IAED,MAAM,CAAC,UAAU,sBAWhB;CACJ"}
|
package/lib/UserInfo.js
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (_) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
// import { Component } from 'react';
|
|
38
|
+
import DeviceInfo from 'react-native-device-info';
|
|
39
|
+
import SInfo from 'react-native-sensitive-info';
|
|
40
|
+
// export default class UserInfo extends Component {
|
|
41
|
+
var UserInfo = /** @class */ (function () {
|
|
42
|
+
function UserInfo() {
|
|
43
|
+
}
|
|
44
|
+
UserInfo.setBootpayLastTime = function (val) {
|
|
45
|
+
return UserInfo.setBootpayInfo('bootpay_last_time', val);
|
|
46
|
+
};
|
|
47
|
+
UserInfo.getBootpayUserId = function () {
|
|
48
|
+
return UserInfo.getBootpayInfo('bootpay_user_id', '');
|
|
49
|
+
};
|
|
50
|
+
var _a;
|
|
51
|
+
_a = UserInfo;
|
|
52
|
+
UserInfo.getBootpayInfo = function (key, defaultVal) {
|
|
53
|
+
return new Promise(function (resolve, reject) {
|
|
54
|
+
SInfo.getItem(key, {
|
|
55
|
+
sharedPreferencesName: 'bootpaySharedPrefs',
|
|
56
|
+
keychainService: 'bootpayKeychain'
|
|
57
|
+
}).then(function (res) {
|
|
58
|
+
res == undefined ? resolve(defaultVal) : resolve(res);
|
|
59
|
+
resolve(res);
|
|
60
|
+
})["catch"](function (error) {
|
|
61
|
+
reject(error);
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
UserInfo.setBootpayInfo = function (key, val) {
|
|
66
|
+
return new Promise(function (resolve, reject) {
|
|
67
|
+
SInfo.setItem(String(key), String(val), {
|
|
68
|
+
sharedPreferencesName: 'bootpaySharedPrefs',
|
|
69
|
+
keychainService: 'bootpayKeychain'
|
|
70
|
+
}).then(function (res) {
|
|
71
|
+
resolve(res);
|
|
72
|
+
})["catch"](function (error) {
|
|
73
|
+
reject(error);
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
UserInfo.getBootpayUUID = function () {
|
|
78
|
+
var uuid = DeviceInfo.getUniqueId();
|
|
79
|
+
return UserInfo.setBootpayInfo('uuid', uuid);
|
|
80
|
+
};
|
|
81
|
+
UserInfo.getBootpaySK = function () {
|
|
82
|
+
return UserInfo.getBootpayInfo('bootpay_sk', '');
|
|
83
|
+
};
|
|
84
|
+
UserInfo.setBootpaySK = function (val) {
|
|
85
|
+
return UserInfo.setBootpayInfo('bootpay_sk', val);
|
|
86
|
+
};
|
|
87
|
+
UserInfo.newBootpaySK = function (uuid, time) {
|
|
88
|
+
return UserInfo.setBootpaySK("".concat(uuid, "_").concat(time));
|
|
89
|
+
};
|
|
90
|
+
UserInfo.getBootpayLastTime = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
91
|
+
return __generator(_a, function (_b) {
|
|
92
|
+
switch (_b.label) {
|
|
93
|
+
case 0: return [4 /*yield*/, UserInfo.getBootpayInfo('bootpay_last_time', 0)];
|
|
94
|
+
case 1: return [2 /*return*/, _b.sent()];
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}); };
|
|
98
|
+
UserInfo.setBootpayUserId = function (val) {
|
|
99
|
+
return UserInfo.setBootpayInfo('bootpay_user_id', val);
|
|
100
|
+
};
|
|
101
|
+
UserInfo.updateInfo = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
102
|
+
var uuid, bootpaySK, lastTime, current, isExpired;
|
|
103
|
+
return __generator(_a, function (_b) {
|
|
104
|
+
switch (_b.label) {
|
|
105
|
+
case 0: return [4 /*yield*/, UserInfo.getBootpayUUID()];
|
|
106
|
+
case 1:
|
|
107
|
+
uuid = _b.sent();
|
|
108
|
+
return [4 /*yield*/, UserInfo.getBootpaySK()];
|
|
109
|
+
case 2:
|
|
110
|
+
bootpaySK = _b.sent();
|
|
111
|
+
return [4 /*yield*/, UserInfo.getBootpayLastTime()];
|
|
112
|
+
case 3:
|
|
113
|
+
lastTime = _b.sent();
|
|
114
|
+
current = Date.now();
|
|
115
|
+
if (!(bootpaySK == '')) return [3 /*break*/, 5];
|
|
116
|
+
return [4 /*yield*/, UserInfo.newBootpaySK(uuid, current)];
|
|
117
|
+
case 4:
|
|
118
|
+
_b.sent();
|
|
119
|
+
_b.label = 5;
|
|
120
|
+
case 5:
|
|
121
|
+
isExpired = current - lastTime > 30 * 60 * 1000;
|
|
122
|
+
if (!isExpired) return [3 /*break*/, 7];
|
|
123
|
+
return [4 /*yield*/, UserInfo.newBootpaySK(uuid, current)];
|
|
124
|
+
case 6:
|
|
125
|
+
_b.sent();
|
|
126
|
+
_b.label = 7;
|
|
127
|
+
case 7: return [4 /*yield*/, UserInfo.setBootpayLastTime(current)];
|
|
128
|
+
case 8:
|
|
129
|
+
_b.sent();
|
|
130
|
+
return [2 /*return*/];
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}); };
|
|
134
|
+
return UserInfo;
|
|
135
|
+
}());
|
|
136
|
+
export default UserInfo;
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAG3D,OAAO,EAAG,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC"}
|
package/lib/index.js
ADDED
package/package.json
CHANGED
|
@@ -1,34 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-bootpay-api",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.52",
|
|
4
4
|
"description": "React Native를 위한 bootpay 라이브러리 입니다.",
|
|
5
|
-
"main": "
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"main-internal": "src/index.ts",
|
|
7
|
+
"typings": "src/index.d.ts",
|
|
8
|
+
"author": "bootpay <bootpay.co.kr@gmail.com>",
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"homepage": "https://www.bootpay.co.kr",
|
|
10
11
|
"contributors": [
|
|
11
12
|
"Bootpay <bootpay.co.kr@gmail.com>"
|
|
12
13
|
],
|
|
13
|
-
"files": [
|
|
14
|
-
"src",
|
|
15
|
-
"lib",
|
|
16
|
-
"images",
|
|
17
|
-
"android",
|
|
18
|
-
"ios",
|
|
19
|
-
"cpp",
|
|
20
|
-
"react-native-bootpay-api.podspec",
|
|
21
|
-
"!lib/typescript/example",
|
|
22
|
-
"!android/build",
|
|
23
|
-
"!ios/build",
|
|
24
|
-
"!**/__tests__",
|
|
25
|
-
"!**/__fixtures__",
|
|
26
|
-
"!**/__mocks__"
|
|
27
|
-
],
|
|
28
14
|
"scripts": {
|
|
29
15
|
"android": "react-native run-android",
|
|
30
16
|
"ios": "react-native run-ios --project-path example/ios",
|
|
31
|
-
"macos": "react-native run-macos --scheme
|
|
17
|
+
"macos": "react-native run-macos --scheme example --project-path example/macos",
|
|
32
18
|
"start": "cd example && react-native start",
|
|
33
19
|
"windows": "install-windows-test-app --project-directory example/windows && react-native run-windows --root example --arch x64",
|
|
34
20
|
"ci": "CI=true && yarn lint",
|
|
@@ -39,32 +25,26 @@
|
|
|
39
25
|
"appium": "appium",
|
|
40
26
|
"test:windows": "yarn jest --setupFiles=./jest-setups/jest.setup.js"
|
|
41
27
|
},
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
"
|
|
28
|
+
"rn-docs": {
|
|
29
|
+
"title": "bootpay",
|
|
30
|
+
"type": "bootpay"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"react": "*",
|
|
34
|
+
"react-native": "*"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"escape-string-regexp": "2.0.0",
|
|
38
|
+
"invariant": "2.2.4"
|
|
52
39
|
},
|
|
53
|
-
"homepage": "https://www.bootpay.co.kr/",
|
|
54
|
-
"publishConfig": {
|
|
55
|
-
"registry": "https://registry.npmjs.org/"
|
|
56
|
-
},
|
|
57
40
|
"devDependencies": {
|
|
58
41
|
"@babel/core": "^7.0.0",
|
|
59
42
|
"@babel/runtime": "^7.0.0",
|
|
60
|
-
"@react-native-community/cli": "^6.0.0",
|
|
61
|
-
"@react-native-community/cli-platform-android": "^6.0.0",
|
|
62
|
-
"@react-native-community/cli-platform-ios": "^6.0.0",
|
|
63
43
|
"@semantic-release/git": "7.0.16",
|
|
64
44
|
"@types/invariant": "^2.2.30",
|
|
65
45
|
"@types/jest": "^26.0.0",
|
|
66
46
|
"@types/react": "^17.0.0",
|
|
67
|
-
"@types/react-native": "^0.
|
|
47
|
+
"@types/react-native": "^0.67.3",
|
|
68
48
|
"@types/selenium-webdriver": "4.0.9",
|
|
69
49
|
"@typescript-eslint/eslint-plugin": "2.1.0",
|
|
70
50
|
"@typescript-eslint/parser": "2.1.0",
|
|
@@ -75,27 +55,43 @@
|
|
|
75
55
|
"eslint-plugin-import": "2.18.2",
|
|
76
56
|
"eslint-plugin-jsx-a11y": "6.2.3",
|
|
77
57
|
"eslint-plugin-react": "7.14.3",
|
|
58
|
+
"eslint-plugin-react-hooks": "^4.5.0",
|
|
78
59
|
"eslint-plugin-react-native": "3.7.0",
|
|
79
60
|
"jest": "^26.6.3",
|
|
80
|
-
"metro-react-native-babel-preset": "^0.
|
|
61
|
+
"metro-react-native-babel-preset": "^0.67.0",
|
|
81
62
|
"react": "17.0.2",
|
|
82
|
-
"react-
|
|
83
|
-
"react-native
|
|
84
|
-
"react-native-
|
|
85
|
-
"react-native-
|
|
63
|
+
"react-dom": "17.0.2",
|
|
64
|
+
"react-native": "0.68.2",
|
|
65
|
+
"react-native-macos": "0.66.57",
|
|
66
|
+
"react-native-test-app": "1.3.8",
|
|
67
|
+
"react-native-windows": "0.68.4",
|
|
86
68
|
"selenium-appium": "1.0.2",
|
|
87
69
|
"selenium-webdriver": "4.0.0-alpha.7",
|
|
88
70
|
"semantic-release": "15.13.24",
|
|
89
|
-
"typescript": "^4.0.0",
|
|
90
|
-
"
|
|
71
|
+
"typescript": "^4.0.0",
|
|
72
|
+
"winappdriver": "^0.0.7",
|
|
73
|
+
"react-native-webview-bootpay": "^11.22.84",
|
|
91
74
|
"react-native-device-info": "^8.7.0",
|
|
92
75
|
"react-native-sensitive-info": "^5.5.8",
|
|
93
76
|
"react-native-base64": "^0.2.1",
|
|
94
77
|
"react-native-aes-crypto": "^2.1.0",
|
|
95
|
-
"lodash": "^4.
|
|
78
|
+
"@types/lodash": "^4.14.182"
|
|
79
|
+
},
|
|
80
|
+
"repository": {
|
|
81
|
+
"type": "git",
|
|
82
|
+
"url": "https://github.com/bootpay/react-native-bootpay-api.git"
|
|
96
83
|
},
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
|
|
84
|
+
"files": [
|
|
85
|
+
"android",
|
|
86
|
+
"apple",
|
|
87
|
+
"ios",
|
|
88
|
+
"macos",
|
|
89
|
+
"windows",
|
|
90
|
+
"lib",
|
|
91
|
+
"images",
|
|
92
|
+
"src/index.js",
|
|
93
|
+
"react-native-bootpay-api.podspec",
|
|
94
|
+
"react-native.config.js"
|
|
95
|
+
]
|
|
101
96
|
}
|
|
97
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
require 'json'
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = "react-native-bootpay-api"
|
|
7
|
+
# s.name = package['name']
|
|
8
|
+
s.version = package['version']
|
|
9
|
+
s.summary = package['description']
|
|
10
|
+
s.license = package['license']
|
|
11
|
+
|
|
12
|
+
s.authors = package['author']
|
|
13
|
+
s.homepage = package['homepage']
|
|
14
|
+
s.platforms = { :ios => "9.0", :osx => "10.13" }
|
|
15
|
+
|
|
16
|
+
s.source = { :git => "https://github.com/bootpay/react-native-bootpay-api.git", :tag => "#{s.version}" }
|
|
17
|
+
s.source_files = "apple/**/*.{h,m}"
|
|
18
|
+
|
|
19
|
+
s.dependency 'React-Core'
|
|
20
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const project = (() => {
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
try {
|
|
5
|
+
const {
|
|
6
|
+
androidManifestPath,
|
|
7
|
+
iosProjectPath,
|
|
8
|
+
windowsProjectPath,
|
|
9
|
+
} = require('react-native-test-app');
|
|
10
|
+
return {
|
|
11
|
+
android: {
|
|
12
|
+
sourceDir: path.join('example', 'android'),
|
|
13
|
+
manifestPath: androidManifestPath(
|
|
14
|
+
path.join(__dirname, 'example', 'android'),
|
|
15
|
+
),
|
|
16
|
+
},
|
|
17
|
+
ios: {
|
|
18
|
+
project: iosProjectPath('example/ios'),
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
} catch (_) {
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
})();
|
|
25
|
+
|
|
26
|
+
module.exports = {
|
|
27
|
+
dependencies: {
|
|
28
|
+
// Help rn-cli find and autolink this library
|
|
29
|
+
'react-native-bootpay-api': {
|
|
30
|
+
root: __dirname,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
...(project ? { project } : undefined),
|
|
34
|
+
};
|