@teamdigipay/dgepay-customer-transaction-package 0.0.14 → 0.0.16
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 +77 -11
- package/package.json +1 -1
- package/src/network/APIService.ts +77 -16
|
@@ -130,7 +130,13 @@ exports.default = (apiConfig, apiPayload, onSuccess, onFailure) => __awaiter(voi
|
|
|
130
130
|
baseURL: response.config.baseURL,
|
|
131
131
|
params: response.config.params
|
|
132
132
|
},
|
|
133
|
-
response: response === null || response === void 0 ? void 0 : response.data
|
|
133
|
+
response: response === null || response === void 0 ? void 0 : response.data,
|
|
134
|
+
//user_id:getItem(USER_ID),
|
|
135
|
+
apiEndPoint: apiConfig.endPoint,
|
|
136
|
+
method: method,
|
|
137
|
+
RequestID: requestId,
|
|
138
|
+
status: status,
|
|
139
|
+
params: params,
|
|
134
140
|
});
|
|
135
141
|
onFailure({
|
|
136
142
|
errorMessage: (0, APIResponses_1.getBackendResponseMessage)(error),
|
|
@@ -152,8 +158,13 @@ exports.default = (apiConfig, apiPayload, onSuccess, onFailure) => __awaiter(voi
|
|
|
152
158
|
//
|
|
153
159
|
// break;
|
|
154
160
|
case (502 || 500 || 503 || 404 || 403):
|
|
161
|
+
onFailure({
|
|
162
|
+
errorMessage: "",
|
|
163
|
+
errorCode: "",
|
|
164
|
+
success: false
|
|
165
|
+
});
|
|
155
166
|
react_native_1.Alert.alert(langugaeCode && langugaeCode == "bn" ? "রক্ষণাবেক্ষণ অধীনে সিস্টেম" : "System Under Maintenance", '', [
|
|
156
|
-
{ text: langugaeCode && langugaeCode == "
|
|
167
|
+
{ text: langugaeCode && langugaeCode == "bn" ? "ঠিক আছে" : 'OK', },
|
|
157
168
|
]);
|
|
158
169
|
break;
|
|
159
170
|
default:
|
|
@@ -163,10 +174,21 @@ exports.default = (apiConfig, apiPayload, onSuccess, onFailure) => __awaiter(voi
|
|
|
163
174
|
baseURL: response.config.baseURL,
|
|
164
175
|
params: response.config.params
|
|
165
176
|
},
|
|
166
|
-
response: response === null || response === void 0 ? void 0 : response.data
|
|
177
|
+
response: response === null || response === void 0 ? void 0 : response.data,
|
|
178
|
+
// user_id:getItem(USER_ID),
|
|
179
|
+
apiEndPoint: apiConfig.endPoint,
|
|
180
|
+
method: method,
|
|
181
|
+
RequestID: requestId,
|
|
182
|
+
status: status,
|
|
183
|
+
params: params,
|
|
184
|
+
});
|
|
185
|
+
onFailure({
|
|
186
|
+
errorMessage: "",
|
|
187
|
+
errorCode: "",
|
|
188
|
+
success: false
|
|
167
189
|
});
|
|
168
190
|
react_native_1.Alert.alert(langugaeCode && langugaeCode == "bn" ? "রক্ষণাবেক্ষণ অধীনে সিস্টেম" : "System Under Maintenance", '', [
|
|
169
|
-
{ text: langugaeCode && langugaeCode == "
|
|
191
|
+
{ text: langugaeCode && langugaeCode == "bn" ? "ঠিক আছে" : 'OK', },
|
|
170
192
|
]);
|
|
171
193
|
}
|
|
172
194
|
}
|
|
@@ -177,10 +199,21 @@ exports.default = (apiConfig, apiPayload, onSuccess, onFailure) => __awaiter(voi
|
|
|
177
199
|
baseURL: response.config.baseURL,
|
|
178
200
|
params: response.config.params
|
|
179
201
|
},
|
|
180
|
-
response: response === null || response === void 0 ? void 0 : response.data
|
|
202
|
+
response: response === null || response === void 0 ? void 0 : response.data,
|
|
203
|
+
// user_id:getItem(USER_ID),
|
|
204
|
+
apiEndPoint: apiConfig.endPoint,
|
|
205
|
+
method: method,
|
|
206
|
+
RequestID: requestId,
|
|
207
|
+
status: status,
|
|
208
|
+
params: params,
|
|
209
|
+
});
|
|
210
|
+
onFailure({
|
|
211
|
+
errorMessage: "",
|
|
212
|
+
errorCode: "",
|
|
213
|
+
success: false
|
|
181
214
|
});
|
|
182
215
|
react_native_1.Alert.alert(langugaeCode && langugaeCode == "bn" ? "রক্ষণাবেক্ষণ অধীনে সিস্টেম" : "System Under Maintenance", '', [
|
|
183
|
-
{ text: langugaeCode && langugaeCode == "
|
|
216
|
+
{ text: langugaeCode && langugaeCode == "bn" ? "ঠিক আছে" : 'OK', },
|
|
184
217
|
]);
|
|
185
218
|
}
|
|
186
219
|
}))
|
|
@@ -205,23 +238,44 @@ exports.default = (apiConfig, apiPayload, onSuccess, onFailure) => __awaiter(voi
|
|
|
205
238
|
//
|
|
206
239
|
// break;
|
|
207
240
|
case (502 || 500 || 503 || 404 || 403 || 504):
|
|
241
|
+
onFailure({
|
|
242
|
+
errorMessage: "",
|
|
243
|
+
errorCode: "",
|
|
244
|
+
success: false
|
|
245
|
+
});
|
|
208
246
|
react_native_1.Alert.alert(langugaeCode && langugaeCode == "bn" ? "রক্ষণাবেক্ষণ অধীনে সিস্টেম" : "System Under Maintenance", '', [
|
|
209
|
-
{ text: langugaeCode && langugaeCode == "
|
|
247
|
+
{ text: langugaeCode && langugaeCode == "bn" ? "ঠিক আছে" : 'OK', },
|
|
210
248
|
]);
|
|
211
249
|
break;
|
|
212
250
|
default:
|
|
213
251
|
DatadogTxn_1.default.error("CUSTOMER TXN API CALL FAIL(Error)", {
|
|
214
252
|
error: error,
|
|
215
|
-
config: config
|
|
253
|
+
config: { config },
|
|
254
|
+
// user_id:getItem(USER_ID),
|
|
255
|
+
apiEndPoint: apiConfig.endPoint,
|
|
256
|
+
method: method,
|
|
257
|
+
RequestID: requestId,
|
|
258
|
+
status: status,
|
|
259
|
+
params: params,
|
|
260
|
+
});
|
|
261
|
+
onFailure({
|
|
262
|
+
errorMessage: "",
|
|
263
|
+
errorCode: 401,
|
|
264
|
+
success: false
|
|
216
265
|
});
|
|
217
266
|
react_native_1.Alert.alert(langugaeCode && langugaeCode == "bn" ? "রক্ষণাবেক্ষণ অধীনে সিস্টেম" : "System Under Maintenance", '', [
|
|
218
|
-
{ text: langugaeCode && langugaeCode == "
|
|
267
|
+
{ text: langugaeCode && langugaeCode == "bn" ? "ঠিক আছে" : 'OK', },
|
|
219
268
|
]);
|
|
220
269
|
break;
|
|
221
270
|
}
|
|
222
271
|
}
|
|
223
272
|
else if (error.message) {
|
|
224
273
|
if ((error === null || error === void 0 ? void 0 : error.message) === "Network Error") {
|
|
274
|
+
onFailure({
|
|
275
|
+
errorMessage: "",
|
|
276
|
+
errorCode: "",
|
|
277
|
+
success: false
|
|
278
|
+
});
|
|
225
279
|
react_native_1.Alert.alert(langugaeCode && langugaeCode == "bn" ? "রক্ষণাবেক্ষণ অধীনে সিস্টেম" : "System Under Maintenance", '', [
|
|
226
280
|
{ text: langugaeCode && langugaeCode == "bn" ? "ঠিক আছে" : 'OK', },
|
|
227
281
|
]);
|
|
@@ -229,7 +283,13 @@ exports.default = (apiConfig, apiPayload, onSuccess, onFailure) => __awaiter(voi
|
|
|
229
283
|
}
|
|
230
284
|
DatadogTxn_1.default.error("CUSTOMER TXN API CALL FAIL(Error)", {
|
|
231
285
|
error: error,
|
|
232
|
-
config: config
|
|
286
|
+
config: { config },
|
|
287
|
+
// user_id:getItem(USER_ID),
|
|
288
|
+
apiEndPoint: apiConfig.endPoint,
|
|
289
|
+
method: method,
|
|
290
|
+
RequestID: requestId,
|
|
291
|
+
status: status,
|
|
292
|
+
params: params,
|
|
233
293
|
});
|
|
234
294
|
onFailure({
|
|
235
295
|
errorMessage: "CUSTOMER_APP_SOMETHING_WENT_WRONG",
|
|
@@ -240,7 +300,13 @@ exports.default = (apiConfig, apiPayload, onSuccess, onFailure) => __awaiter(voi
|
|
|
240
300
|
else {
|
|
241
301
|
DatadogTxn_1.default.error("CUSTOMER TXN API CALL FAIL(Error)", {
|
|
242
302
|
error: error,
|
|
243
|
-
config: config
|
|
303
|
+
config: { config },
|
|
304
|
+
// user_id:getItem(USER_ID),
|
|
305
|
+
apiEndPoint: apiConfig.endPoint,
|
|
306
|
+
method: method,
|
|
307
|
+
RequestID: requestId,
|
|
308
|
+
status: status,
|
|
309
|
+
params: params,
|
|
244
310
|
});
|
|
245
311
|
onFailure({
|
|
246
312
|
errorMessage: "CUSTOMER_APP_SOMETHING_WENT_WRONG",
|
package/package.json
CHANGED
|
@@ -199,7 +199,13 @@ const isConnected: NetInfoState = await NetInfo.fetch()
|
|
|
199
199
|
baseURL: response.config.baseURL,
|
|
200
200
|
params: response.config.params
|
|
201
201
|
},
|
|
202
|
-
response: response?.data
|
|
202
|
+
response: response?.data,
|
|
203
|
+
//user_id:getItem(USER_ID),
|
|
204
|
+
apiEndPoint:apiConfig.endPoint,
|
|
205
|
+
method:method,
|
|
206
|
+
RequestID:requestId,
|
|
207
|
+
status:status,
|
|
208
|
+
params: params,
|
|
203
209
|
});
|
|
204
210
|
|
|
205
211
|
onFailure({
|
|
@@ -223,16 +229,16 @@ const isConnected: NetInfoState = await NetInfo.fetch()
|
|
|
223
229
|
//
|
|
224
230
|
// break;
|
|
225
231
|
case (502 || 500 || 503 || 404 || 403):
|
|
232
|
+
onFailure({
|
|
233
|
+
errorMessage: "",
|
|
234
|
+
errorCode: "",
|
|
235
|
+
success: false
|
|
236
|
+
});
|
|
226
237
|
Alert.alert(langugaeCode && langugaeCode == "bn" ? "রক্ষণাবেক্ষণ অধীনে সিস্টেম": "System Under Maintenance" , '', [
|
|
227
|
-
{text: langugaeCode && langugaeCode == "
|
|
238
|
+
{text: langugaeCode && langugaeCode == "bn" ? "ঠিক আছে" : 'OK',},
|
|
228
239
|
]);
|
|
229
240
|
break;
|
|
230
241
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
242
|
default:
|
|
237
243
|
|
|
238
244
|
DatadogTxn.error("CUSTOMER TXN API CALL FAIL", {
|
|
@@ -241,10 +247,21 @@ const isConnected: NetInfoState = await NetInfo.fetch()
|
|
|
241
247
|
baseURL: response.config.baseURL,
|
|
242
248
|
params: response.config.params
|
|
243
249
|
},
|
|
244
|
-
response: response?.data
|
|
250
|
+
response: response?.data,
|
|
251
|
+
// user_id:getItem(USER_ID),
|
|
252
|
+
apiEndPoint:apiConfig.endPoint,
|
|
253
|
+
method:method,
|
|
254
|
+
RequestID:requestId,
|
|
255
|
+
status:status,
|
|
256
|
+
params: params,
|
|
257
|
+
});
|
|
258
|
+
onFailure({
|
|
259
|
+
errorMessage: "",
|
|
260
|
+
errorCode: "",
|
|
261
|
+
success: false
|
|
245
262
|
});
|
|
246
263
|
Alert.alert(langugaeCode && langugaeCode == "bn" ? "রক্ষণাবেক্ষণ অধীনে সিস্টেম": "System Under Maintenance" , '', [
|
|
247
|
-
{text: langugaeCode && langugaeCode == "
|
|
264
|
+
{text: langugaeCode && langugaeCode == "bn" ? "ঠিক আছে" : 'OK',},
|
|
248
265
|
]);
|
|
249
266
|
|
|
250
267
|
|
|
@@ -257,10 +274,21 @@ const isConnected: NetInfoState = await NetInfo.fetch()
|
|
|
257
274
|
baseURL: response.config.baseURL,
|
|
258
275
|
params: response.config.params
|
|
259
276
|
},
|
|
260
|
-
response: response?.data
|
|
277
|
+
response: response?.data,
|
|
278
|
+
// user_id:getItem(USER_ID),
|
|
279
|
+
apiEndPoint:apiConfig.endPoint,
|
|
280
|
+
method:method,
|
|
281
|
+
RequestID:requestId,
|
|
282
|
+
status:status,
|
|
283
|
+
params: params,
|
|
284
|
+
});
|
|
285
|
+
onFailure({
|
|
286
|
+
errorMessage: "",
|
|
287
|
+
errorCode: "",
|
|
288
|
+
success: false
|
|
261
289
|
});
|
|
262
290
|
Alert.alert(langugaeCode && langugaeCode == "bn" ? "রক্ষণাবেক্ষণ অধীনে সিস্টেম": "System Under Maintenance" , '', [
|
|
263
|
-
{text: langugaeCode && langugaeCode == "
|
|
291
|
+
{text: langugaeCode && langugaeCode == "bn" ? "ঠিক আছে" : 'OK',},
|
|
264
292
|
]);
|
|
265
293
|
|
|
266
294
|
}
|
|
@@ -288,8 +316,13 @@ const isConnected: NetInfoState = await NetInfo.fetch()
|
|
|
288
316
|
|
|
289
317
|
|
|
290
318
|
case (502 || 500 || 503 || 404 || 403 || 504):
|
|
319
|
+
onFailure({
|
|
320
|
+
errorMessage: "",
|
|
321
|
+
errorCode: "",
|
|
322
|
+
success: false
|
|
323
|
+
});
|
|
291
324
|
Alert.alert(langugaeCode && langugaeCode == "bn" ? "রক্ষণাবেক্ষণ অধীনে সিস্টেম": "System Under Maintenance" , '', [
|
|
292
|
-
{text: langugaeCode && langugaeCode == "
|
|
325
|
+
{text: langugaeCode && langugaeCode == "bn" ? "ঠিক আছে" : 'OK',},
|
|
293
326
|
]);
|
|
294
327
|
break;
|
|
295
328
|
|
|
@@ -298,10 +331,21 @@ const isConnected: NetInfoState = await NetInfo.fetch()
|
|
|
298
331
|
|
|
299
332
|
DatadogTxn.error("CUSTOMER TXN API CALL FAIL(Error)", {
|
|
300
333
|
error: error,
|
|
301
|
-
config: config
|
|
334
|
+
config: {config},
|
|
335
|
+
// user_id:getItem(USER_ID),
|
|
336
|
+
apiEndPoint:apiConfig.endPoint,
|
|
337
|
+
method:method,
|
|
338
|
+
RequestID:requestId,
|
|
339
|
+
status:status,
|
|
340
|
+
params: params,
|
|
341
|
+
});
|
|
342
|
+
onFailure({
|
|
343
|
+
errorMessage: "",
|
|
344
|
+
errorCode: 401,
|
|
345
|
+
success: false
|
|
302
346
|
});
|
|
303
347
|
Alert.alert(langugaeCode && langugaeCode == "bn" ? "রক্ষণাবেক্ষণ অধীনে সিস্টেম": "System Under Maintenance" , '', [
|
|
304
|
-
{text: langugaeCode && langugaeCode == "
|
|
348
|
+
{text: langugaeCode && langugaeCode == "bn" ? "ঠিক আছে" : 'OK',},
|
|
305
349
|
]);
|
|
306
350
|
|
|
307
351
|
break;
|
|
@@ -309,6 +353,11 @@ const isConnected: NetInfoState = await NetInfo.fetch()
|
|
|
309
353
|
} else if (error.message) {
|
|
310
354
|
|
|
311
355
|
if (error?.message === "Network Error") {
|
|
356
|
+
onFailure({
|
|
357
|
+
errorMessage: "",
|
|
358
|
+
errorCode: "",
|
|
359
|
+
success: false
|
|
360
|
+
});
|
|
312
361
|
Alert.alert(langugaeCode && langugaeCode == "bn" ? "রক্ষণাবেক্ষণ অধীনে সিস্টেম": "System Under Maintenance" , '', [
|
|
313
362
|
{text: langugaeCode && langugaeCode == "bn" ? "ঠিক আছে" :'OK', },
|
|
314
363
|
]);
|
|
@@ -317,7 +366,13 @@ const isConnected: NetInfoState = await NetInfo.fetch()
|
|
|
317
366
|
|
|
318
367
|
DatadogTxn.error("CUSTOMER TXN API CALL FAIL(Error)", {
|
|
319
368
|
error: error,
|
|
320
|
-
config: config
|
|
369
|
+
config: {config},
|
|
370
|
+
// user_id:getItem(USER_ID),
|
|
371
|
+
apiEndPoint:apiConfig.endPoint,
|
|
372
|
+
method:method,
|
|
373
|
+
RequestID:requestId,
|
|
374
|
+
status:status,
|
|
375
|
+
params: params,
|
|
321
376
|
});
|
|
322
377
|
|
|
323
378
|
onFailure({
|
|
@@ -329,7 +384,13 @@ const isConnected: NetInfoState = await NetInfo.fetch()
|
|
|
329
384
|
|
|
330
385
|
DatadogTxn.error("CUSTOMER TXN API CALL FAIL(Error)", {
|
|
331
386
|
error: error,
|
|
332
|
-
config: config
|
|
387
|
+
config: {config},
|
|
388
|
+
// user_id:getItem(USER_ID),
|
|
389
|
+
apiEndPoint:apiConfig.endPoint,
|
|
390
|
+
method:method,
|
|
391
|
+
RequestID:requestId,
|
|
392
|
+
status:status,
|
|
393
|
+
params: params,
|
|
333
394
|
});
|
|
334
395
|
|
|
335
396
|
onFailure({
|