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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-bootpay-api",
3
- "version": "4.0.0-beta.0",
3
+ "version": "4.0.0-beta.1",
4
4
  "description": "React Native를 위한 bootpay 라이브러리 입니다.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -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.action) {
191
- case 'BootpayCancel':
192
+ switch (data.event) {
193
+ case 'cancel':
192
194
  if(this.props.onCancel != undefined) this.props.onCancel(data);
193
- this.setState(
194
- {
195
- visibility: false
196
- }
197
- )
195
+ // this.setState(
196
+ // {
197
+ // visibility: false
198
+ // }
199
+ // )
198
200
  break;
199
- case 'BootpayError':
201
+ case 'error':
200
202
  if(this.props.onError != undefined) this.props.onError(data);
201
- this.setState(
202
- {
203
- visibility: false
204
- }
205
- )
203
+ // this.setState(
204
+ // {
205
+ // visibility: false
206
+ // }
207
+ // )
206
208
  break;
207
- case 'BootpayBankReady':
209
+ case 'issued':
208
210
  if(this.props.onReady != undefined) this.props.onReady(data);
209
211
  break;
210
- case 'BootpayConfirm':
212
+ case 'confirm':
211
213
  if(this.props.onConfirm != undefined) this.props.onConfirm(data);
212
214
  break;
213
- case 'BootpayDone':
215
+ case 'done':
214
216
  if(this.props.onDone != undefined) this.props.onDone(data);
215
- this.setState(
216
- {
217
- visibility: false
218
- }
219
- )
217
+ // this.setState(
218
+ // {
219
+ // visibility: false
220
+ // }
221
+ // )
220
222
  break;
221
223
  }
222
224
  }