react-native-bootpay-api 4.0.0-beta.0 → 4.0.0-beta.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/package.json +1 -1
- package/src/BootpayWebView.js +28 -26
package/package.json
CHANGED
package/src/BootpayWebView.js
CHANGED
|
@@ -123,8 +123,7 @@ export class BootpayWebView extends Component {
|
|
|
123
123
|
{
|
|
124
124
|
visibility: true,
|
|
125
125
|
script: `
|
|
126
|
-
${await this.getMountJavascript()}
|
|
127
|
-
${quickPopup}
|
|
126
|
+
${await this.getMountJavascript()}
|
|
128
127
|
${this.generateScript(payload, requestMethod)}
|
|
129
128
|
`,
|
|
130
129
|
firstLoad: false,
|
|
@@ -155,9 +154,7 @@ export class BootpayWebView extends Component {
|
|
|
155
154
|
}
|
|
156
155
|
|
|
157
156
|
|
|
158
|
-
generateScript= (payload, requestMethod) => {
|
|
159
|
-
var requestMethod = "requestPayment";
|
|
160
|
-
|
|
157
|
+
generateScript= (payload, requestMethod) => {
|
|
161
158
|
const script = "Bootpay." + requestMethod +
|
|
162
159
|
`(${JSON.stringify(payload)})` +
|
|
163
160
|
".then( function (res) {" +
|
|
@@ -181,42 +178,47 @@ export class BootpayWebView extends Component {
|
|
|
181
178
|
action: 'BootpayClose',
|
|
182
179
|
message: '결제창이 닫혔습니다'
|
|
183
180
|
}
|
|
181
|
+
this.setState(
|
|
182
|
+
{
|
|
183
|
+
visibility: false
|
|
184
|
+
}
|
|
185
|
+
)
|
|
184
186
|
this.props.onClose(json);
|
|
185
187
|
this.dismiss();
|
|
186
188
|
return;
|
|
187
189
|
}
|
|
188
190
|
|
|
189
191
|
const data = JSON.parse(nativeEvent.data);
|
|
190
|
-
switch (data.
|
|
191
|
-
case '
|
|
192
|
+
switch (data.event) {
|
|
193
|
+
case 'cancel':
|
|
192
194
|
if(this.props.onCancel != undefined) this.props.onCancel(data);
|
|
193
|
-
this.setState(
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
)
|
|
195
|
+
// this.setState(
|
|
196
|
+
// {
|
|
197
|
+
// visibility: false
|
|
198
|
+
// }
|
|
199
|
+
// )
|
|
198
200
|
break;
|
|
199
|
-
case '
|
|
201
|
+
case 'error':
|
|
200
202
|
if(this.props.onError != undefined) this.props.onError(data);
|
|
201
|
-
this.setState(
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
)
|
|
203
|
+
// this.setState(
|
|
204
|
+
// {
|
|
205
|
+
// visibility: false
|
|
206
|
+
// }
|
|
207
|
+
// )
|
|
206
208
|
break;
|
|
207
|
-
case '
|
|
209
|
+
case 'issued':
|
|
208
210
|
if(this.props.onReady != undefined) this.props.onReady(data);
|
|
209
211
|
break;
|
|
210
|
-
case '
|
|
212
|
+
case 'confirm':
|
|
211
213
|
if(this.props.onConfirm != undefined) this.props.onConfirm(data);
|
|
212
214
|
break;
|
|
213
|
-
case '
|
|
215
|
+
case 'done':
|
|
214
216
|
if(this.props.onDone != undefined) this.props.onDone(data);
|
|
215
|
-
this.setState(
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
)
|
|
217
|
+
// this.setState(
|
|
218
|
+
// {
|
|
219
|
+
// visibility: false
|
|
220
|
+
// }
|
|
221
|
+
// )
|
|
220
222
|
break;
|
|
221
223
|
}
|
|
222
224
|
}
|