iamport-react-native 2.0.0-rc.1 → 2.0.1
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/android/build.gradle +1 -3
- package/ios/IamportReactNativeViewManager.m +5 -0
- package/lib/commonjs/components/Certification/index.js +20 -24
- package/lib/commonjs/components/Certification/index.js.map +1 -1
- package/lib/commonjs/components/ErrorOnParams/index.js +2 -10
- package/lib/commonjs/components/ErrorOnParams/index.js.map +1 -1
- package/lib/commonjs/components/Loading/index.js +3 -11
- package/lib/commonjs/components/Loading/index.js.map +1 -1
- package/lib/commonjs/components/Payment/index.js +25 -25
- package/lib/commonjs/components/Payment/index.js.map +1 -1
- package/lib/commonjs/constants/index.js +8 -4
- package/lib/commonjs/constants/index.js.map +1 -1
- package/lib/commonjs/utils/IamportUrl.js +27 -19
- package/lib/commonjs/utils/IamportUrl.js.map +1 -1
- package/lib/commonjs/utils/Validation.js +143 -3
- package/lib/commonjs/utils/Validation.js.map +1 -1
- package/lib/commonjs/utils/ValidationForPayment.js +4 -14
- package/lib/commonjs/utils/ValidationForPayment.js.map +1 -1
- package/lib/module/components/Certification/index.js +21 -25
- package/lib/module/components/Certification/index.js.map +1 -1
- package/lib/module/components/ErrorOnParams/index.js +3 -12
- package/lib/module/components/ErrorOnParams/index.js.map +1 -1
- package/lib/module/components/Loading/index.js +3 -11
- package/lib/module/components/Loading/index.js.map +1 -1
- package/lib/module/components/Payment/index.js +25 -25
- package/lib/module/components/Payment/index.js.map +1 -1
- package/lib/module/constants/index.js +8 -4
- package/lib/module/constants/index.js.map +1 -1
- package/lib/module/utils/IamportUrl.js +27 -19
- package/lib/module/utils/IamportUrl.js.map +1 -1
- package/lib/module/utils/Validation.js +143 -3
- package/lib/module/utils/Validation.js.map +1 -1
- package/lib/module/utils/ValidationForPayment.js +4 -14
- package/lib/module/utils/ValidationForPayment.js.map +1 -1
- package/lib/typescript/components/Certification/index.d.ts +1 -1
- package/lib/typescript/components/Payment/index.d.ts +1 -1
- package/lib/typescript/constants/index.d.ts +6 -2
- package/lib/typescript/utils/IamportUrl.d.ts +2 -2
- package/lib/typescript/utils/Validation.d.ts +51 -2
- package/lib/typescript/utils/ValidationForPayment.d.ts +0 -1
- package/package.json +18 -18
- package/src/components/Certification/index.tsx +66 -66
- package/src/components/ErrorOnParams/index.tsx +4 -23
- package/src/components/Loading/index.tsx +3 -11
- package/src/components/Payment/index.tsx +82 -81
- package/src/constants/index.ts +6 -1
- package/src/utils/IamportUrl.ts +27 -22
- package/src/utils/Validation.ts +141 -4
- package/src/utils/ValidationForPayment.ts +5 -14
package/src/utils/Validation.ts
CHANGED
|
@@ -41,9 +41,22 @@ class Validation {
|
|
|
41
41
|
this.validateCallback();
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
validateCallback() {
|
|
44
|
+
validateCallback() {
|
|
45
|
+
if (this.callback !== undefined && typeof this.callback !== 'function') {
|
|
46
|
+
this.isValid = false;
|
|
47
|
+
this.message = '콜백 함수(callback)가 올바르지 않습니다.';
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
this.validateData();
|
|
51
|
+
}
|
|
45
52
|
|
|
46
|
-
validateData() {
|
|
53
|
+
validateData() {
|
|
54
|
+
if (this.data?.popup) {
|
|
55
|
+
this.isValid = false;
|
|
56
|
+
this.message = '해당 모듈은 팝업을 지원하지 않습니다.';
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
47
60
|
|
|
48
61
|
getIsValid() {
|
|
49
62
|
return this.isValid;
|
|
@@ -55,17 +68,49 @@ class Validation {
|
|
|
55
68
|
}
|
|
56
69
|
|
|
57
70
|
namespace IMPData {
|
|
58
|
-
|
|
71
|
+
interface ICertificationData {
|
|
59
72
|
merchant_uid: string;
|
|
60
73
|
company: string;
|
|
61
74
|
carrier: string;
|
|
62
75
|
name: string;
|
|
63
76
|
phone: string;
|
|
64
77
|
min_age?: string;
|
|
78
|
+
popup?: boolean;
|
|
79
|
+
m_redirect_url?: string;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export class CertificationData implements ICertificationData {
|
|
83
|
+
constructor(
|
|
84
|
+
carrier: string,
|
|
85
|
+
company: string,
|
|
86
|
+
merchant_uid: string,
|
|
87
|
+
name: string,
|
|
88
|
+
phone: string,
|
|
89
|
+
min_age?: string,
|
|
90
|
+
popup?: boolean,
|
|
91
|
+
m_redirect_url?: string
|
|
92
|
+
) {
|
|
93
|
+
this.carrier = carrier;
|
|
94
|
+
this.company = company;
|
|
95
|
+
this.merchant_uid = merchant_uid;
|
|
96
|
+
this.name = name;
|
|
97
|
+
this.phone = phone;
|
|
98
|
+
this.min_age = min_age;
|
|
99
|
+
this.popup = popup;
|
|
100
|
+
this.m_redirect_url = m_redirect_url;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
carrier: string;
|
|
104
|
+
company: string;
|
|
105
|
+
merchant_uid: string;
|
|
106
|
+
name: string;
|
|
107
|
+
phone: string;
|
|
108
|
+
min_age?: string;
|
|
109
|
+
popup?: boolean;
|
|
65
110
|
m_redirect_url?: string;
|
|
66
111
|
}
|
|
67
112
|
|
|
68
|
-
|
|
113
|
+
interface IPaymentData {
|
|
69
114
|
pg: string;
|
|
70
115
|
pay_method: string;
|
|
71
116
|
currency?: string;
|
|
@@ -95,6 +140,98 @@ namespace IMPData {
|
|
|
95
140
|
naverUseCfm?: string;
|
|
96
141
|
naverProducts?: object[];
|
|
97
142
|
m_redirect_url?: string;
|
|
143
|
+
niceMobileV2?: boolean;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export class PaymentData implements IPaymentData {
|
|
147
|
+
constructor(
|
|
148
|
+
amount: string | number,
|
|
149
|
+
buyer_email: string,
|
|
150
|
+
buyer_name: string,
|
|
151
|
+
buyer_tel: string,
|
|
152
|
+
escrow: boolean,
|
|
153
|
+
merchant_uid: string,
|
|
154
|
+
name: string,
|
|
155
|
+
pay_method: string,
|
|
156
|
+
pg: string,
|
|
157
|
+
language?: string,
|
|
158
|
+
naverPopupMode?: boolean,
|
|
159
|
+
naverProducts?: object[],
|
|
160
|
+
naverUseCfm?: string,
|
|
161
|
+
niceMobileV2?: boolean,
|
|
162
|
+
notice_url?: string | string[],
|
|
163
|
+
m_redirect_url?: string,
|
|
164
|
+
currency?: string,
|
|
165
|
+
custom_data?: object,
|
|
166
|
+
customer_uid?: string,
|
|
167
|
+
digital?: boolean,
|
|
168
|
+
display?: { card_quota: number[] },
|
|
169
|
+
buyer_postcode?: string,
|
|
170
|
+
app_scheme?: string,
|
|
171
|
+
biz_num?: string,
|
|
172
|
+
buyer_addr?: string,
|
|
173
|
+
popup?: boolean,
|
|
174
|
+
tax_free?: number,
|
|
175
|
+
vbank_due?: string
|
|
176
|
+
) {
|
|
177
|
+
this.amount = amount;
|
|
178
|
+
this.app_scheme = app_scheme;
|
|
179
|
+
this.biz_num = biz_num;
|
|
180
|
+
this.buyer_addr = buyer_addr;
|
|
181
|
+
this.buyer_email = buyer_email;
|
|
182
|
+
this.buyer_name = buyer_name;
|
|
183
|
+
this.buyer_postcode = buyer_postcode;
|
|
184
|
+
this.buyer_tel = buyer_tel;
|
|
185
|
+
this.currency = currency;
|
|
186
|
+
this.custom_data = custom_data;
|
|
187
|
+
this.customer_uid = customer_uid;
|
|
188
|
+
this.digital = digital;
|
|
189
|
+
this.display = display;
|
|
190
|
+
this.escrow = escrow;
|
|
191
|
+
this.language = language;
|
|
192
|
+
this.m_redirect_url = m_redirect_url;
|
|
193
|
+
this.merchant_uid = merchant_uid;
|
|
194
|
+
this.name = name;
|
|
195
|
+
this.naverPopupMode = naverPopupMode;
|
|
196
|
+
this.naverProducts = naverProducts;
|
|
197
|
+
this.naverUseCfm = naverUseCfm;
|
|
198
|
+
this.niceMobileV2 = niceMobileV2;
|
|
199
|
+
this.notice_url = notice_url;
|
|
200
|
+
this.pay_method = pay_method;
|
|
201
|
+
this.pg = pg;
|
|
202
|
+
this.popup = popup;
|
|
203
|
+
this.tax_free = tax_free;
|
|
204
|
+
this.vbank_due = vbank_due;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
amount: string | number;
|
|
208
|
+
app_scheme?: string;
|
|
209
|
+
biz_num?: string;
|
|
210
|
+
buyer_addr?: string;
|
|
211
|
+
buyer_email: string;
|
|
212
|
+
buyer_name: string;
|
|
213
|
+
buyer_postcode?: string;
|
|
214
|
+
buyer_tel: string;
|
|
215
|
+
currency?: string;
|
|
216
|
+
custom_data?: object;
|
|
217
|
+
customer_uid?: string;
|
|
218
|
+
digital?: boolean;
|
|
219
|
+
display?: { card_quota: number[] };
|
|
220
|
+
escrow: boolean;
|
|
221
|
+
language?: string;
|
|
222
|
+
m_redirect_url?: string;
|
|
223
|
+
merchant_uid: string;
|
|
224
|
+
name: string;
|
|
225
|
+
naverPopupMode?: boolean;
|
|
226
|
+
naverProducts?: object[];
|
|
227
|
+
naverUseCfm?: string;
|
|
228
|
+
niceMobileV2?: boolean = true;
|
|
229
|
+
notice_url?: string | string[];
|
|
230
|
+
pay_method: string;
|
|
231
|
+
pg: string;
|
|
232
|
+
popup?: boolean;
|
|
233
|
+
tax_free?: number;
|
|
234
|
+
vbank_due?: string;
|
|
98
235
|
}
|
|
99
236
|
}
|
|
100
237
|
|
|
@@ -6,20 +6,11 @@ class ValidationForPayment extends Validation {
|
|
|
6
6
|
userCode: string,
|
|
7
7
|
loading: object,
|
|
8
8
|
callback: (response: any) => any,
|
|
9
|
-
data: IMPData.PaymentData
|
|
9
|
+
data: IMPData.PaymentData
|
|
10
10
|
) {
|
|
11
11
|
super(userCode, loading, callback, data);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
validateCallback() {
|
|
15
|
-
if (this.callback !== undefined && typeof this.callback !== 'function') {
|
|
16
|
-
this.isValid = false;
|
|
17
|
-
this.message = '콜백 함수(callback)가 올바르지 않습니다.';
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
this.validateData();
|
|
21
|
-
}
|
|
22
|
-
|
|
23
14
|
validateData() {
|
|
24
15
|
const {
|
|
25
16
|
pg,
|
|
@@ -83,7 +74,7 @@ class ValidationForPayment extends Validation {
|
|
|
83
74
|
'올바르지 않은 언어 설정입니다.\n 선택하신 PG사는 ko, en, zh jp 옵션을 지원합니다.';
|
|
84
75
|
return;
|
|
85
76
|
}
|
|
86
|
-
} else if (IMPConst.LANGUAGE.indexOf(language as any)
|
|
77
|
+
} else if (IMPConst.LANGUAGE.indexOf(language as any) === -1) {
|
|
87
78
|
this.isValid = false;
|
|
88
79
|
this.message =
|
|
89
80
|
'올바르지 않은 언어 설정입니다.\n 선택하신 PG사는 ko 또는 en 옵션을 지원합니다.';
|
|
@@ -109,13 +100,13 @@ class ValidationForPayment extends Validation {
|
|
|
109
100
|
return;
|
|
110
101
|
}
|
|
111
102
|
|
|
112
|
-
if (
|
|
103
|
+
if (popup) {
|
|
113
104
|
this.isValid = false;
|
|
114
|
-
this.message = '해당
|
|
105
|
+
this.message = '해당 모듈은 팝업을 지원하지 않습니다.';
|
|
115
106
|
return;
|
|
116
107
|
}
|
|
117
108
|
|
|
118
|
-
if (
|
|
109
|
+
if (pg === 'naverpay' && naverPopupMode) {
|
|
119
110
|
this.isValid = false;
|
|
120
111
|
this.message =
|
|
121
112
|
'해당 모듈에서 popup은\n네이버 페이 결제시 지원하지 않습니다.';
|