digipay-utility-payment 0.0.17 → 0.0.19
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.
|
Binary file
|
|
@@ -611,6 +611,8 @@ class TopupAndBillpaymentService {
|
|
|
611
611
|
this.deleteWorkflowScreens();
|
|
612
612
|
this.deleteWorkflowData();
|
|
613
613
|
this.setCurrentScreenStep(0);
|
|
614
|
+
this.saveTxnData(null);
|
|
615
|
+
this.saveBillData(null);
|
|
614
616
|
}
|
|
615
617
|
// API wrappers
|
|
616
618
|
getVendorDetailsById(id) {
|
|
@@ -2280,93 +2282,104 @@ class BillWorkflowComponent {
|
|
|
2280
2282
|
};
|
|
2281
2283
|
this.topupAndBillpaymentService.saveWorkflowData(workflowState);
|
|
2282
2284
|
}
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2285
|
+
getExtraFieldsToShowDecr(field) {
|
|
2286
|
+
if (!field)
|
|
2287
|
+
return undefined; // Early return for falsy field
|
|
2288
|
+
let isReadOnly = false;
|
|
2289
|
+
if (field?.external_field_key === "dial_code") {
|
|
2290
|
+
isReadOnly = true;
|
|
2291
|
+
this.fieldsModel = { "dial_code": this.currentUserDetails?.dial_code };
|
|
2292
|
+
}
|
|
2293
|
+
const validations = field?.field_validation || [];
|
|
2294
|
+
let isRequired = false;
|
|
2295
|
+
let minLength;
|
|
2296
|
+
let maxLength;
|
|
2297
|
+
let minValue;
|
|
2298
|
+
let maxValue;
|
|
2299
|
+
const validationMessages = {};
|
|
2300
|
+
validations.forEach((validation) => {
|
|
2301
|
+
const fieldType = validation?.field_types;
|
|
2302
|
+
const fieldValue = validation?.field_values;
|
|
2303
|
+
const fieldError = validation?.field_error;
|
|
2304
|
+
if (fieldType === 1) {
|
|
2305
|
+
isRequired = fieldValue === "true" || fieldValue === true || fieldValue === "1";
|
|
2306
|
+
}
|
|
2307
|
+
else if (fieldType === 2) {
|
|
2308
|
+
maxLength = parseInt(fieldValue);
|
|
2309
|
+
if (fieldError)
|
|
2310
|
+
validationMessages.maxlength = fieldError;
|
|
2311
|
+
}
|
|
2312
|
+
else if (fieldType === 3) {
|
|
2313
|
+
minValue = parseFloat(fieldValue);
|
|
2314
|
+
if (fieldError)
|
|
2315
|
+
validationMessages.min = fieldError;
|
|
2316
|
+
}
|
|
2317
|
+
else if (fieldType === 4) {
|
|
2318
|
+
minLength = parseInt(fieldValue);
|
|
2319
|
+
if (fieldError)
|
|
2320
|
+
validationMessages.minlength = fieldError;
|
|
2321
|
+
if (!isRequired)
|
|
2322
|
+
isRequired = true;
|
|
2323
|
+
}
|
|
2324
|
+
else if (fieldType === 5) {
|
|
2325
|
+
maxValue = parseFloat(fieldValue);
|
|
2326
|
+
if (fieldError)
|
|
2327
|
+
validationMessages.max = fieldError;
|
|
2328
|
+
}
|
|
2329
|
+
});
|
|
2330
|
+
let res = {
|
|
2331
|
+
key: field.external_field_key,
|
|
2332
|
+
templateOptions: {},
|
|
2333
|
+
className: "col-sm-6",
|
|
2334
|
+
wrappers: ["form-field-horizontal"],
|
|
2335
|
+
type: "input",
|
|
2336
|
+
modelOptions: { updateOn: 'change' },
|
|
2337
|
+
expressionProperties: {
|
|
2338
|
+
'templateOptions.disabled': 'formState.disabled',
|
|
2339
|
+
},
|
|
2340
|
+
hooks: {
|
|
2341
|
+
onInit: (field) => {
|
|
2342
|
+
const control = field.formControl;
|
|
2343
|
+
if (control) {
|
|
2344
|
+
control.valueChanges.subscribe(() => {
|
|
2345
|
+
if (control.invalid && control.value !== null && control.value !== '') {
|
|
2346
|
+
control.markAsTouched();
|
|
2347
|
+
}
|
|
2348
|
+
});
|
|
2349
|
+
}
|
|
2350
|
+
}
|
|
2351
|
+
}
|
|
2352
|
+
};
|
|
2353
|
+
if (isRequired) {
|
|
2354
|
+
validationMessages.required = `${field.field_title} ${this.translationService.translate("LABEL_IS_REQUIRED")}`;
|
|
2355
|
+
}
|
|
2356
|
+
if (Object.keys(validationMessages).length > 0) {
|
|
2357
|
+
res["validation"] = { messages: validationMessages };
|
|
2358
|
+
}
|
|
2359
|
+
if (field.field_type == TOPUP_BILL_PAYMENT_FIELD_TYPE.TEXT_BOX) {
|
|
2360
|
+
res["templateOptions"] = {
|
|
2361
|
+
label: `${field.field_title} `,
|
|
2362
|
+
placeholder: `${this.translationService.translate("COMMON_LABEL_PLEASE_ENTER")} ${field.field_title}`,
|
|
2363
|
+
required: isRequired,
|
|
2364
|
+
minLength: minLength,
|
|
2365
|
+
maxLength: maxLength,
|
|
2366
|
+
readonly: isReadOnly,
|
|
2367
|
+
};
|
|
2368
|
+
}
|
|
2369
|
+
else if (field.field_type == TOPUP_BILL_PAYMENT_FIELD_TYPE.NUMERIC) {
|
|
2370
|
+
res["templateOptions"] = {
|
|
2371
|
+
label: `${field.field_title} `,
|
|
2372
|
+
placeholder: `${this.translationService.translate("COMMON_LABEL_PLEASE_ENTER")} ${field.field_title}`,
|
|
2373
|
+
required: isRequired,
|
|
2374
|
+
min: minValue,
|
|
2375
|
+
max: maxValue,
|
|
2376
|
+
minLength: minLength,
|
|
2377
|
+
maxLength: maxLength,
|
|
2378
|
+
};
|
|
2379
|
+
res["type"] = "number-field";
|
|
2380
|
+
}
|
|
2381
|
+
return res; // Always reached now
|
|
2382
|
+
}
|
|
2370
2383
|
getExtraFieldsToShow(field) {
|
|
2371
2384
|
if (field) {
|
|
2372
2385
|
let isReadOnly = false;
|
|
@@ -4614,7 +4627,7 @@ function cleanupUtilityModalBackdrops() {
|
|
|
4614
4627
|
doc.body.style.removeProperty('padding-right');
|
|
4615
4628
|
doc.body.style.removeProperty('overflow');
|
|
4616
4629
|
}
|
|
4617
|
-
/** Hides a modal that was opened with this SDK
|
|
4630
|
+
/** Hides a modal that was opened with this SDK’s bundled Bootstrap `Modal` instance. */
|
|
4618
4631
|
function closeUtilityBootstrapModal(element) {
|
|
4619
4632
|
if (!element) {
|
|
4620
4633
|
return false;
|
|
@@ -5881,6 +5894,7 @@ class TopupAndBillpaymentReviewComponent extends TransactionClass {
|
|
|
5881
5894
|
}
|
|
5882
5895
|
}
|
|
5883
5896
|
clearPaymentFlowState() {
|
|
5897
|
+
this.topupAndBillpaymentService.setCurrentScreenStep(0);
|
|
5884
5898
|
clearInterval(this.interval);
|
|
5885
5899
|
this.interval = null;
|
|
5886
5900
|
this.timer = 0;
|
|
@@ -5966,7 +5980,6 @@ class TopupAndBillpaymentReviewComponent extends TransactionClass {
|
|
|
5966
5980
|
this.back();
|
|
5967
5981
|
}
|
|
5968
5982
|
}).catch(() => undefined);
|
|
5969
|
-
this.topupAndBillpaymentService?.deleteWorkflowUserInput();
|
|
5970
5983
|
}
|
|
5971
5984
|
removeunderScore(value) {
|
|
5972
5985
|
return value.replace(/_/g, ' ').split(' ').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(' ');
|