digipay-utility-payment 0.0.13 → 0.0.14
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
|
|
@@ -736,7 +736,8 @@ class TranslationService {
|
|
|
736
736
|
COMMON_LABEL_CLOSE: 'Close',
|
|
737
737
|
COMMON_LABEL_AMOUNT_MUST_NOT_EXCEED_BILL_AMOUNT: 'Amount must not be greater than the bill amount',
|
|
738
738
|
LABEL_NO_PROVIDERS_AVAILABLE: 'No providers available',
|
|
739
|
-
LABEL_ENTER_4_DIGIT_TRANSACTION_PIN: 'Enter your 4-digit transaction PIN'
|
|
739
|
+
LABEL_ENTER_4_DIGIT_TRANSACTION_PIN: 'Enter your 4-digit transaction PIN',
|
|
740
|
+
AUTH_INVALID_TRANSACTION_PIN: "Invalid transaction PIN",
|
|
740
741
|
};
|
|
741
742
|
translate(key) {
|
|
742
743
|
return TranslationService.LABELS[key] ?? key;
|
|
@@ -1104,7 +1105,6 @@ function utilityPaymentsSdkDebug(event, detail) {
|
|
|
1104
1105
|
if (!always && !utilityPaymentsSdkIsVerboseDebug()) {
|
|
1105
1106
|
return;
|
|
1106
1107
|
}
|
|
1107
|
-
console.info(LOG_PREFIX, event, { tag: UTILITY_PAYMENTS_SDK_BUILD_TAG, ...detail });
|
|
1108
1108
|
}
|
|
1109
1109
|
|
|
1110
1110
|
class VendorProvidersComponent {
|
|
@@ -2418,7 +2418,7 @@ class BillWorkflowComponent {
|
|
|
2418
2418
|
const validations = field?.field_validation || [];
|
|
2419
2419
|
const normalizedFieldType = this.normalizeFieldType(field?.field_type);
|
|
2420
2420
|
const normalizedValidations = this.normalizeValidations(validations);
|
|
2421
|
-
const isRequired = normalizedValidations.isRequired;
|
|
2421
|
+
const isRequired = normalizedValidations.isRequired || true;
|
|
2422
2422
|
const minLength = normalizedValidations.minLength;
|
|
2423
2423
|
const maxLength = normalizedValidations.maxLength;
|
|
2424
2424
|
let minValue = normalizedValidations.minValue;
|
|
@@ -3057,6 +3057,21 @@ class WorkFlowComponent {
|
|
|
3057
3057
|
return TOPUP_BILL_PAYMENT_FIELD_TYPE.BUTTON;
|
|
3058
3058
|
return fieldTypeValue;
|
|
3059
3059
|
}
|
|
3060
|
+
isFormIncomplete() {
|
|
3061
|
+
if (!this.detailsForm)
|
|
3062
|
+
return true;
|
|
3063
|
+
let hasEmptyFields = false;
|
|
3064
|
+
this.fieldsArray.forEach((field) => {
|
|
3065
|
+
const isRequired = field?.templateOptions?.required;
|
|
3066
|
+
const fieldKey = field.key != null ? String(field.key) : '';
|
|
3067
|
+
const formControl = this.detailsForm.get(fieldKey);
|
|
3068
|
+
const fieldValue = formControl?.value;
|
|
3069
|
+
if ((!fieldValue || fieldValue === '' || fieldValue === null || fieldValue === undefined)) {
|
|
3070
|
+
hasEmptyFields = true;
|
|
3071
|
+
}
|
|
3072
|
+
});
|
|
3073
|
+
return hasEmptyFields || !this.detailsForm.valid;
|
|
3074
|
+
}
|
|
3060
3075
|
normalizeFieldAction(action) {
|
|
3061
3076
|
const actionValue = String(action ?? "").trim().toUpperCase();
|
|
3062
3077
|
if (actionValue === "GET_BILL_SCREEN")
|
|
@@ -3108,7 +3123,7 @@ class WorkFlowComponent {
|
|
|
3108
3123
|
},
|
|
3109
3124
|
],
|
|
3110
3125
|
}),
|
|
3111
|
-
], ngImport: i0, template: "\n\n@if (showWorkflowComponent) {\n \n <sdk-bill-workflow \n [selectedBill]=\"selectedBillForWorkflow\"\n (workflowCompleted)=\"onWorkflowCompleted($event)\">\n </sdk-bill-workflow>\n \n \n}@else { \n <div class=\"content\">\n <header class=\"page-header\">\n <div class=\"d-flex align-items-center flex-wrap\">\n <div class=\"mr-auto\">\n <h1>{{ 'LABEL_UTILITIES' | translate }}</h1>\n </div>\n </div>\n </header>\n \n <section class=\"page-content container-fluid\">\n \n <div class=\"card m-0 border-0\">\n <div class=\"card-header p-t-25 p-b-20\">\n <h4 class=\"card-title font-weight-600 font-size-18 m-0 text-dark\">{{ vendorProvider?.provider_name }}\n </h4>\n </div>\n <div class=\"tab-content\">\n <div class=\"tab-pane fadeIn active show\">\n <form role=\"form\" class=\"form-horizontal\" [formGroup]=\"detailsForm\" (ngSubmit)=\"submitForm()\">\n <div class=\"card-body\">\n <div class=\"mt-3\">\n @if (fieldsArray.length > 0) {\n <div class=\"row\">\n <div class=\"col-xl-5 offset-xl-3\">\n <!-- <div class=\"form-group form-row\">\n <label\n class=\"control-label text-md-right col-md-4 col-lg-3\">Provider</label>\n <div class=\"col-md-5\">\n <ng-select placeholder=\"Select Provider\" bindLabel=\"provider_name\"\n bindValue=\"id\" [items]=\"vendorProviders\"\n (change)=\"changeVendorProvider($event)\">\n </ng-select>\n </div>\n </div> -->\n <!-- <pre>{{fieldsArray|json}}</pre> -->\n <formly-form [fields]=\"fieldsArray\" [model]=\"fieldsModel\" [form]=\"detailsForm\">\n </formly-form>\n </div>\n </div>\n }\n \n @if (fieldsArray.length === 0) {\n <sdk-no-data title=\"LABEL_FIELDS_NOT_AVAILABLE\"></sdk-no-data>\n }\n </div>\n </div>\n <div class=\"card-footer bg-light text-right\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"back()\">\n {{'COMMON_LABEL_CANCEL' | translate}}\n </button>\n @if (buttonData) {\n <button type=\"submit\" class=\"btn btn-primary\"\n [ngClass]=\"{'qt-loader qt-loader-mini qt-loader-left': showLoader}\"\n [disabled]=\"showLoader\">\n {{ buttonData?.field_title }}\n </button>\n }\n </div>\n </form>\n </div>\n </div>\n </div>\n </section>\n </div>\n}", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: SharedModule }, { kind: "ngmodule", type: NgSelectModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: FormlyBootstrapModule }, { kind: "ngmodule", type: FormlyModule }, { kind: "component", type: i1$2.LegacyFormlyForm, selector: "formly-form" }, { kind: "component", type: NoDataComponent, selector: "sdk-no-data", inputs: ["title", "icon"] }, { kind: "component", type: BillWorkflowComponent, selector: "sdk-bill-workflow", inputs: ["billData", "selectedBill"], outputs: ["workflowCompleted"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
3126
|
+
], ngImport: i0, template: "\n\n@if (showWorkflowComponent) {\n \n <sdk-bill-workflow \n [selectedBill]=\"selectedBillForWorkflow\"\n (workflowCompleted)=\"onWorkflowCompleted($event)\">\n </sdk-bill-workflow>\n \n \n}@else { \n <div class=\"content\">\n <header class=\"page-header\">\n <div class=\"d-flex align-items-center flex-wrap\">\n <div class=\"mr-auto\">\n <h1>{{ 'LABEL_UTILITIES' | translate }}</h1>\n </div>\n </div>\n </header>\n \n <section class=\"page-content container-fluid\">\n \n <div class=\"card m-0 border-0\">\n <div class=\"card-header p-t-25 p-b-20\">\n <h4 class=\"card-title font-weight-600 font-size-18 m-0 text-dark\">{{ vendorProvider?.provider_name }}\n </h4>\n </div>\n <div class=\"tab-content\">\n <div class=\"tab-pane fadeIn active show\">\n <form role=\"form\" class=\"form-horizontal\" [formGroup]=\"detailsForm\" (ngSubmit)=\"submitForm()\">\n <div class=\"card-body\">\n <div class=\"mt-3\">\n @if (fieldsArray.length > 0) {\n <div class=\"row\">\n <div class=\"col-xl-5 offset-xl-3\">\n <!-- <div class=\"form-group form-row\">\n <label\n class=\"control-label text-md-right col-md-4 col-lg-3\">Provider</label>\n <div class=\"col-md-5\">\n <ng-select placeholder=\"Select Provider\" bindLabel=\"provider_name\"\n bindValue=\"id\" [items]=\"vendorProviders\"\n (change)=\"changeVendorProvider($event)\">\n </ng-select>\n </div>\n </div> -->\n <!-- <pre>{{fieldsArray|json}}</pre> -->\n <formly-form [fields]=\"fieldsArray\" [model]=\"fieldsModel\" [form]=\"detailsForm\">\n </formly-form>\n </div>\n </div>\n }\n \n @if (fieldsArray.length === 0) {\n <sdk-no-data title=\"LABEL_FIELDS_NOT_AVAILABLE\"></sdk-no-data>\n }\n </div>\n </div>\n <div class=\"card-footer bg-light text-right\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"back()\">\n {{'COMMON_LABEL_CANCEL' | translate}}\n </button>\n @if (buttonData) {\n <button type=\"submit\" class=\"btn btn-primary\"\n [ngClass]=\"{'qt-loader qt-loader-mini qt-loader-left': showLoader}\"\n [disabled]=\"showLoader || isFormIncomplete()\">\n {{ buttonData?.field_title }}\n </button>\n }\n </div>\n </form>\n </div>\n </div>\n </div>\n </section>\n </div>\n}", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: SharedModule }, { kind: "ngmodule", type: NgSelectModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: FormlyBootstrapModule }, { kind: "ngmodule", type: FormlyModule }, { kind: "component", type: i1$2.LegacyFormlyForm, selector: "formly-form" }, { kind: "component", type: NoDataComponent, selector: "sdk-no-data", inputs: ["title", "icon"] }, { kind: "component", type: BillWorkflowComponent, selector: "sdk-bill-workflow", inputs: ["billData", "selectedBill"], outputs: ["workflowCompleted"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
3112
3127
|
}
|
|
3113
3128
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: WorkFlowComponent, decorators: [{
|
|
3114
3129
|
type: Component,
|
|
@@ -3158,7 +3173,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImpo
|
|
|
3158
3173
|
},
|
|
3159
3174
|
],
|
|
3160
3175
|
}),
|
|
3161
|
-
], template: "\n\n@if (showWorkflowComponent) {\n \n <sdk-bill-workflow \n [selectedBill]=\"selectedBillForWorkflow\"\n (workflowCompleted)=\"onWorkflowCompleted($event)\">\n </sdk-bill-workflow>\n \n \n}@else { \n <div class=\"content\">\n <header class=\"page-header\">\n <div class=\"d-flex align-items-center flex-wrap\">\n <div class=\"mr-auto\">\n <h1>{{ 'LABEL_UTILITIES' | translate }}</h1>\n </div>\n </div>\n </header>\n \n <section class=\"page-content container-fluid\">\n \n <div class=\"card m-0 border-0\">\n <div class=\"card-header p-t-25 p-b-20\">\n <h4 class=\"card-title font-weight-600 font-size-18 m-0 text-dark\">{{ vendorProvider?.provider_name }}\n </h4>\n </div>\n <div class=\"tab-content\">\n <div class=\"tab-pane fadeIn active show\">\n <form role=\"form\" class=\"form-horizontal\" [formGroup]=\"detailsForm\" (ngSubmit)=\"submitForm()\">\n <div class=\"card-body\">\n <div class=\"mt-3\">\n @if (fieldsArray.length > 0) {\n <div class=\"row\">\n <div class=\"col-xl-5 offset-xl-3\">\n <!-- <div class=\"form-group form-row\">\n <label\n class=\"control-label text-md-right col-md-4 col-lg-3\">Provider</label>\n <div class=\"col-md-5\">\n <ng-select placeholder=\"Select Provider\" bindLabel=\"provider_name\"\n bindValue=\"id\" [items]=\"vendorProviders\"\n (change)=\"changeVendorProvider($event)\">\n </ng-select>\n </div>\n </div> -->\n <!-- <pre>{{fieldsArray|json}}</pre> -->\n <formly-form [fields]=\"fieldsArray\" [model]=\"fieldsModel\" [form]=\"detailsForm\">\n </formly-form>\n </div>\n </div>\n }\n \n @if (fieldsArray.length === 0) {\n <sdk-no-data title=\"LABEL_FIELDS_NOT_AVAILABLE\"></sdk-no-data>\n }\n </div>\n </div>\n <div class=\"card-footer bg-light text-right\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"back()\">\n {{'COMMON_LABEL_CANCEL' | translate}}\n </button>\n @if (buttonData) {\n <button type=\"submit\" class=\"btn btn-primary\"\n [ngClass]=\"{'qt-loader qt-loader-mini qt-loader-left': showLoader}\"\n [disabled]=\"showLoader\">\n {{ buttonData?.field_title }}\n </button>\n }\n </div>\n </form>\n </div>\n </div>\n </div>\n </section>\n </div>\n}" }]
|
|
3176
|
+
], template: "\n\n@if (showWorkflowComponent) {\n \n <sdk-bill-workflow \n [selectedBill]=\"selectedBillForWorkflow\"\n (workflowCompleted)=\"onWorkflowCompleted($event)\">\n </sdk-bill-workflow>\n \n \n}@else { \n <div class=\"content\">\n <header class=\"page-header\">\n <div class=\"d-flex align-items-center flex-wrap\">\n <div class=\"mr-auto\">\n <h1>{{ 'LABEL_UTILITIES' | translate }}</h1>\n </div>\n </div>\n </header>\n \n <section class=\"page-content container-fluid\">\n \n <div class=\"card m-0 border-0\">\n <div class=\"card-header p-t-25 p-b-20\">\n <h4 class=\"card-title font-weight-600 font-size-18 m-0 text-dark\">{{ vendorProvider?.provider_name }}\n </h4>\n </div>\n <div class=\"tab-content\">\n <div class=\"tab-pane fadeIn active show\">\n <form role=\"form\" class=\"form-horizontal\" [formGroup]=\"detailsForm\" (ngSubmit)=\"submitForm()\">\n <div class=\"card-body\">\n <div class=\"mt-3\">\n @if (fieldsArray.length > 0) {\n <div class=\"row\">\n <div class=\"col-xl-5 offset-xl-3\">\n <!-- <div class=\"form-group form-row\">\n <label\n class=\"control-label text-md-right col-md-4 col-lg-3\">Provider</label>\n <div class=\"col-md-5\">\n <ng-select placeholder=\"Select Provider\" bindLabel=\"provider_name\"\n bindValue=\"id\" [items]=\"vendorProviders\"\n (change)=\"changeVendorProvider($event)\">\n </ng-select>\n </div>\n </div> -->\n <!-- <pre>{{fieldsArray|json}}</pre> -->\n <formly-form [fields]=\"fieldsArray\" [model]=\"fieldsModel\" [form]=\"detailsForm\">\n </formly-form>\n </div>\n </div>\n }\n \n @if (fieldsArray.length === 0) {\n <sdk-no-data title=\"LABEL_FIELDS_NOT_AVAILABLE\"></sdk-no-data>\n }\n </div>\n </div>\n <div class=\"card-footer bg-light text-right\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"back()\">\n {{'COMMON_LABEL_CANCEL' | translate}}\n </button>\n @if (buttonData) {\n <button type=\"submit\" class=\"btn btn-primary\"\n [ngClass]=\"{'qt-loader qt-loader-mini qt-loader-left': showLoader}\"\n [disabled]=\"showLoader || isFormIncomplete()\">\n {{ buttonData?.field_title }}\n </button>\n }\n </div>\n </form>\n </div>\n </div>\n </div>\n </section>\n </div>\n}" }]
|
|
3162
3177
|
}], ctorParameters: () => [] });
|
|
3163
3178
|
|
|
3164
3179
|
const REGION_COMMUNE_DATA = {
|
|
@@ -3767,7 +3782,6 @@ class ViewBillsComponent {
|
|
|
3767
3782
|
this.topupAndBillpaymentService.workFlowUserInput.pipe(takeUntil(this.destroy$)).subscribe((data) => {
|
|
3768
3783
|
if (isNotNull(data)) {
|
|
3769
3784
|
this.workFlowUserInput = data;
|
|
3770
|
-
console.log("workFlowUserInput==>", this.workFlowUserInput);
|
|
3771
3785
|
if (data?.length > 1) {
|
|
3772
3786
|
const latestNumericValue = data?.find((element) => element['value'] && typeof element['value'] === 'number')?.value || null;
|
|
3773
3787
|
this.userAmount = latestNumericValue;
|
|
@@ -3827,6 +3841,7 @@ class ViewBillsComponent {
|
|
|
3827
3841
|
this.showLoader = false;
|
|
3828
3842
|
if (res?.success) {
|
|
3829
3843
|
this.billsData = res?.data;
|
|
3844
|
+
this.showLoader = false;
|
|
3830
3845
|
}
|
|
3831
3846
|
else {
|
|
3832
3847
|
this.toasterService.error(this.translationService.translate(res?.error[0]));
|
|
@@ -5898,6 +5913,7 @@ class TopupAndBillpaymentReviewComponent extends TransactionClass {
|
|
|
5898
5913
|
this.back();
|
|
5899
5914
|
}
|
|
5900
5915
|
}).catch(() => undefined);
|
|
5916
|
+
this.topupAndBillpaymentService?.deleteWorkflowUserInput();
|
|
5901
5917
|
}
|
|
5902
5918
|
removeunderScore(value) {
|
|
5903
5919
|
return value.replace(/_/g, ' ').split(' ').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(' ');
|
package/package.json
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "digipay-utility-payment",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@angular/common": "^20.
|
|
6
|
-
"@angular/core": "^20.
|
|
5
|
+
"@angular/common": "^20.0.0",
|
|
6
|
+
"@angular/core": "^20.0.0",
|
|
7
|
+
"@ng-select/ng-select": "^15.1.3",
|
|
8
|
+
"@ngx-formly/bootstrap": "^7.0.0",
|
|
9
|
+
"@ngx-formly/core": "^7.0.0",
|
|
10
|
+
"ngx-toastr": "^19.0.0",
|
|
11
|
+
"lodash": "^4.17.21",
|
|
12
|
+
"rxjs": "^7.8.0"
|
|
7
13
|
},
|
|
8
14
|
"dependencies": {
|
|
9
15
|
"@popperjs/core": "^2.11.8",
|