ng-easycommerce-v18 0.2.14 → 0.2.16

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.
@@ -1,14 +1,17 @@
1
1
  import { OnInit } from '@angular/core';
2
+ import { PaymentService } from '../../../ec-services';
2
3
  import * as i0 from "@angular/core";
3
4
  export declare class PaymentEcComponent implements OnInit {
4
- private _paymentService;
5
+ _paymentService: PaymentService;
5
6
  private _checkoutService;
7
+ private _cartService;
6
8
  private _methodDataSubject;
7
9
  private _loadingSubject;
8
10
  methods$: import("rxjs").Observable<any[]>;
9
11
  loading$: import("rxjs").Observable<boolean>;
10
12
  methodData$: import("rxjs").Observable<any>;
11
13
  loadingInternal: boolean;
14
+ total_amount: number;
12
15
  constructor();
13
16
  ngOnInit(): void;
14
17
  setActive($event: any): void;
@@ -0,0 +1,59 @@
1
+ import { OnInit, Renderer2, OnChanges, EventEmitter, OnDestroy } from '@angular/core';
2
+ import { ActivatedRoute } from '@angular/router';
3
+ import { ComponentHelper } from "../../../classes/component-helper";
4
+ import { ConnectionService } from '../../../api/connection.service';
5
+ import { ToastService } from '../../../ec-services/toast.service';
6
+ import { CoreConstantsService, ApiConstantsService } from '../../../constants';
7
+ import { CartService } from '../../../ec-services/cart.service';
8
+ import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
9
+ import { ParametersService } from '../../../ec-services/parameters.service';
10
+ import * as i0 from "@angular/core";
11
+ export declare class DecidirEcComponent extends ComponentHelper implements OnInit, OnDestroy, OnChanges {
12
+ renderer: Renderer2;
13
+ connection: ConnectionService;
14
+ toastrService: ToastService;
15
+ consts: CoreConstantsService;
16
+ apiConsts: ApiConstantsService;
17
+ cartService: CartService;
18
+ activedRoute: ActivatedRoute;
19
+ sanitizer: DomSanitizer;
20
+ paramsService: ParametersService;
21
+ paymentServiceInst: any;
22
+ method: {
23
+ description?: string;
24
+ instructions?: string;
25
+ code?: string;
26
+ } | null;
27
+ total_amount: number;
28
+ allData: any;
29
+ user_data: null;
30
+ ready: EventEmitter<any>;
31
+ protected modalRef: any | null;
32
+ protected dataDecidir: any;
33
+ loading: boolean;
34
+ isDobleAuth: boolean;
35
+ urls: any[];
36
+ url: SafeResourceUrl | undefined;
37
+ closeModal: string;
38
+ paramsMensaje: string;
39
+ ventana: any;
40
+ params: any;
41
+ showModal: boolean;
42
+ protected dataRedirect: () => string;
43
+ constructor(renderer: Renderer2, connection: ConnectionService, toastrService: ToastService, consts: CoreConstantsService, apiConsts: ApiConstantsService, cartService: CartService, activedRoute: ActivatedRoute, sanitizer: DomSanitizer, paramsService: ParametersService);
44
+ ngOnInit(): void;
45
+ ngOnDestroy(): void;
46
+ ngOnChanges(): void;
47
+ openModal(): void;
48
+ clearStorageState: () => void;
49
+ clickClose: () => void;
50
+ showMessage: () => void;
51
+ callState: () => void;
52
+ processError: (err: any) => void;
53
+ getCheckoutDecidir: () => void;
54
+ handleIframeMessage: (event: MessageEvent) => void;
55
+ processPayment: (paymentData: any) => void;
56
+ resizeIframe: (obj: any) => void;
57
+ static ɵfac: i0.ɵɵFactoryDeclaration<DecidirEcComponent, never>;
58
+ static ɵcmp: i0.ɵɵComponentDeclaration<DecidirEcComponent, "app-decidir-ec", never, { "paymentServiceInst": { "alias": "paymentServiceInst"; "required": false; }; "method": { "alias": "method"; "required": false; }; "total_amount": { "alias": "total_amount"; "required": false; }; "allData": { "alias": "allData"; "required": false; }; "user_data": { "alias": "user_data"; "required": false; }; }, { "ready": "ready"; }, never, never, true, never>;
59
+ }
@@ -44,12 +44,13 @@ export declare class CartService {
44
44
  couponApi(): string;
45
45
  constructor();
46
46
  /**
47
- * Inicializa el carrito con los datos del local storage en caso de que existan o no.
47
+ * Sincroniza el carrito cuando el usuario hace login
48
+ * Implementa la lógica de Angular 9 para preservar el carrito del invitado
48
49
  */
49
- private initializeDataCart;
50
+ private syncCartOnLogin;
50
51
  /**
51
- * Obtiene el carrito desde el backend y lo inicializa.
52
- * Si existe el cartToken y hay items en el carrito, envía el token como parámetro.
52
+ * Obtiene el carrito desde el backend con lógica de sincronización
53
+ * Envía el token si hay carrito local para fusionar carritos
53
54
  */
54
55
  private getCart;
55
56
  /**
@@ -24,7 +24,7 @@ export declare class CheckoutService {
24
24
  order$: Observable<any>;
25
25
  loadingStep$: Observable<boolean>;
26
26
  total: any;
27
- private cartLocal;
27
+ cartLocal: any;
28
28
  private checkoutData;
29
29
  private order;
30
30
  baseApi: () => string;
@@ -17,6 +17,8 @@ export declare class PaymentService {
17
17
  putPayment(method: any): Promise<any>;
18
18
  getPreference(shipment_data: any): Promise<any>;
19
19
  setPayment(data: any): void;
20
+ getUserData: () => any;
21
+ getShipmentData: () => any;
20
22
  static ɵfac: i0.ɵɵFactoryDeclaration<PaymentService, never>;
21
23
  static ɵprov: i0.ɵɵInjectableDeclaration<PaymentService>;
22
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ng-easycommerce-v18",
3
- "version": "0.2.14",
3
+ "version": "0.2.16",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^18.2.0",
6
6
  "@angular/core": "^18.2.0"