@teamdigipay/dgepay-customer-transaction-package 0.0.17 → 0.0.18
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 +88 -44
- package/package.json +1 -1
- package/src/network/APIService.ts +88 -51
|
@@ -106,6 +106,7 @@ exports.default = (apiConfig, apiPayload, onSuccess, onFailure) => __awaiter(voi
|
|
|
106
106
|
switch (status) {
|
|
107
107
|
case (200):
|
|
108
108
|
const responseData = response.data;
|
|
109
|
+
// setItem(SESSION_EXPIRE_VALUE,JSON.stringify(false))
|
|
109
110
|
if (response.data.success) {
|
|
110
111
|
let successMessage = undefined;
|
|
111
112
|
if (response && responseData.data.message) {
|
|
@@ -243,50 +244,93 @@ exports.default = (apiConfig, apiPayload, onSuccess, onFailure) => __awaiter(voi
|
|
|
243
244
|
(0, utils_1.consoleHelper)('\n___________error__________________', error === null || error === void 0 ? void 0 : error.response);
|
|
244
245
|
if (error === null || error === void 0 ? void 0 : error.response) {
|
|
245
246
|
(0, utils_1.consoleHelper)('\n___________error__________________', (_e = error === null || error === void 0 ? void 0 : error.response) === null || _e === void 0 ? void 0 : _e.status);
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
247
|
+
// if(getItem(SESSION_EXPIRE_VALUE) === JSON.stringify(false)) {
|
|
248
|
+
// switch (error.response.status) {
|
|
249
|
+
// case 401 :
|
|
250
|
+
// onFailure({
|
|
251
|
+
// errorMessage: "",
|
|
252
|
+
// errorCode: 401,
|
|
253
|
+
// success: false
|
|
254
|
+
// });
|
|
255
|
+
// await cleanSession();
|
|
256
|
+
// resetNavigation(navigationConstants.LOGIN);
|
|
257
|
+
// showDangerToast(strings.MERCHANT_APP_SESSION_EXPIRE_RELOGIN)
|
|
258
|
+
// break;
|
|
259
|
+
//
|
|
260
|
+
// case (502 || 500 || 503 || 404 || 403 || 504):
|
|
261
|
+
// onFailure({
|
|
262
|
+
// errorMessage: "",
|
|
263
|
+
// errorCode: "",
|
|
264
|
+
// success: false
|
|
265
|
+
// });
|
|
266
|
+
// Alert.alert(langugaeCode && langugaeCode == "bn" ? "রক্ষণাবেক্ষণ অধীনে সিস্টেম": "System Under Maintenance" , '', [
|
|
267
|
+
// {text: langugaeCode && langugaeCode == "bn" ? "ঠিক আছে" :'OK', },
|
|
268
|
+
// ]);
|
|
269
|
+
// break;
|
|
270
|
+
//
|
|
271
|
+
// default:
|
|
272
|
+
//
|
|
273
|
+
// DatadogTxn.error("MERCHANT TXN API CALL FAIL(Error)", {
|
|
274
|
+
// error: error,
|
|
275
|
+
// config: {config},
|
|
276
|
+
// user_id:getItem(USER_ID),
|
|
277
|
+
// apiEndPoint:apiConfig.endPoint,
|
|
278
|
+
// method:method,
|
|
279
|
+
// RequestID:requestId,
|
|
280
|
+
// status:status,
|
|
281
|
+
// params: params,
|
|
282
|
+
// });
|
|
283
|
+
// onFailure({
|
|
284
|
+
// errorMessage: "",
|
|
285
|
+
// errorCode: "",
|
|
286
|
+
// success: false
|
|
287
|
+
// });
|
|
288
|
+
// Alert.alert(langugaeCode && langugaeCode == "bn" ? "রক্ষণাবেক্ষণ অধীনে সিস্টেম": "System Under Maintenance" , '', [
|
|
289
|
+
// {text: langugaeCode && langugaeCode == "bn" ? "ঠিক আছে" :'OK', },
|
|
290
|
+
// ]);
|
|
291
|
+
//
|
|
292
|
+
//
|
|
293
|
+
// break;
|
|
294
|
+
// }
|
|
295
|
+
// }else {
|
|
296
|
+
// switch (error.response.status) {
|
|
297
|
+
//
|
|
298
|
+
// case (502 || 500 || 503 || 404 || 403 || 504):
|
|
299
|
+
// onFailure({
|
|
300
|
+
// errorMessage: "",
|
|
301
|
+
// errorCode: "",
|
|
302
|
+
// success: false
|
|
303
|
+
// });
|
|
304
|
+
// Alert.alert(langugaeCode && langugaeCode == "bn" ? "রক্ষণাবেক্ষণ অধীনে সিস্টেম": "System Under Maintenance" , '', [
|
|
305
|
+
// {text: langugaeCode && langugaeCode == "bn" ? "ঠিক আছে" :'OK', },
|
|
306
|
+
// ]);
|
|
307
|
+
// break;
|
|
308
|
+
//
|
|
309
|
+
// default:
|
|
310
|
+
//
|
|
311
|
+
// DatadogTxn.error("MERCHANT TXN API CALL FAIL(Error)", {
|
|
312
|
+
// error: error,
|
|
313
|
+
// config: {config},
|
|
314
|
+
// user_id:getItem(USER_ID),
|
|
315
|
+
// apiEndPoint:apiConfig.endPoint,
|
|
316
|
+
// method:method,
|
|
317
|
+
// RequestID:requestId,
|
|
318
|
+
// status:status,
|
|
319
|
+
// params: params,
|
|
320
|
+
// });
|
|
321
|
+
// onFailure({
|
|
322
|
+
// errorMessage: "",
|
|
323
|
+
// errorCode: "",
|
|
324
|
+
// success: false
|
|
325
|
+
// });
|
|
326
|
+
// Alert.alert(langugaeCode && langugaeCode == "bn" ? "রক্ষণাবেক্ষণ অধীনে সিস্টেম": "System Under Maintenance" , '', [
|
|
327
|
+
// {text: langugaeCode && langugaeCode == "bn" ? "ঠিক আছে" :'OK', },
|
|
328
|
+
// ]);
|
|
329
|
+
//
|
|
330
|
+
//
|
|
331
|
+
// break;
|
|
332
|
+
// }
|
|
333
|
+
// }
|
|
290
334
|
}
|
|
291
335
|
else if (error.message) {
|
|
292
336
|
if ((error === null || error === void 0 ? void 0 : error.message) === "Network Error") {
|
package/package.json
CHANGED
|
@@ -168,6 +168,7 @@ const isConnected: NetInfoState = await NetInfo.fetch()
|
|
|
168
168
|
switch (status) {
|
|
169
169
|
case (200):
|
|
170
170
|
const responseData: BasicResponseModel = response.data;
|
|
171
|
+
// setItem(SESSION_EXPIRE_VALUE,JSON.stringify(false))
|
|
171
172
|
|
|
172
173
|
if (response.data.success) {
|
|
173
174
|
let successMessage: string | undefined = undefined;
|
|
@@ -318,57 +319,93 @@ const isConnected: NetInfoState = await NetInfo.fetch()
|
|
|
318
319
|
consoleHelper('\n___________error__________________', error?.response)
|
|
319
320
|
if (error?.response) {
|
|
320
321
|
consoleHelper('\n___________error__________________', error?.response?.status)
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
322
|
+
// if(getItem(SESSION_EXPIRE_VALUE) === JSON.stringify(false)) {
|
|
323
|
+
// switch (error.response.status) {
|
|
324
|
+
// case 401 :
|
|
325
|
+
// onFailure({
|
|
326
|
+
// errorMessage: "",
|
|
327
|
+
// errorCode: 401,
|
|
328
|
+
// success: false
|
|
329
|
+
// });
|
|
330
|
+
// await cleanSession();
|
|
331
|
+
// resetNavigation(navigationConstants.LOGIN);
|
|
332
|
+
// showDangerToast(strings.MERCHANT_APP_SESSION_EXPIRE_RELOGIN)
|
|
333
|
+
// break;
|
|
334
|
+
//
|
|
335
|
+
// case (502 || 500 || 503 || 404 || 403 || 504):
|
|
336
|
+
// onFailure({
|
|
337
|
+
// errorMessage: "",
|
|
338
|
+
// errorCode: "",
|
|
339
|
+
// success: false
|
|
340
|
+
// });
|
|
341
|
+
// Alert.alert(langugaeCode && langugaeCode == "bn" ? "রক্ষণাবেক্ষণ অধীনে সিস্টেম": "System Under Maintenance" , '', [
|
|
342
|
+
// {text: langugaeCode && langugaeCode == "bn" ? "ঠিক আছে" :'OK', },
|
|
343
|
+
// ]);
|
|
344
|
+
// break;
|
|
345
|
+
//
|
|
346
|
+
// default:
|
|
347
|
+
//
|
|
348
|
+
// DatadogTxn.error("MERCHANT TXN API CALL FAIL(Error)", {
|
|
349
|
+
// error: error,
|
|
350
|
+
// config: {config},
|
|
351
|
+
// user_id:getItem(USER_ID),
|
|
352
|
+
// apiEndPoint:apiConfig.endPoint,
|
|
353
|
+
// method:method,
|
|
354
|
+
// RequestID:requestId,
|
|
355
|
+
// status:status,
|
|
356
|
+
// params: params,
|
|
357
|
+
// });
|
|
358
|
+
// onFailure({
|
|
359
|
+
// errorMessage: "",
|
|
360
|
+
// errorCode: "",
|
|
361
|
+
// success: false
|
|
362
|
+
// });
|
|
363
|
+
// Alert.alert(langugaeCode && langugaeCode == "bn" ? "রক্ষণাবেক্ষণ অধীনে সিস্টেম": "System Under Maintenance" , '', [
|
|
364
|
+
// {text: langugaeCode && langugaeCode == "bn" ? "ঠিক আছে" :'OK', },
|
|
365
|
+
// ]);
|
|
366
|
+
//
|
|
367
|
+
//
|
|
368
|
+
// break;
|
|
369
|
+
// }
|
|
370
|
+
// }else {
|
|
371
|
+
// switch (error.response.status) {
|
|
372
|
+
//
|
|
373
|
+
// case (502 || 500 || 503 || 404 || 403 || 504):
|
|
374
|
+
// onFailure({
|
|
375
|
+
// errorMessage: "",
|
|
376
|
+
// errorCode: "",
|
|
377
|
+
// success: false
|
|
378
|
+
// });
|
|
379
|
+
// Alert.alert(langugaeCode && langugaeCode == "bn" ? "রক্ষণাবেক্ষণ অধীনে সিস্টেম": "System Under Maintenance" , '', [
|
|
380
|
+
// {text: langugaeCode && langugaeCode == "bn" ? "ঠিক আছে" :'OK', },
|
|
381
|
+
// ]);
|
|
382
|
+
// break;
|
|
383
|
+
//
|
|
384
|
+
// default:
|
|
385
|
+
//
|
|
386
|
+
// DatadogTxn.error("MERCHANT TXN API CALL FAIL(Error)", {
|
|
387
|
+
// error: error,
|
|
388
|
+
// config: {config},
|
|
389
|
+
// user_id:getItem(USER_ID),
|
|
390
|
+
// apiEndPoint:apiConfig.endPoint,
|
|
391
|
+
// method:method,
|
|
392
|
+
// RequestID:requestId,
|
|
393
|
+
// status:status,
|
|
394
|
+
// params: params,
|
|
395
|
+
// });
|
|
396
|
+
// onFailure({
|
|
397
|
+
// errorMessage: "",
|
|
398
|
+
// errorCode: "",
|
|
399
|
+
// success: false
|
|
400
|
+
// });
|
|
401
|
+
// Alert.alert(langugaeCode && langugaeCode == "bn" ? "রক্ষণাবেক্ষণ অধীনে সিস্টেম": "System Under Maintenance" , '', [
|
|
402
|
+
// {text: langugaeCode && langugaeCode == "bn" ? "ঠিক আছে" :'OK', },
|
|
403
|
+
// ]);
|
|
404
|
+
//
|
|
405
|
+
//
|
|
406
|
+
// break;
|
|
407
|
+
// }
|
|
408
|
+
// }
|
|
372
409
|
} else if (error.message) {
|
|
373
410
|
|
|
374
411
|
if (error?.message === "Network Error") {
|