digipay-utility-payment 0.0.16 → 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.
|
Binary file
|
|
@@ -294,8 +294,8 @@ const PRODUCT_PRICE_TYPE = {
|
|
|
294
294
|
RANGE: 2,
|
|
295
295
|
};
|
|
296
296
|
const PROVIDER_CATEGORY_TYPE = {
|
|
297
|
-
RECHARGE:
|
|
298
|
-
BILL_PAYMENT:
|
|
297
|
+
RECHARGE: "RECHARGE",
|
|
298
|
+
BILL_PAYMENT: "BILL_PAYMENT",
|
|
299
299
|
};
|
|
300
300
|
const PROVIDER_CATEGORY_TYPE_NAME = {
|
|
301
301
|
RECHARGE: 'Recharge',
|
|
@@ -739,7 +739,8 @@ class TranslationService {
|
|
|
739
739
|
LABEL_NO_PROVIDERS_AVAILABLE: 'No providers available',
|
|
740
740
|
LABEL_ENTER_4_DIGIT_TRANSACTION_PIN: 'Enter your 4-digit transaction PIN',
|
|
741
741
|
AUTH_INVALID_TRANSACTION_PIN: "Invalid transaction PIN",
|
|
742
|
-
LABEL_INSUFFICIENT_BALANCE: 'Insufficient balance'
|
|
742
|
+
LABEL_INSUFFICIENT_BALANCE: 'Insufficient balance',
|
|
743
|
+
TOP_UP_COMPANY_BILL_PAYMENT_WORKFLOW_DATA_NOT_FOUND: 'Top-up company bill payment workflow data not found',
|
|
743
744
|
};
|
|
744
745
|
translate(key) {
|
|
745
746
|
return TranslationService.LABELS[key] ?? key;
|
|
@@ -2279,93 +2280,104 @@ class BillWorkflowComponent {
|
|
|
2279
2280
|
};
|
|
2280
2281
|
this.topupAndBillpaymentService.saveWorkflowData(workflowState);
|
|
2281
2282
|
}
|
|
2282
|
-
|
|
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
|
-
|
|
2283
|
+
getExtraFieldsToShowDecr(field) {
|
|
2284
|
+
if (!field)
|
|
2285
|
+
return undefined; // Early return for falsy field
|
|
2286
|
+
let isReadOnly = false;
|
|
2287
|
+
if (field?.external_field_key === "dial_code") {
|
|
2288
|
+
isReadOnly = true;
|
|
2289
|
+
this.fieldsModel = { "dial_code": this.currentUserDetails?.dial_code };
|
|
2290
|
+
}
|
|
2291
|
+
const validations = field?.field_validation || [];
|
|
2292
|
+
let isRequired = false;
|
|
2293
|
+
let minLength;
|
|
2294
|
+
let maxLength;
|
|
2295
|
+
let minValue;
|
|
2296
|
+
let maxValue;
|
|
2297
|
+
const validationMessages = {};
|
|
2298
|
+
validations.forEach((validation) => {
|
|
2299
|
+
const fieldType = validation?.field_types;
|
|
2300
|
+
const fieldValue = validation?.field_values;
|
|
2301
|
+
const fieldError = validation?.field_error;
|
|
2302
|
+
if (fieldType === 1) {
|
|
2303
|
+
isRequired = fieldValue === "true" || fieldValue === true || fieldValue === "1";
|
|
2304
|
+
}
|
|
2305
|
+
else if (fieldType === 2) {
|
|
2306
|
+
maxLength = parseInt(fieldValue);
|
|
2307
|
+
if (fieldError)
|
|
2308
|
+
validationMessages.maxlength = fieldError;
|
|
2309
|
+
}
|
|
2310
|
+
else if (fieldType === 3) {
|
|
2311
|
+
minValue = parseFloat(fieldValue);
|
|
2312
|
+
if (fieldError)
|
|
2313
|
+
validationMessages.min = fieldError;
|
|
2314
|
+
}
|
|
2315
|
+
else if (fieldType === 4) {
|
|
2316
|
+
minLength = parseInt(fieldValue);
|
|
2317
|
+
if (fieldError)
|
|
2318
|
+
validationMessages.minlength = fieldError;
|
|
2319
|
+
if (!isRequired)
|
|
2320
|
+
isRequired = true;
|
|
2321
|
+
}
|
|
2322
|
+
else if (fieldType === 5) {
|
|
2323
|
+
maxValue = parseFloat(fieldValue);
|
|
2324
|
+
if (fieldError)
|
|
2325
|
+
validationMessages.max = fieldError;
|
|
2326
|
+
}
|
|
2327
|
+
});
|
|
2328
|
+
let res = {
|
|
2329
|
+
key: field.external_field_key,
|
|
2330
|
+
templateOptions: {},
|
|
2331
|
+
className: "col-sm-6",
|
|
2332
|
+
wrappers: ["form-field-horizontal"],
|
|
2333
|
+
type: "input",
|
|
2334
|
+
modelOptions: { updateOn: 'change' },
|
|
2335
|
+
expressionProperties: {
|
|
2336
|
+
'templateOptions.disabled': 'formState.disabled',
|
|
2337
|
+
},
|
|
2338
|
+
hooks: {
|
|
2339
|
+
onInit: (field) => {
|
|
2340
|
+
const control = field.formControl;
|
|
2341
|
+
if (control) {
|
|
2342
|
+
control.valueChanges.subscribe(() => {
|
|
2343
|
+
if (control.invalid && control.value !== null && control.value !== '') {
|
|
2344
|
+
control.markAsTouched();
|
|
2345
|
+
}
|
|
2346
|
+
});
|
|
2347
|
+
}
|
|
2348
|
+
}
|
|
2349
|
+
}
|
|
2350
|
+
};
|
|
2351
|
+
if (isRequired) {
|
|
2352
|
+
validationMessages.required = `${field.field_title} ${this.translationService.translate("LABEL_IS_REQUIRED")}`;
|
|
2353
|
+
}
|
|
2354
|
+
if (Object.keys(validationMessages).length > 0) {
|
|
2355
|
+
res["validation"] = { messages: validationMessages };
|
|
2356
|
+
}
|
|
2357
|
+
if (field.field_type == TOPUP_BILL_PAYMENT_FIELD_TYPE.TEXT_BOX) {
|
|
2358
|
+
res["templateOptions"] = {
|
|
2359
|
+
label: `${field.field_title} `,
|
|
2360
|
+
placeholder: `${this.translationService.translate("COMMON_LABEL_PLEASE_ENTER")} ${field.field_title}`,
|
|
2361
|
+
required: isRequired,
|
|
2362
|
+
minLength: minLength,
|
|
2363
|
+
maxLength: maxLength,
|
|
2364
|
+
readonly: isReadOnly,
|
|
2365
|
+
};
|
|
2366
|
+
}
|
|
2367
|
+
else if (field.field_type == TOPUP_BILL_PAYMENT_FIELD_TYPE.NUMERIC) {
|
|
2368
|
+
res["templateOptions"] = {
|
|
2369
|
+
label: `${field.field_title} `,
|
|
2370
|
+
placeholder: `${this.translationService.translate("COMMON_LABEL_PLEASE_ENTER")} ${field.field_title}`,
|
|
2371
|
+
required: isRequired,
|
|
2372
|
+
min: minValue,
|
|
2373
|
+
max: maxValue,
|
|
2374
|
+
minLength: minLength,
|
|
2375
|
+
maxLength: maxLength,
|
|
2376
|
+
};
|
|
2377
|
+
res["type"] = "number-field";
|
|
2378
|
+
}
|
|
2379
|
+
return res; // Always reached now
|
|
2380
|
+
}
|
|
2369
2381
|
getExtraFieldsToShow(field) {
|
|
2370
2382
|
if (field) {
|
|
2371
2383
|
let isReadOnly = false;
|
|
@@ -4613,7 +4625,7 @@ function cleanupUtilityModalBackdrops() {
|
|
|
4613
4625
|
doc.body.style.removeProperty('padding-right');
|
|
4614
4626
|
doc.body.style.removeProperty('overflow');
|
|
4615
4627
|
}
|
|
4616
|
-
/** Hides a modal that was opened with this SDK
|
|
4628
|
+
/** Hides a modal that was opened with this SDK’s bundled Bootstrap `Modal` instance. */
|
|
4617
4629
|
function closeUtilityBootstrapModal(element) {
|
|
4618
4630
|
if (!element) {
|
|
4619
4631
|
return false;
|
|
@@ -5880,6 +5892,7 @@ class TopupAndBillpaymentReviewComponent extends TransactionClass {
|
|
|
5880
5892
|
}
|
|
5881
5893
|
}
|
|
5882
5894
|
clearPaymentFlowState() {
|
|
5895
|
+
this.topupAndBillpaymentService.setCurrentScreenStep(0);
|
|
5883
5896
|
clearInterval(this.interval);
|
|
5884
5897
|
this.interval = null;
|
|
5885
5898
|
this.timer = 0;
|
|
@@ -5965,7 +5978,6 @@ class TopupAndBillpaymentReviewComponent extends TransactionClass {
|
|
|
5965
5978
|
this.back();
|
|
5966
5979
|
}
|
|
5967
5980
|
}).catch(() => undefined);
|
|
5968
|
-
this.topupAndBillpaymentService?.deleteWorkflowUserInput();
|
|
5969
5981
|
}
|
|
5970
5982
|
removeunderScore(value) {
|
|
5971
5983
|
return value.replace(/_/g, ' ').split(' ').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(' ');
|