@teamdigipay/dgepay-customer-transaction-package 0.0.8 → 0.0.10
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/dist/network/APIService.js +3 -44
- package/package.json +1 -1
- package/src/network/APIService.ts +3 -45
|
@@ -226,56 +226,15 @@ exports.default = (apiConfig, apiPayload, onSuccess, onFailure) => __awaiter(voi
|
|
|
226
226
|
if (error === null || error === void 0 ? void 0 : error.response) {
|
|
227
227
|
(0, utils_1.consoleHelper)('\n___________error__________________', (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.status);
|
|
228
228
|
switch (error.response.status) {
|
|
229
|
-
case 500:
|
|
230
|
-
|
|
231
|
-
errorMessage: "Something Went Wrong",
|
|
232
|
-
errorCode: 500,
|
|
233
|
-
});
|
|
234
|
-
break;
|
|
235
|
-
case 502:
|
|
236
|
-
onFailure({
|
|
237
|
-
errorMessage: "Something Went Wrong",
|
|
238
|
-
errorCode: 502,
|
|
239
|
-
});
|
|
240
|
-
break;
|
|
241
|
-
case (503):
|
|
242
|
-
onFailure({
|
|
243
|
-
errorMessage: "SOMETHING_WENT_WRONG",
|
|
244
|
-
errorCode: 503,
|
|
245
|
-
});
|
|
246
|
-
break;
|
|
247
|
-
case 504:
|
|
248
|
-
onFailure({
|
|
249
|
-
errorMessage: "Something Went Wrong",
|
|
250
|
-
errorCode: 504,
|
|
251
|
-
});
|
|
252
|
-
break;
|
|
253
|
-
case 401:
|
|
254
|
-
// AlertDialog.show({
|
|
255
|
-
// title: strings.CUSTOMER_APP_SESSION,
|
|
256
|
-
// message: strings.CUSTOMER_APP_SESSION_EXPIRE_RELOGIN,
|
|
257
|
-
// positiveButton: {
|
|
258
|
-
// title: strings.Relogin,
|
|
259
|
-
// onPress: async () => {
|
|
260
|
-
// AlertDialog.hide();
|
|
261
|
-
// await setIsLoggedIn(false);
|
|
262
|
-
// store.dispatch({
|
|
263
|
-
// type: HOME_LOGOUT,
|
|
264
|
-
// });
|
|
265
|
-
// resetNavigation("splash");
|
|
266
|
-
// },
|
|
267
|
-
// },
|
|
268
|
-
// });
|
|
229
|
+
case (502 || 500 || 503 || 404 || 403):
|
|
230
|
+
react_native_1.Alert.alert("PACKAGE_UNDER_MAINTENANCE");
|
|
269
231
|
break;
|
|
270
232
|
default:
|
|
271
233
|
DatadogTxn_1.default.error("CUSTOMER TXN API CALL FAIL(Error)", {
|
|
272
234
|
error: error,
|
|
273
235
|
config: config
|
|
274
236
|
});
|
|
275
|
-
|
|
276
|
-
errorMessage: "CUSTOMER_APP_SOMETHING_WENT_WRONG",
|
|
277
|
-
errorCode: 0,
|
|
278
|
-
});
|
|
237
|
+
react_native_1.Alert.alert("PACKAGE_UNDER_MAINTENANCE");
|
|
279
238
|
break;
|
|
280
239
|
}
|
|
281
240
|
}
|
package/package.json
CHANGED
|
@@ -292,63 +292,21 @@ const isConnected: NetInfoState = await NetInfo.fetch()
|
|
|
292
292
|
if (error?.response) {
|
|
293
293
|
consoleHelper('\n___________error__________________', error?.response?.status)
|
|
294
294
|
switch (error.response.status) {
|
|
295
|
-
case 500:
|
|
296
|
-
onFailure({
|
|
297
|
-
errorMessage: "Something Went Wrong",
|
|
298
|
-
errorCode: 500,
|
|
299
|
-
});
|
|
300
|
-
break;
|
|
301
|
-
|
|
302
|
-
case 502:
|
|
303
|
-
onFailure({
|
|
304
|
-
errorMessage: "Something Went Wrong",
|
|
305
|
-
errorCode: 502,
|
|
306
|
-
});
|
|
307
|
-
break;
|
|
308
295
|
|
|
309
|
-
case (503):
|
|
310
|
-
onFailure({
|
|
311
|
-
errorMessage: "SOMETHING_WENT_WRONG",
|
|
312
|
-
errorCode: 503,
|
|
313
|
-
});
|
|
314
|
-
break;
|
|
315
296
|
|
|
316
|
-
case
|
|
317
|
-
|
|
318
|
-
errorMessage: "Something Went Wrong",
|
|
319
|
-
errorCode: 504,
|
|
320
|
-
});
|
|
297
|
+
case (502 || 500 || 503 || 404 || 403):
|
|
298
|
+
Alert.alert("PACKAGE_UNDER_MAINTENANCE")
|
|
321
299
|
break;
|
|
322
300
|
|
|
323
|
-
case 401:
|
|
324
|
-
// AlertDialog.show({
|
|
325
|
-
// title: strings.CUSTOMER_APP_SESSION,
|
|
326
|
-
// message: strings.CUSTOMER_APP_SESSION_EXPIRE_RELOGIN,
|
|
327
|
-
// positiveButton: {
|
|
328
|
-
// title: strings.Relogin,
|
|
329
|
-
// onPress: async () => {
|
|
330
|
-
// AlertDialog.hide();
|
|
331
|
-
// await setIsLoggedIn(false);
|
|
332
|
-
// store.dispatch({
|
|
333
|
-
// type: HOME_LOGOUT,
|
|
334
|
-
// });
|
|
335
|
-
// resetNavigation("splash");
|
|
336
|
-
// },
|
|
337
|
-
// },
|
|
338
|
-
// });
|
|
339
301
|
|
|
340
|
-
break;
|
|
341
302
|
default:
|
|
342
303
|
|
|
343
304
|
DatadogTxn.error("CUSTOMER TXN API CALL FAIL(Error)", {
|
|
344
305
|
error: error,
|
|
345
306
|
config: config
|
|
346
307
|
});
|
|
308
|
+
Alert.alert("PACKAGE_UNDER_MAINTENANCE")
|
|
347
309
|
|
|
348
|
-
onFailure({
|
|
349
|
-
errorMessage: "CUSTOMER_APP_SOMETHING_WENT_WRONG",
|
|
350
|
-
errorCode: 0,
|
|
351
|
-
});
|
|
352
310
|
break;
|
|
353
311
|
}
|
|
354
312
|
} else if (error.message) {
|