@teamdigipay/dgepay-customer-transaction-package 0.0.13 → 0.0.15

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.
@@ -91,6 +91,9 @@ class TransactionController {
91
91
  else if (user.status_id === constants_1.USER_ACCOUNT_STATUS.REJECTED) {
92
92
  onError(Strings_1.default.PACKAGE_USER_IS_REJECTED, false);
93
93
  }
94
+ else if (user.status_id === constants_1.USER_ACCOUNT_STATUS.CLOSE_REQUESTED) {
95
+ onError(Strings_1.default.PACKAGE_USER_IS_CLOSE_REQUESTED, false);
96
+ }
94
97
  else {
95
98
  let productCode;
96
99
  let displayName;
@@ -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),
@@ -139,6 +145,18 @@ exports.default = (apiConfig, apiPayload, onSuccess, onFailure) => __awaiter(voi
139
145
  });
140
146
  }
141
147
  break;
148
+ // case (401) :
149
+ //
150
+ // onFailure({
151
+ // errorMessage: "",
152
+ // errorCode: 401,
153
+ // success: false
154
+ // });
155
+ // await cleanSession();
156
+ // resetNavigation(navigationConstants.LOGIN);
157
+ // showDangerToast(strings.CUSTOMER_APP_SESSION_EXPIRE_RELOGIN)
158
+ //
159
+ // break;
142
160
  case (502 || 500 || 503 || 404 || 403):
143
161
  react_native_1.Alert.alert(langugaeCode && langugaeCode == "bn" ? "রক্ষণাবেক্ষণ অধীনে সিস্টেম" : "System Under Maintenance", '', [
144
162
  { text: langugaeCode && langugaeCode == "en" ? 'OK' : "ঠিক আছে", },
@@ -151,7 +169,13 @@ exports.default = (apiConfig, apiPayload, onSuccess, onFailure) => __awaiter(voi
151
169
  baseURL: response.config.baseURL,
152
170
  params: response.config.params
153
171
  },
154
- response: response === null || response === void 0 ? void 0 : response.data
172
+ response: response === null || response === void 0 ? void 0 : response.data,
173
+ // user_id:getItem(USER_ID),
174
+ apiEndPoint: apiConfig.endPoint,
175
+ method: method,
176
+ RequestID: requestId,
177
+ status: status,
178
+ params: params,
155
179
  });
156
180
  react_native_1.Alert.alert(langugaeCode && langugaeCode == "bn" ? "রক্ষণাবেক্ষণ অধীনে সিস্টেম" : "System Under Maintenance", '', [
157
181
  { text: langugaeCode && langugaeCode == "en" ? 'OK' : "ঠিক আছে", },
@@ -165,21 +189,39 @@ exports.default = (apiConfig, apiPayload, onSuccess, onFailure) => __awaiter(voi
165
189
  baseURL: response.config.baseURL,
166
190
  params: response.config.params
167
191
  },
168
- response: response === null || response === void 0 ? void 0 : response.data
192
+ response: response === null || response === void 0 ? void 0 : response.data,
193
+ // user_id:getItem(USER_ID),
194
+ apiEndPoint: apiConfig.endPoint,
195
+ method: method,
196
+ RequestID: requestId,
197
+ status: status,
198
+ params: params,
169
199
  });
170
200
  react_native_1.Alert.alert(langugaeCode && langugaeCode == "bn" ? "রক্ষণাবেক্ষণ অধীনে সিস্টেম" : "System Under Maintenance", '', [
171
201
  { text: langugaeCode && langugaeCode == "en" ? 'OK' : "ঠিক আছে", },
172
202
  ]);
173
203
  }
174
204
  }))
175
- .catch((error) => {
176
- var _a;
205
+ .catch((error) => __awaiter(void 0, void 0, void 0, function* () {
206
+ var _e;
177
207
  (0, utils_1.consoleHelper)('\n___________error__________________', error);
178
208
  if (error) {
179
209
  (0, utils_1.consoleHelper)('\n___________error__________________', error === null || error === void 0 ? void 0 : error.response);
180
210
  if (error === null || error === void 0 ? void 0 : error.response) {
181
- (0, utils_1.consoleHelper)('\n___________error__________________', (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.status);
211
+ (0, utils_1.consoleHelper)('\n___________error__________________', (_e = error === null || error === void 0 ? void 0 : error.response) === null || _e === void 0 ? void 0 : _e.status);
182
212
  switch (error.response.status) {
213
+ // case (401) :
214
+ //
215
+ // onFailure({
216
+ // errorMessage: "",
217
+ // errorCode: 401,
218
+ // success: false
219
+ // });
220
+ // await cleanSession();
221
+ // resetNavigation(navigationConstants.LOGIN);
222
+ // showDangerToast(strings.CUSTOMER_APP_SESSION_EXPIRE_RELOGIN)
223
+ //
224
+ // break;
183
225
  case (502 || 500 || 503 || 404 || 403 || 504):
184
226
  react_native_1.Alert.alert(langugaeCode && langugaeCode == "bn" ? "রক্ষণাবেক্ষণ অধীনে সিস্টেম" : "System Under Maintenance", '', [
185
227
  { text: langugaeCode && langugaeCode == "en" ? 'OK' : "ঠিক আছে", },
@@ -188,7 +230,13 @@ exports.default = (apiConfig, apiPayload, onSuccess, onFailure) => __awaiter(voi
188
230
  default:
189
231
  DatadogTxn_1.default.error("CUSTOMER TXN API CALL FAIL(Error)", {
190
232
  error: error,
191
- config: config
233
+ config: { config },
234
+ // user_id:getItem(USER_ID),
235
+ apiEndPoint: apiConfig.endPoint,
236
+ method: method,
237
+ RequestID: requestId,
238
+ status: status,
239
+ params: params,
192
240
  });
193
241
  react_native_1.Alert.alert(langugaeCode && langugaeCode == "bn" ? "রক্ষণাবেক্ষণ অধীনে সিস্টেম" : "System Under Maintenance", '', [
194
242
  { text: langugaeCode && langugaeCode == "en" ? 'OK' : "ঠিক আছে", },
@@ -205,7 +253,13 @@ exports.default = (apiConfig, apiPayload, onSuccess, onFailure) => __awaiter(voi
205
253
  }
206
254
  DatadogTxn_1.default.error("CUSTOMER TXN API CALL FAIL(Error)", {
207
255
  error: error,
208
- config: config
256
+ config: { config },
257
+ // user_id:getItem(USER_ID),
258
+ apiEndPoint: apiConfig.endPoint,
259
+ method: method,
260
+ RequestID: requestId,
261
+ status: status,
262
+ params: params,
209
263
  });
210
264
  onFailure({
211
265
  errorMessage: "CUSTOMER_APP_SOMETHING_WENT_WRONG",
@@ -216,13 +270,19 @@ exports.default = (apiConfig, apiPayload, onSuccess, onFailure) => __awaiter(voi
216
270
  else {
217
271
  DatadogTxn_1.default.error("CUSTOMER TXN API CALL FAIL(Error)", {
218
272
  error: error,
219
- config: config
273
+ config: { config },
274
+ // user_id:getItem(USER_ID),
275
+ apiEndPoint: apiConfig.endPoint,
276
+ method: method,
277
+ RequestID: requestId,
278
+ status: status,
279
+ params: params,
220
280
  });
221
281
  onFailure({
222
282
  errorMessage: "CUSTOMER_APP_SOMETHING_WENT_WRONG",
223
283
  errorCode: 0,
224
284
  });
225
285
  }
226
- });
286
+ }));
227
287
  }
228
288
  });
@@ -14,7 +14,14 @@ const APICall_1 = require("../APICall");
14
14
  const APIEndpoints_1 = require("../APIEndpoints");
15
15
  function getTransactionHistoryAPIHelper(config, payload, onData, onError) {
16
16
  return __awaiter(this, void 0, void 0, function* () {
17
- yield (0, APICall_1.GET)(Object.assign(Object.assign({}, config), { endPoint: APIEndpoints_1.API_ENDPOINTS.WALLET_TRANSACTION_DOCKER.GET_ALL_TRANSACTION }), payload, (data) => __awaiter(this, void 0, void 0, function* () {
17
+ let base_url = "";
18
+ if (payload === null || payload === void 0 ? void 0 : payload.params.txn_id) {
19
+ base_url = APIEndpoints_1.API_ENDPOINTS.WALLET_TRANSACTION_DOCKER.GET_ALL_TRANSACTION + "/" + (payload === null || payload === void 0 ? void 0 : payload.params.txn_id);
20
+ }
21
+ else {
22
+ base_url = APIEndpoints_1.API_ENDPOINTS.WALLET_TRANSACTION_DOCKER.GET_ALL_TRANSACTION;
23
+ }
24
+ yield (0, APICall_1.GET)(Object.assign(Object.assign({}, config), { endPoint: base_url }), payload, (data) => __awaiter(this, void 0, void 0, function* () {
18
25
  onData(data === null || data === void 0 ? void 0 : data.data);
19
26
  }), (error) => __awaiter(this, void 0, void 0, function* () {
20
27
  onError(error);
@@ -28,5 +28,6 @@ declare const _default: {
28
28
  PACKAGE_CANT_REQUEST_TO_AGENT: string;
29
29
  PACKAGE_CANT_REQUEST_MONEY_MERCHANT_AGENT: string;
30
30
  PACKAGE_UNDER_MAINTENANCE: string;
31
+ PACKAGE_USER_IS_CLOSE_REQUESTED: string;
31
32
  };
32
33
  export default _default;
@@ -30,4 +30,5 @@ exports.default = {
30
30
  PACKAGE_CANT_REQUEST_TO_AGENT: "PACKAGE_CANT_REQUEST_TO_AGENT",
31
31
  PACKAGE_CANT_REQUEST_MONEY_MERCHANT_AGENT: "PACKAGE_CANT_REQUEST_MONEY_MERCHANT_AGENT",
32
32
  PACKAGE_UNDER_MAINTENANCE: 'PACKAGE_UNDER_MAINTENANCE',
33
+ PACKAGE_USER_IS_CLOSE_REQUESTED: 'PACKAGE_USER_IS_CLOSE_REQUESTED',
33
34
  };
@@ -12,6 +12,7 @@ export declare namespace USER_ACCOUNT_STATUS {
12
12
  const BLOCK = 4;
13
13
  const SUSPENDED = 5;
14
14
  const REJECTED = 6;
15
+ const CLOSE_REQUESTED = 7;
15
16
  }
16
17
  export declare namespace CUSTOMER_USER_ACCOUNT_STATUS {
17
18
  const ACTIVE = 1;
@@ -16,6 +16,7 @@ var USER_ACCOUNT_STATUS;
16
16
  USER_ACCOUNT_STATUS.BLOCK = 4;
17
17
  USER_ACCOUNT_STATUS.SUSPENDED = 5;
18
18
  USER_ACCOUNT_STATUS.REJECTED = 6;
19
+ USER_ACCOUNT_STATUS.CLOSE_REQUESTED = 7;
19
20
  })(USER_ACCOUNT_STATUS = exports.USER_ACCOUNT_STATUS || (exports.USER_ACCOUNT_STATUS = {}));
20
21
  var CUSTOMER_USER_ACCOUNT_STATUS;
21
22
  (function (CUSTOMER_USER_ACCOUNT_STATUS) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamdigipay/dgepay-customer-transaction-package",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "author": "RM (peerbits)",
5
5
  "license": "MIT",
6
6
  "main": "src/index.ts",
@@ -438,7 +438,10 @@ export class TransactionController {
438
438
  onError(Strings.PACKAGE_USER_IS_ONBOARD, false);
439
439
  } else if (user.status_id === USER_ACCOUNT_STATUS.REJECTED) {
440
440
  onError(Strings.PACKAGE_USER_IS_REJECTED, false);
441
- } else {
441
+ }else if (user.status_id === USER_ACCOUNT_STATUS.CLOSE_REQUESTED) {
442
+ onError(Strings.PACKAGE_USER_IS_CLOSE_REQUESTED, false);
443
+ }
444
+ else {
442
445
  let productCode: string | undefined;
443
446
  let displayName: string | undefined;
444
447
  if (user?.user_type === USER_TYPE.MERCHANT || isAgentAsMerchant) {
@@ -6,6 +6,12 @@ import DatadogTxn from "../utils/DatadogTxn";
6
6
  import NetInfo, { NetInfoState } from "@react-native-community/netinfo";
7
7
  import Strings from "../utils/Strings";
8
8
  import {Alert} from "react-native";
9
+ // import AlertDialog from "../../../../../src/components/common/AlertDialog/AlertDialog";
10
+ // import {strings} from "../../../../../src/Language/Language";
11
+ // import {cleanSession} from "../../../../../src/utils/data/PrefUtils";
12
+ // import {resetNavigation} from "../../../../../src/components/navigation/Navigator";
13
+ // import {navigationConstants} from "@teamdigipay/dgepay-core-package";
14
+ // import {showDangerToast} from "../../../../../src/utils/Utils";
9
15
 
10
16
  export interface API_CONFIG {
11
17
  baseURL?: string;
@@ -193,7 +199,13 @@ const isConnected: NetInfoState = await NetInfo.fetch()
193
199
  baseURL: response.config.baseURL,
194
200
  params: response.config.params
195
201
  },
196
- 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,
197
209
  });
198
210
 
199
211
  onFailure({
@@ -204,6 +216,18 @@ const isConnected: NetInfoState = await NetInfo.fetch()
204
216
 
205
217
  }
206
218
  break;
219
+ // case (401) :
220
+ //
221
+ // onFailure({
222
+ // errorMessage: "",
223
+ // errorCode: 401,
224
+ // success: false
225
+ // });
226
+ // await cleanSession();
227
+ // resetNavigation(navigationConstants.LOGIN);
228
+ // showDangerToast(strings.CUSTOMER_APP_SESSION_EXPIRE_RELOGIN)
229
+ //
230
+ // break;
207
231
  case (502 || 500 || 503 || 404 || 403):
208
232
  Alert.alert(langugaeCode && langugaeCode == "bn" ? "রক্ষণাবেক্ষণ অধীনে সিস্টেম": "System Under Maintenance" , '', [
209
233
  {text: langugaeCode && langugaeCode == "en" ? 'OK' : "ঠিক আছে", },
@@ -223,7 +247,13 @@ const isConnected: NetInfoState = await NetInfo.fetch()
223
247
  baseURL: response.config.baseURL,
224
248
  params: response.config.params
225
249
  },
226
- 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,
227
257
  });
228
258
  Alert.alert(langugaeCode && langugaeCode == "bn" ? "রক্ষণাবেক্ষণ অধীনে সিস্টেম": "System Under Maintenance" , '', [
229
259
  {text: langugaeCode && langugaeCode == "en" ? 'OK' : "ঠিক আছে", },
@@ -239,7 +269,13 @@ const isConnected: NetInfoState = await NetInfo.fetch()
239
269
  baseURL: response.config.baseURL,
240
270
  params: response.config.params
241
271
  },
242
- response: response?.data
272
+ response: response?.data,
273
+ // user_id:getItem(USER_ID),
274
+ apiEndPoint:apiConfig.endPoint,
275
+ method:method,
276
+ RequestID:requestId,
277
+ status:status,
278
+ params: params,
243
279
  });
244
280
  Alert.alert(langugaeCode && langugaeCode == "bn" ? "রক্ষণাবেক্ষণ অধীনে সিস্টেম": "System Under Maintenance" , '', [
245
281
  {text: langugaeCode && langugaeCode == "en" ? 'OK' : "ঠিক আছে", },
@@ -247,7 +283,7 @@ const isConnected: NetInfoState = await NetInfo.fetch()
247
283
 
248
284
  }
249
285
  })
250
- .catch((error) => {
286
+ .catch(async (error) => {
251
287
  consoleHelper('\n___________error__________________', error)
252
288
  if (error) {
253
289
  consoleHelper('\n___________error__________________', error?.response)
@@ -255,6 +291,19 @@ const isConnected: NetInfoState = await NetInfo.fetch()
255
291
  consoleHelper('\n___________error__________________', error?.response?.status)
256
292
  switch (error.response.status) {
257
293
 
294
+ // case (401) :
295
+ //
296
+ // onFailure({
297
+ // errorMessage: "",
298
+ // errorCode: 401,
299
+ // success: false
300
+ // });
301
+ // await cleanSession();
302
+ // resetNavigation(navigationConstants.LOGIN);
303
+ // showDangerToast(strings.CUSTOMER_APP_SESSION_EXPIRE_RELOGIN)
304
+ //
305
+ // break;
306
+
258
307
 
259
308
  case (502 || 500 || 503 || 404 || 403 || 504):
260
309
  Alert.alert(langugaeCode && langugaeCode == "bn" ? "রক্ষণাবেক্ষণ অধীনে সিস্টেম": "System Under Maintenance" , '', [
@@ -267,7 +316,13 @@ const isConnected: NetInfoState = await NetInfo.fetch()
267
316
 
268
317
  DatadogTxn.error("CUSTOMER TXN API CALL FAIL(Error)", {
269
318
  error: error,
270
- config: config
319
+ config: {config},
320
+ // user_id:getItem(USER_ID),
321
+ apiEndPoint:apiConfig.endPoint,
322
+ method:method,
323
+ RequestID:requestId,
324
+ status:status,
325
+ params: params,
271
326
  });
272
327
  Alert.alert(langugaeCode && langugaeCode == "bn" ? "রক্ষণাবেক্ষণ অধীনে সিস্টেম": "System Under Maintenance" , '', [
273
328
  {text: langugaeCode && langugaeCode == "en" ? 'OK' : "ঠিক আছে", },
@@ -286,7 +341,13 @@ const isConnected: NetInfoState = await NetInfo.fetch()
286
341
 
287
342
  DatadogTxn.error("CUSTOMER TXN API CALL FAIL(Error)", {
288
343
  error: error,
289
- config: config
344
+ config: {config},
345
+ // user_id:getItem(USER_ID),
346
+ apiEndPoint:apiConfig.endPoint,
347
+ method:method,
348
+ RequestID:requestId,
349
+ status:status,
350
+ params: params,
290
351
  });
291
352
 
292
353
  onFailure({
@@ -298,7 +359,13 @@ const isConnected: NetInfoState = await NetInfo.fetch()
298
359
 
299
360
  DatadogTxn.error("CUSTOMER TXN API CALL FAIL(Error)", {
300
361
  error: error,
301
- config: config
362
+ config: {config},
363
+ // user_id:getItem(USER_ID),
364
+ apiEndPoint:apiConfig.endPoint,
365
+ method:method,
366
+ RequestID:requestId,
367
+ status:status,
368
+ params: params,
302
369
  });
303
370
 
304
371
  onFailure({
@@ -8,10 +8,17 @@ export async function getTransactionHistoryAPIHelper(
8
8
  onData: (data: any) => void,
9
9
  onError: (error: any) => void
10
10
  ) {
11
+ let base_url = ""
12
+ if (payload?.params.txn_id)
13
+ {
14
+ base_url = API_ENDPOINTS.WALLET_TRANSACTION_DOCKER.GET_ALL_TRANSACTION + "/" + payload?.params.txn_id
15
+ }else{
16
+ base_url = API_ENDPOINTS.WALLET_TRANSACTION_DOCKER.GET_ALL_TRANSACTION
17
+ }
11
18
  await GET(
12
19
  {
13
20
  ...config,
14
- endPoint: API_ENDPOINTS.WALLET_TRANSACTION_DOCKER.GET_ALL_TRANSACTION,
21
+ endPoint: base_url,
15
22
  },
16
23
  payload,
17
24
  async (data: any) => {
@@ -30,5 +30,6 @@ export default {
30
30
  PACKAGE_CANT_REQUEST_TO_AGENT: "PACKAGE_CANT_REQUEST_TO_AGENT",
31
31
  PACKAGE_CANT_REQUEST_MONEY_MERCHANT_AGENT:"PACKAGE_CANT_REQUEST_MONEY_MERCHANT_AGENT",
32
32
  PACKAGE_UNDER_MAINTENANCE:'PACKAGE_UNDER_MAINTENANCE',
33
+ PACKAGE_USER_IS_CLOSE_REQUESTED:'PACKAGE_USER_IS_CLOSE_REQUESTED',
33
34
 
34
35
  };
@@ -14,6 +14,7 @@ export namespace USER_ACCOUNT_STATUS {
14
14
  export const BLOCK = 4;
15
15
  export const SUSPENDED = 5;
16
16
  export const REJECTED = 6;
17
+ export const CLOSE_REQUESTED = 7;
17
18
  }
18
19
 
19
20
  export namespace CUSTOMER_USER_ACCOUNT_STATUS {
@@ -268,4 +269,4 @@ export const PACKAGE_NO_USER='PACKAGE_NO_USER'
268
269
 
269
270
  export namespace ERROR_CODE {
270
271
  export const INTERNET_NOT_AVAILABLE = 503
271
- }
272
+ }