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