ng-easycommerce 0.0.415 → 0.0.418
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/README.md +17 -0
- package/assets/decidirFormEc.html +4 -35
- package/assets/ec-i18n/en.json +2 -1
- package/assets/ec-i18n/es.json +2 -1
- package/bundles/ng-easycommerce.umd.js +41 -31
- package/bundles/ng-easycommerce.umd.js.map +1 -1
- package/bundles/ng-easycommerce.umd.min.js +1 -1
- package/bundles/ng-easycommerce.umd.min.js.map +1 -1
- package/esm2015/lib/core.consts.js +4 -3
- package/esm2015/lib/ec-component/auth-ec/login-form-ec/login-form-ec.component.js +1 -3
- package/esm2015/lib/ec-component/login-ec/login-ec.component.js +1 -3
- package/esm2015/lib/ec-component/seller-dashboard-container-ec/seller-dashboard-container-ec.component.js +2 -2
- package/esm2015/lib/ec-component/widgets-ec/decidir-ec/decidir-ec.component.js +15 -4
- package/esm2015/lib/interceptors/auth.interceptor.js +3 -3
- package/esm2015/lib/interceptors/customer.interceptor.js +4 -4
- package/esm2015/lib/services/channel-config.service.js +5 -7
- package/esm2015/lib/services/checkout/addressing.service.js +4 -5
- package/esm2015/lib/services/checkout/checkout.service.js +10 -8
- package/esm2015/lib/services/checkout/error-handler.service.js +4 -1
- package/esm5/lib/core.consts.js +3 -2
- package/esm5/lib/ec-component/auth-ec/login-form-ec/login-form-ec.component.js +1 -3
- package/esm5/lib/ec-component/login-ec/login-ec.component.js +1 -3
- package/esm5/lib/ec-component/seller-dashboard-container-ec/seller-dashboard-container-ec.component.js +2 -2
- package/esm5/lib/ec-component/widgets-ec/decidir-ec/decidir-ec.component.js +16 -4
- package/esm5/lib/interceptors/auth.interceptor.js +3 -3
- package/esm5/lib/interceptors/customer.interceptor.js +4 -4
- package/esm5/lib/services/channel-config.service.js +5 -7
- package/esm5/lib/services/checkout/addressing.service.js +4 -5
- package/esm5/lib/services/checkout/checkout.service.js +10 -8
- package/esm5/lib/services/checkout/error-handler.service.js +4 -1
- package/fesm2015/ng-easycommerce.js +41 -32
- package/fesm2015/ng-easycommerce.js.map +1 -1
- package/fesm5/ng-easycommerce.js +41 -31
- package/fesm5/ng-easycommerce.js.map +1 -1
- package/lib/ec-component/widgets-ec/decidir-ec/decidir-ec.component.d.ts +5 -1
- package/lib/services/checkout/addressing.service.d.ts +3 -3
- package/lib/services/checkout/checkout.service.d.ts +2 -2
- package/ng-easycommerce.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -383,12 +383,13 @@ let Constants = class Constants {
|
|
|
383
383
|
customType && (this.currency = Object.assign(Object.assign({}, this.currency), customType));
|
|
384
384
|
return this.currency;
|
|
385
385
|
};
|
|
386
|
-
this.modifyChannelConfig =
|
|
387
|
-
console.log("Channel config: ", channelConfig);
|
|
386
|
+
this.modifyChannelConfig = channelConfig => {
|
|
388
387
|
if (channelConfig.channel || channelConfig.code)
|
|
389
388
|
this.setChannel(channelConfig.channel || channelConfig.code);
|
|
390
389
|
if (channelConfig.locale || channelConfig.locales.code)
|
|
391
390
|
this.setLocale(channelConfig.locale || channelConfig.locales.code);
|
|
391
|
+
if (channelConfig.currency || channelConfig.baseCurrency)
|
|
392
|
+
this.setCurrency(channelConfig.currency || channelConfig.baseCurrency);
|
|
392
393
|
return channelConfig;
|
|
393
394
|
};
|
|
394
395
|
}
|
|
@@ -2391,6 +2392,9 @@ let ErrorHandlerService = class ErrorHandlerService {
|
|
|
2391
2392
|
case 'channel_access_permission_denied':
|
|
2392
2393
|
this.channeAccessPermissionDenied(error);
|
|
2393
2394
|
break;
|
|
2395
|
+
case 'user_disabled':
|
|
2396
|
+
this.otherErrors(error);
|
|
2397
|
+
break;
|
|
2394
2398
|
default:
|
|
2395
2399
|
this.otherErrors(error);
|
|
2396
2400
|
break;
|
|
@@ -2448,7 +2452,7 @@ var __awaiter$1 = (this && this.__awaiter) || function (thisArg, _arguments, P,
|
|
|
2448
2452
|
});
|
|
2449
2453
|
};
|
|
2450
2454
|
let CheckoutService = class CheckoutService {
|
|
2451
|
-
constructor(connection, cartService, consts, toastrService, orderUtils, analyticsService, authService, router,
|
|
2455
|
+
constructor(connection, cartService, consts, toastrService, orderUtils, analyticsService, authService, router, errorHandler) {
|
|
2452
2456
|
this.connection = connection;
|
|
2453
2457
|
this.cartService = cartService;
|
|
2454
2458
|
this.consts = consts;
|
|
@@ -2457,7 +2461,7 @@ let CheckoutService = class CheckoutService {
|
|
|
2457
2461
|
this.analyticsService = analyticsService;
|
|
2458
2462
|
this.authService = authService;
|
|
2459
2463
|
this.router = router;
|
|
2460
|
-
this.
|
|
2464
|
+
this.errorHandler = errorHandler;
|
|
2461
2465
|
this.baseApi = () => 'shop-api/' + this.consts.getChannel() + '/checkout/' + this.cartService.getCartToken();
|
|
2462
2466
|
this.getPaymentMethodsApi = () => this.baseApi() + '/payment';
|
|
2463
2467
|
this.putAddressApi = () => this.baseApi() + '/address';
|
|
@@ -2593,11 +2597,13 @@ let CheckoutService = class CheckoutService {
|
|
|
2593
2597
|
this.cartService.cart.subscribe(cart => cart && (this.cartLocal = cart) && this.updateAsociatedData(cart));
|
|
2594
2598
|
this.order$.subscribe(order => order && this.updateAsociatedData(order));
|
|
2595
2599
|
this.authService.getUserProfile().subscribe(user => this.user = user);
|
|
2596
|
-
this.
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2600
|
+
this.errorHandler.error$.pipe(filter(res => res != null)).subscribe(res => {
|
|
2601
|
+
if (res.code == 'out_of_stock' || res.code == 'items_with_product_or_product_variant_not_enabled') {
|
|
2602
|
+
this.toastrService.show('redirect-cart');
|
|
2603
|
+
setTimeout(() => {
|
|
2604
|
+
this.router.navigateByUrl('/cart');
|
|
2605
|
+
}, 3000);
|
|
2606
|
+
}
|
|
2601
2607
|
});
|
|
2602
2608
|
}
|
|
2603
2609
|
ngOnInit() {
|
|
@@ -2691,7 +2697,7 @@ let AddressingService = class AddressingService extends StepService {
|
|
|
2691
2697
|
this.addressBookApi = () => 'shop-api/' + this.consts.getChannel() + '/address-book';
|
|
2692
2698
|
this.headquarterApi = () => 'shop-api/' + this.consts.getChannel() + '/checkout/' + this.cartService.getCartToken() + '/headquarter';
|
|
2693
2699
|
this.typeForms = 'ARG';
|
|
2694
|
-
this.modeSelectAddress = '
|
|
2700
|
+
this.modeSelectAddress = 'LOAD_ADDRESS_AND_SELECTION';
|
|
2695
2701
|
this.countriesList = [];
|
|
2696
2702
|
this.documentTypes = [];
|
|
2697
2703
|
this.provinceList = [];
|
|
@@ -2836,9 +2842,8 @@ let AddressingService = class AddressingService extends StepService {
|
|
|
2836
2842
|
];
|
|
2837
2843
|
return formsTypeCofig.find(ct => ct.code == this.typeForms);
|
|
2838
2844
|
};
|
|
2839
|
-
this.
|
|
2840
|
-
|
|
2841
|
-
this.modeSelectAddress = type && type || 'ONLY_LOAD_ADDRESS';
|
|
2845
|
+
this.setTypeSelectAddress = (type) => {
|
|
2846
|
+
this.modeSelectAddress = type && type || 'LOAD_ADDRESS_AND_SELECTION';
|
|
2842
2847
|
};
|
|
2843
2848
|
this.setTypeForms = (type) => {
|
|
2844
2849
|
this.typeForms = type && type || 'ARG';
|
|
@@ -2894,7 +2899,7 @@ let ChannelConfigService = class ChannelConfigService {
|
|
|
2894
2899
|
this.localesSubject = new BehaviorSubject([]);
|
|
2895
2900
|
this.locales = this.localesSubject.asObservable();
|
|
2896
2901
|
this.getChannelConfig = () => {
|
|
2897
|
-
this.connection.get(this.channelConfigApi()).toPromise().then(res => { this.channelConfigSubject.next(res), res && this.
|
|
2902
|
+
this.connection.get(this.channelConfigApi()).toPromise().then(res => { this.channelConfigSubject.next(res), res && this.changeChannel(res); }, err => this.channelConfigSubject.next({})).catch(err => this.channelConfigSubject.next(null));
|
|
2898
2903
|
};
|
|
2899
2904
|
this.getChannels = () => {
|
|
2900
2905
|
this.connection.get(this.channelsApi()).toPromise()
|
|
@@ -2907,14 +2912,12 @@ let ChannelConfigService = class ChannelConfigService {
|
|
|
2907
2912
|
.catch(err => this.localesSubject.next([]));
|
|
2908
2913
|
};
|
|
2909
2914
|
this.changeChannel = channelObj => {
|
|
2910
|
-
console.log("Channel: ", channelObj);
|
|
2911
2915
|
this.consts.modifyChannelConfig({
|
|
2912
2916
|
channel: channelObj.code,
|
|
2913
|
-
locale: channelObj.defaultLocale.code
|
|
2914
|
-
|
|
2915
|
-
/* currency: channelObj.baseCurrency */
|
|
2917
|
+
locale: channelObj.defaultLocale.code,
|
|
2918
|
+
currency: channelObj.baseCurrency
|
|
2916
2919
|
});
|
|
2917
|
-
this.injector.get(AddressingService).
|
|
2920
|
+
this.injector.get(AddressingService).setTypeSelectAddress(channelObj.headquarterSelectionOnly || 'LOAD_ADDRESS_AND_SELECTION');
|
|
2918
2921
|
};
|
|
2919
2922
|
this.getChannelConfig();
|
|
2920
2923
|
this.getChannels();
|
|
@@ -4409,11 +4412,11 @@ let AuthInterceptor = class AuthInterceptor {
|
|
|
4409
4412
|
return next.handle(req).pipe(catchError(catchErr => this.handleErrors(catchErr)));
|
|
4410
4413
|
}
|
|
4411
4414
|
handleErrors(err) {
|
|
4412
|
-
if (err.status ===
|
|
4415
|
+
if (err.status === 403) {
|
|
4413
4416
|
this.injector.get(AuthService).doLogoutUser();
|
|
4414
4417
|
return of(err);
|
|
4415
4418
|
}
|
|
4416
|
-
if (err.status === 450) {
|
|
4419
|
+
if (err.status === 450 || err.status === 401) {
|
|
4417
4420
|
this.injector.get(ErrorHandlerService).handlerErrorResponse(err.error);
|
|
4418
4421
|
return of(err.error);
|
|
4419
4422
|
}
|
|
@@ -4451,11 +4454,11 @@ let CustomerInterceptor = class CustomerInterceptor {
|
|
|
4451
4454
|
return next.handle(req).pipe(catchError(catchErr => this.handleErrors(catchErr)));
|
|
4452
4455
|
}
|
|
4453
4456
|
handleErrors(err) {
|
|
4454
|
-
if (err.status ===
|
|
4455
|
-
this.injector.get(AuthService).
|
|
4457
|
+
if (err.status === 403) {
|
|
4458
|
+
this.injector.get(AuthService).doLogoutUser();
|
|
4456
4459
|
return of(err);
|
|
4457
4460
|
}
|
|
4458
|
-
if (err.status === 450) {
|
|
4461
|
+
if (err.status === 450 || err.status === 401) {
|
|
4459
4462
|
this.injector.get(ErrorHandlerService).handlerErrorResponse(err.error);
|
|
4460
4463
|
return of(err.error);
|
|
4461
4464
|
}
|
|
@@ -6424,12 +6427,10 @@ let LoginEcComponent = class LoginEcComponent extends ComponentHelper {
|
|
|
6424
6427
|
}
|
|
6425
6428
|
else {
|
|
6426
6429
|
this.loading = false;
|
|
6427
|
-
this.toastrService.show('invalid-credentials');
|
|
6428
6430
|
}
|
|
6429
6431
|
}, err => {
|
|
6430
6432
|
$('#collapse_login5').collapse('hide');
|
|
6431
6433
|
this.loading = false;
|
|
6432
|
-
this.toastrService.show('invalid-credentials');
|
|
6433
6434
|
});
|
|
6434
6435
|
};
|
|
6435
6436
|
this.ecOnConstruct();
|
|
@@ -7392,7 +7393,7 @@ __decorate$17([
|
|
|
7392
7393
|
SellerDashboardContainerEcComponent = __decorate$17([
|
|
7393
7394
|
Component({
|
|
7394
7395
|
selector: 'app-seller-dashboard-container',
|
|
7395
|
-
template: "<section *ngIf=\"user\" id=\"seller-dashboard\">\n <div class=\"section-content mt-5 mb-2 tablaVendedores\">\n <div class=\"container-xl\">\n <div class=\"row\">\n <main class=\"col-md-12\">\n\n <ul *ngIf=\"hasHeader()\" class=\"nav nav-tabs\">\n <li class=\"nav-item col-12 col-lg-2\">\n <a *ngIf=\"hasUIComponent('HEADER_TAB')\" class=\"nav-link active cursor-pointer px-4\"\n aria-current=\"page\">\n {{ 'my-clients' | translate }}\n </a>\n </li>\n <div\n
|
|
7396
|
+
template: "<section *ngIf=\"user\" id=\"seller-dashboard\">\n <div class=\"section-content mt-5 mb-2 tablaVendedores\">\n <div class=\"container-xl\">\n <div class=\"row\">\n <main class=\"col-md-12\">\n\n <ul *ngIf=\"hasHeader()\" class=\"nav nav-tabs\">\n <li class=\"nav-item col-12 col-lg-2\">\n <a *ngIf=\"hasUIComponent('HEADER_TAB')\" class=\"nav-link active cursor-pointer px-4\"\n aria-current=\"page\">\n {{ 'my-clients' | translate }}\n </a>\n </li>\n <li class=\"ms-auto row\">\n <div\n class=\"d-flex justify-content-end justify-content-lg-end justify-content-xl-end col-12 col-md-12 col-lg-auto\">\n <ng-container *ngIf=\"hasUIComponent('GENERATE_BUDGET_BTN') \">\n <a *ngIf=\"authService.getCustomer()?.id; else withoutCustomer\"\n [routerLink]=\"'/collection'\"\n class=\"btn btn-seller-primary text-white btnGestionar d-flex align-items-center\"><i\n class=\"bi bi-file-earmark me-2 mr-2\"></i>{{ 'generate-budget' | translate }}\n </a>\n <ng-template #withoutCustomer>\n <a class=\"btn btn-seller-primary text-white btnGestionar d-flex align-items-center\"\n (click)=\"toastrService.show('must-select-customer')\">\n <i class=\"bi bi-file-earmark me-2 mr-2\"></i>{{ 'generate-budget' | translate\n }}\n </a>\n </ng-template>\n </ng-container>\n <a *ngIf=\"hasUIComponent('MANAGE_ORDERS_BTN')\"\n (click)=\"navigateExternal(constants.getUrlBase())\"\n class=\"btn btn-seller-primary text-white btnGestionar d-flex align-items-center me- me-lg-4 mr- mr-lg-4\"><i\n class=\"bi bi-archive-fill me-2 mr-2\"></i>{{ 'manage-orders' | translate }}</a>\n </div>\n <div class=\"d-flex camposVendedores col-12 col-md-12 col-lg-auto justify-content-end\">\n <select *ngIf=\"hasUIComponent('SORT_SELECT')\" id=\"customerSort\" name=\"customerSort\"\n (change)=\"sortCustomers($event.target.value)\" class=\"mb-1 ordenarVendedores\">\n <option selected hidden disabled>{{ 'order-by' | translate }}</option>\n <option value='asc_firstName'>{{ 'client' | translate }} (A-Z)</option>\n <option value='desc_firstName'>{{ 'client' | translate }} (Z-A)</option>\n <option value='asc_id'>Menor a Mayor c\u00F3digo</option>\n <option value='desc_id'>Mayor a Menor c\u00F3digo</option>\n </select>\n <form *ngIf=\"hasUIComponent('SEARCH_FORM')\"\n class=\"col-lg-auto mb-lg-0 d-flex ms-3 ml-3 d-flex buscadorVendedores\">\n <input type=\"text\" name=\"searchInput\" class=\"form-control\"\n placeholder=\"{{ 'search' | translate }}\" [(ngModel)]=\"searchInput\"\n (keyup.enter)=\"updateCustomers()\">\n <button class=\"btn btn-primary ms-1 ml-1 bg-white border-dark btnSearch\"><i\n class=\"bi bi-search text-dark\" (click)=\"updateCustomers()\"></i></button>\n </form>\n </div>\n </li>\n </ul>\n\n <ng-container *ngIf=\"user.customers?.length; else noCustomers\">\n\n <article class=\"card card-body mb-1 carritoProductoHeader m-0 py-0 mt-4\">\n <div class=\"row align-items-center font-bold border-bottom\">\n <div class=\"col-3 col-md-2 text-left\">\n <small>{{ 'code' | translate | uppercase }}</small>\n </div>\n <div class=\"col-5 col-md-3 mb-md-0\">\n <small>{{ 'client' | translate | uppercase }}</small>\n </div>\n <div class=\"col-4 col-md-3 text-left d-none d-md-block\">\n <small>{{ 'user' | translate | uppercase }}</small>\n </div>\n <div class=\"col-4 col-md-2 text-left\">\n <small>{{ 'new-orders' | translate | uppercase }}</small>\n </div>\n <div class=\"col-2 col-md-2 text-left d-none d-md-block\">\n <small></small>\n </div>\n\n </div>\n </article>\n\n <article *ngFor=\"let customer of filteredCustomers\" class=\"card card-body mb-3 cadaVendedor\">\n <div class=\"row d-flex align-items-center\">\n <div class=\"col-3 col-md-2 text-left ps-2 pl-2\">\n <div class=\"price h6 pb-0 mb-0 ps-3 pl-1\">\n {{ customer.managementSystemInternalCode || 'n/a' }}\n </div>\n </div>\n <div class=\"col-5 col-md-3 text-left\">\n <div class=\"price h6 fw-normal ps-2 pl-2 pb-0 mb-0\">\n {{ customer.firstName }} {{ customer.lastName }}\n <p class=\"d-block d-md-none fs-6 mt-1 mb-0 p-0 userMobile\">\n {{ customer.email }}\n </p>\n </div>\n </div>\n <div class=\"col-4 col-md-3 text-left d-none d-md-block\">\n <div class=\"price h6 fw-normal pb-0 mb-0 ps-2 pl-2\">\n {{ customer.email }}\n </div>\n </div>\n <div class=\"col-4 col-md-2 text-left ps-2 pl-2\">\n <div *ngIf=\"true\" class=\"contNumero\">\n {{ customer.ordersNotApproved }}\n </div>\n </div>\n <div class=\"col-12 col-md-2 btnIngresar\">\n\n <ng-container\n *ngIf=\"authService.getCustomer()?.id == customer.id; else noActiveCustomer\">\n <a (click)=\"changeCustomer(null)\"\n class=\"btn btn-seller-primary justify-content-center\">\n <i class=\"bi bi-box-arrow-left me-2 mr-2\"></i>\n <small class=\"me-2 mr-2 d-none d-md-block\">\n {{ 'exit' | translate | uppercase }}\n </small>\n </a>\n </ng-container>\n <ng-template #noActiveCustomer>\n <a (click)=\"changeCustomer(customer)\"\n class=\"btn btn-seller-primary justify-content-center\">\n <i class=\"bi bi-box-arrow-in-right me-2 mr-2\"></i>\n <small class=\"me-2 mr-2 d-none d-md-block\">\n {{ 'operate-as' | translate | uppercase }}\n </small>\n </a>\n </ng-template>\n\n </div>\n </div>\n </article>\n\n </ng-container>\n\n </main>\n </div>\n </div>\n </div>\n</section>\n\n<ng-template #noCustomers>\n <h4 class=\"text-center p-5\">{{ 'no-customers' | translate }}</h4>\n</ng-template>",
|
|
7396
7397
|
styles: ["#seller-dashboard{--seller-dashboard-primary-color:0,0,0}.btn-seller-primary{color:#fff!important;background-color:rgba(var(--seller-dashboard-primary-color),1)!important;border-color:rgba(var(--seller-dashboard-primary-color),1)!important}.btn-seller-primary:hover{background-color:rgba(var(--seller-dashboard-primary-color),.9)!important}.btn-seller-primary:active{background-color:rgba(var(--seller-dashboard-primary-color),.8)!important}.btnGestionar{padding:6px 12px!important;height:36px;display:flex;align-items:center;justify-content:center;margin-left:10px}.ordenarVendedores{width:150px!important;color:#8b8b8b!important;background-color:#fff;border:1px solid #b6b6b6!important;border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px}.buscadorVendedores{margin-bottom:4px!important}.buscadorVendedores input{border:1px solid #b6b6b6!important;width:200px}.buscadorVendedores .btnSearch{border:1px solid #b6b6b6!important;padding:.375rem .75rem;font-size:1rem}.buscadorVendedores .btnSearch:focus{background-color:#fff!important}.carritoProductoHeader{border:none!important}.carritoProductoHeader small{font-size:13px}.cadaVendedor{padding:5px 0;margin-bottom:0!important;border:none!important;border-bottom:1px solid #ccc!important;border-radius:0!important;-webkit-border-radius:0}.cadaVendedor .btnIngresar a{padding:10px!important;border-width:1px!important;border-style:solid!important;display:flex;align-items:center;width:100%!important;margin-left:auto;color:#fff}.cadaVendedor .btnIngresar .contNumero{background-color:#eee;width:20px;height:20px;color:#000;font-size:13px;display:flex;align-items:center;justify-content:center;font-weight:600;border-radius:20px;-webkit-border-radius:20px;-moz-border-radius:20px;-ms-border-radius:20px;-o-border-radius:20px}.userMobile{font-size:14px!important;font-style:italic!important}.cadaVendedor .btnIngresar a:hover{background-color:rgba(var(--seller-dashboard-primary-color),.85)}.cadaVendedor .btnIngresar a:active{background-color:rgba(var(--seller-dashboard-primary-color),.8)}.cursor-pointer{cursor:pointer}.font-bold{font-weight:700}.border-bottom{border-bottom:1px solid #000!important}@media screen and (max-width:1200px){.btnGestionar{font-size:12px}}@media screen and (max-width:992px){.camposVendedores{justify-content:flex-end;margin-top:8px;margin-bottom:4px}}@media all and (max-width:768px){.ordenarVendedores{width:140px!important}.buscadorVendedores input{width:140px}.cadaVendedor .btnIngresar a{width:70px!important}}@media all and (max-width:576px){.tablaVendedores .nav-tabs .nav-link{font-size:13px;padding:6px!important}.btnGestionar{padding:6px 8px!important;font-size:13px;height:36px;display:flex;align-items:center;justify-content:center;margin-top:3px;margin-left:10px}.buscadorVendedores input,.ordenarVendedores{font-size:13px}}.fs-6{font-size:1rem!important}"]
|
|
7397
7398
|
}),
|
|
7398
7399
|
__param$9(3, Inject('env'))
|
|
@@ -8721,11 +8722,9 @@ let LoginFormEcComponent = class LoginFormEcComponent extends ComponentHelper {
|
|
|
8721
8722
|
return;
|
|
8722
8723
|
}
|
|
8723
8724
|
this.loading = false;
|
|
8724
|
-
this.toastrService.show('invalid-credentials');
|
|
8725
8725
|
}
|
|
8726
8726
|
}, err => {
|
|
8727
8727
|
this.loading = false;
|
|
8728
|
-
this.toastrService.show('invalid-credentials');
|
|
8729
8728
|
});
|
|
8730
8729
|
};
|
|
8731
8730
|
this.redirectHome = () => {
|
|
@@ -10742,7 +10741,7 @@ var __decorate$1E = (this && this.__decorate) || function (decorators, target, k
|
|
|
10742
10741
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10743
10742
|
};
|
|
10744
10743
|
let DecidirEcComponent = class DecidirEcComponent extends ComponentHelper {
|
|
10745
|
-
constructor(renderer, connection, toastrService, consts, cartService, toastr, activedRoute, sanitizer, modalService) {
|
|
10744
|
+
constructor(renderer, connection, toastrService, consts, cartService, toastr, activedRoute, sanitizer, modalService, paramsService) {
|
|
10746
10745
|
super();
|
|
10747
10746
|
this.renderer = renderer;
|
|
10748
10747
|
this.connection = connection;
|
|
@@ -10753,6 +10752,7 @@ let DecidirEcComponent = class DecidirEcComponent extends ComponentHelper {
|
|
|
10753
10752
|
this.activedRoute = activedRoute;
|
|
10754
10753
|
this.sanitizer = sanitizer;
|
|
10755
10754
|
this.modalService = modalService;
|
|
10755
|
+
this.paramsService = paramsService;
|
|
10756
10756
|
this.method = null;
|
|
10757
10757
|
this.total_amount = 0;
|
|
10758
10758
|
this.user_data = null;
|
|
@@ -10761,6 +10761,7 @@ let DecidirEcComponent = class DecidirEcComponent extends ComponentHelper {
|
|
|
10761
10761
|
this.isDobleAuth = false;
|
|
10762
10762
|
this.urls = [];
|
|
10763
10763
|
this.closeModal = '';
|
|
10764
|
+
this.paramsMensaje = '';
|
|
10764
10765
|
this.dataRedirect = () => this.consts.getUrlBase() + 'shop-api/' + this.consts.getChannel() + '/decidir/' + this.cartService.cart_token + '/process-payment';
|
|
10765
10766
|
this.clearStorageState = () => {
|
|
10766
10767
|
sessionStorage.removeItem('state');
|
|
@@ -10784,6 +10785,10 @@ let DecidirEcComponent = class DecidirEcComponent extends ComponentHelper {
|
|
|
10784
10785
|
if (state == 'success') {
|
|
10785
10786
|
this.ready.emit(true);
|
|
10786
10787
|
}
|
|
10788
|
+
if (state == 'partially_authorized') {
|
|
10789
|
+
this.ready.emit(true);
|
|
10790
|
+
this.processError(this.paramsMensaje);
|
|
10791
|
+
}
|
|
10787
10792
|
if (state == 'cancel') {
|
|
10788
10793
|
return;
|
|
10789
10794
|
}
|
|
@@ -10819,6 +10824,10 @@ let DecidirEcComponent = class DecidirEcComponent extends ComponentHelper {
|
|
|
10819
10824
|
}
|
|
10820
10825
|
ngOnInit() {
|
|
10821
10826
|
this.getCheckoutDecidir();
|
|
10827
|
+
this.paramsService.parameters.subscribe(res => {
|
|
10828
|
+
this.params = res;
|
|
10829
|
+
this.paramsMensaje = this.hasParams(res, 'partially_authorized_decidir') || 'Se está procesando el pago con tarjeta.';
|
|
10830
|
+
});
|
|
10822
10831
|
this.ecOnInit();
|
|
10823
10832
|
}
|
|
10824
10833
|
ngOnDestroy() {
|
|
@@ -10831,7 +10840,6 @@ let DecidirEcComponent = class DecidirEcComponent extends ComponentHelper {
|
|
|
10831
10840
|
this.clearStorageState();
|
|
10832
10841
|
localStorage.setItem('dataRedirect', this.dataRedirect());
|
|
10833
10842
|
localStorage.setItem('dataDecidir', JSON.stringify(this.method));
|
|
10834
|
-
console.log('dataaaaa', this.method);
|
|
10835
10843
|
this.modalRef = this.modalService.show(template, { class: 'modal-xl modal-dialog-centered ', keyboard: false, backdrop: 'static', animated: true });
|
|
10836
10844
|
this.closeModal = '';
|
|
10837
10845
|
this.callState();
|
|
@@ -10846,7 +10854,8 @@ DecidirEcComponent.ctorParameters = () => [
|
|
|
10846
10854
|
{ type: ToastService },
|
|
10847
10855
|
{ type: ActivatedRoute },
|
|
10848
10856
|
{ type: DomSanitizer },
|
|
10849
|
-
{ type: BsModalService }
|
|
10857
|
+
{ type: BsModalService },
|
|
10858
|
+
{ type: ParametersService }
|
|
10850
10859
|
];
|
|
10851
10860
|
__decorate$1E([
|
|
10852
10861
|
Input()
|