@osovitny/anatoly 3.19.31 → 3.19.33

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,2 +1,2 @@
1
1
  import { BuyAccessButtonComponent, SubscribePlanButtonComponent, OrderSummaryComponent, PaymentMethodsComponent, PaymentOptionsComponent, BraintreeDialog, PaypalButtonComponent, PaypalSubscribeButtonComponent, PayPalComponent, StripeDialog } from "./exports";
2
- export declare const COMPONENTS: (typeof BuyAccessButtonComponent | typeof SubscribePlanButtonComponent | typeof OrderSummaryComponent | typeof PaymentMethodsComponent | typeof PaymentOptionsComponent | typeof BraintreeDialog | typeof PaypalButtonComponent | typeof PaypalSubscribeButtonComponent | typeof PayPalComponent | typeof StripeDialog)[];
2
+ export declare const COMPONENTS: (typeof StripeDialog | typeof PaypalSubscribeButtonComponent | typeof PaypalButtonComponent | typeof BraintreeDialog | typeof BuyAccessButtonComponent | typeof SubscribePlanButtonComponent | typeof OrderSummaryComponent | typeof PaymentMethodsComponent | typeof PaymentOptionsComponent | typeof PayPalComponent)[];
@@ -1,6 +1,6 @@
1
1
  import { ComponentBase } from "../../../ui/components/base/components/component";
2
2
  import { PaymentsService } from "../../services/payments.service";
3
- import { DiscountCodesApiService } from "../../../data/services/billing/discountcodes-api.service";
3
+ import { PromoCodesApiService } from "../../../data/services/billing/promocodes-api.service";
4
4
  import { NotificationService } from "../../../core/notifications/services/notification-service";
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class OrderSummaryComponent extends ComponentBase {
@@ -10,7 +10,7 @@ export declare class OrderSummaryComponent extends ComponentBase {
10
10
  showPromoCode: boolean;
11
11
  promoCode: any;
12
12
  discount: any;
13
- constructor(ps: PaymentsService, api: DiscountCodesApiService, ns: NotificationService);
13
+ constructor(ps: PaymentsService, api: PromoCodesApiService, ns: NotificationService);
14
14
  ngOnInit(): void;
15
15
  private setDefaults;
16
16
  private setValues;
@@ -1,9 +1,11 @@
1
1
  import { DialogBase } from '../../../../ui/components/base/dialog';
2
2
  import { PaymentsService } from '../../../services/payments.service';
3
3
  import { NotificationService } from '../../../../core/notifications/services/notification-service';
4
+ import { BillingService } from '../../../services/billing.service';
4
5
  import * as i0 from "@angular/core";
5
6
  export declare class BraintreeDialog extends DialogBase {
6
- ps: PaymentsService;
7
+ private bs;
8
+ private ps;
7
9
  private ns;
8
10
  braintreeInstance: any;
9
11
  deviceData: any;
@@ -11,7 +13,7 @@ export declare class BraintreeDialog extends DialogBase {
11
13
  title: any;
12
14
  description: any;
13
15
  image: any;
14
- constructor(ps: PaymentsService, ns: NotificationService);
16
+ constructor(bs: BillingService, ps: PaymentsService, ns: NotificationService);
15
17
  ngOnInit(): void;
16
18
  private setValues;
17
19
  initializeEmbedForm(): void;
@@ -1,13 +1,15 @@
1
1
  import { ComponentBase } from '../../../../ui/components/base/components/component';
2
2
  import { PaymentsService } from '../../../services/payments.service';
3
3
  import { IPayPalConfig } from '../../../models/paypal-models';
4
+ import { BillingService } from '../../../services/billing.service';
4
5
  import * as i0 from "@angular/core";
5
6
  export declare class PaypalButtonComponent extends ComponentBase {
6
- ps: PaymentsService;
7
+ private bs;
8
+ private ps;
7
9
  payPalConfig?: IPayPalConfig;
8
10
  paidForTitle: string;
9
11
  paidFor: any;
10
- constructor(ps: PaymentsService);
12
+ constructor(bs: BillingService, ps: PaymentsService);
11
13
  ngOnInit(): void;
12
14
  private setDefaults;
13
15
  private setValues;
@@ -1,10 +1,8 @@
1
- import { NgZone } from '@angular/core';
2
1
  import { ComponentBase } from '../../../../ui/components/base/components/component';
3
2
  import { IPayPalConfig } from '../../../models/paypal-models';
4
3
  import { BillingService } from '../../../services/billing.service';
5
4
  import * as i0 from "@angular/core";
6
5
  export declare class PaypalSubscribeButtonComponent extends ComponentBase {
7
- private zone;
8
6
  private bs;
9
7
  private _payPalPlanId;
10
8
  payPalConfig?: IPayPalConfig;
@@ -13,13 +11,15 @@ export declare class PaypalSubscribeButtonComponent extends ComponentBase {
13
11
  quantity: any;
14
12
  planId: any;
15
13
  addons: any;
16
- price: any;
17
- totalPrice: any;
18
- constructor(zone: NgZone, bs: BillingService);
14
+ subtotal: any;
15
+ promoCode: any;
16
+ total: any;
17
+ currency: string;
18
+ constructor(bs: BillingService);
19
19
  ngOnInit(): void;
20
20
  private setDefaults;
21
21
  private setValues;
22
22
  private initPayPal;
23
23
  static ɵfac: i0.ɵɵFactoryDeclaration<PaypalSubscribeButtonComponent, never>;
24
- static ɵcmp: i0.ɵɵComponentDeclaration<PaypalSubscribeButtonComponent, "anatoly-billing-paypal-subscribe-button", never, { "payPalPlanId": { "alias": "payPalPlanId"; "required": false; }; "quantity": { "alias": "quantity"; "required": false; }; "planId": { "alias": "planId"; "required": false; }; "addons": { "alias": "addons"; "required": false; }; "price": { "alias": "price"; "required": false; }; "totalPrice": { "alias": "totalPrice"; "required": false; }; }, {}, never, never, false, never>;
24
+ static ɵcmp: i0.ɵɵComponentDeclaration<PaypalSubscribeButtonComponent, "anatoly-billing-paypal-subscribe-button", never, { "payPalPlanId": { "alias": "payPalPlanId"; "required": false; }; "quantity": { "alias": "quantity"; "required": false; }; "planId": { "alias": "planId"; "required": false; }; "addons": { "alias": "addons"; "required": false; }; "subtotal": { "alias": "subtotal"; "required": false; }; "promoCode": { "alias": "promoCode"; "required": false; }; "total": { "alias": "total"; "required": false; }; "currency": { "alias": "currency"; "required": false; }; }, {}, never, never, false, never>;
25
25
  }
@@ -1,8 +1,10 @@
1
1
  import { DialogBase } from '../../../../ui/components/base/dialog';
2
2
  import { PaymentsService } from '../../../services/payments.service';
3
+ import { BillingService } from '../../../services/billing.service';
3
4
  import * as i0 from "@angular/core";
4
5
  export declare class StripeDialog extends DialogBase {
5
- ps: PaymentsService;
6
+ private bs;
7
+ private ps;
6
8
  stripe: any;
7
9
  stripeCheckout: any;
8
10
  sessionId: any;
@@ -10,7 +12,7 @@ export declare class StripeDialog extends DialogBase {
10
12
  title: any;
11
13
  description: any;
12
14
  image: any;
13
- constructor(ps: PaymentsService);
15
+ constructor(bs: BillingService, ps: PaymentsService);
14
16
  ngOnInit(): void;
15
17
  private setValues;
16
18
  initializeEmbedForm(): Promise<void>;
@@ -1,17 +1,33 @@
1
1
  import { NgZone } from '@angular/core';
2
2
  import { SubscriptionsApiService } from '../../data/services/billing/subscriptions-api.service';
3
3
  import { AppContextService } from '../../core/services/appcontext.service';
4
- import { SubscriptionProvider } from '../../core/enums';
4
+ import { PaymentStage, SubscriptionProvider } from '../../core/enums';
5
+ import { PaymentsApiService } from '../../data/services/billing/payments-api.service';
6
+ import { NotificationService } from '../../core/notifications/services/notification-service';
5
7
  import * as i0 from "@angular/core";
6
8
  export declare class BillingService {
7
9
  private zone;
8
10
  private appContext;
9
- private api;
10
- private _subscriptionChange;
11
- readonly _subscriptionChange$: import("rxjs").Observable<any>;
12
- constructor(zone: NgZone, appContext: AppContextService, api: SubscriptionsApiService);
13
- fireSubscriptionChange(paymentInProgress: any, paymentFailed: any): void;
14
- addSubscription(sp: SubscriptionProvider, newSubscriptionId: any, planId: any, addons: any, price: any, totalPrice: any): void;
11
+ private apiPayments;
12
+ private apiSubscriptions;
13
+ private ns;
14
+ private _paymentAdded;
15
+ readonly paymentAdded$: import("rxjs").Observable<any>;
16
+ private _paymentProgress;
17
+ readonly paymentProgress$: import("rxjs").Observable<any>;
18
+ private _subscriptionAdded;
19
+ readonly subscriptionAdded$: import("rxjs").Observable<any>;
20
+ constructor(zone: NgZone, appContext: AppContextService, apiPayments: PaymentsApiService, apiSubscriptions: SubscriptionsApiService, ns: NotificationService);
21
+ firePaymentAdded(isPaymentValid: any, paymentId: any): void;
22
+ firePaymentProgress(paymentStage: any, paymentInProgress: any, isPaymentFailed: any): void;
23
+ fireSubscriptionAdded(paymentInProgress: any, paymentFailed: any): void;
24
+ createStripeSession(amount: any, currency: any, title: any, description: any, image: any): import("rxjs").Observable<any>;
25
+ createBraintreeToken(): import("rxjs").Observable<any>;
26
+ addPayment(paymentMethod: any, paidFor: any, subtotal: any, promoCode: any, total: any, currency: any, pmId: any, pmStatus: any, pmDetails: any): void;
27
+ paymentSuccessful(stage: PaymentStage): void;
28
+ paymentFailed(stage: PaymentStage): void;
29
+ setPaymentProgress(stage: PaymentStage, paymentInProgress: any, isPaymentFailed: any): void;
30
+ addSubscription(sp: SubscriptionProvider, newSubscriptionId: any, planId: any, addons: any, subtotal: any, promoCode: any, total: any, currency: any): void;
15
31
  static ɵfac: i0.ɵɵFactoryDeclaration<BillingService, never>;
16
32
  static ɵprov: i0.ɵɵInjectableDeclaration<BillingService>;
17
33
  }
@@ -1,49 +1,29 @@
1
- import { NgZone } from '@angular/core';
2
- import { PaymentStage } from '../../core/enums/billing';
3
- import { PaymentsApiService } from '../../data/services/billing/payments-api.service';
4
- import { NotificationService } from '../../core/notifications/services/notification-service';
5
- import { GoogleAnalyticsService } from '../../core/services/google-analytics.service';
6
1
  import * as i0 from "@angular/core";
7
2
  export declare class PaymentsService {
8
- private zone;
9
- private api;
10
- private ns;
11
- private ga;
12
- paymentStage: any;
13
- paymentInProgress: boolean;
14
- isPaymentFailed: boolean;
15
3
  selectedPaymentType: any;
16
4
  selectedPaymentMethod: any;
17
5
  subtotal: number;
18
- discountCode: any;
19
- discountPercentage: any;
20
- discountAmount: any;
6
+ promoCode: any;
7
+ promoPercentage: any;
8
+ promoAmount: any;
21
9
  currency: string;
22
- private _discountCodeApplied;
23
- private _paymentAdded;
10
+ private _promoCodeApplied;
11
+ readonly promoCodeApplied$: import("rxjs").Observable<any>;
24
12
  private _showStripeDialog;
25
- private _showBraintreeDialog;
26
- readonly discountCodeApplied$: import("rxjs").Observable<any>;
27
- readonly paymentAdded$: import("rxjs").Observable<any>;
28
13
  readonly showStripeDialog$: import("rxjs").Observable<any>;
14
+ private _showBraintreeDialog;
29
15
  readonly showBraintreeDialog$: import("rxjs").Observable<any>;
30
- constructor(zone: NgZone, api: PaymentsApiService, ns: NotificationService, ga: GoogleAnalyticsService);
31
16
  private setDefaults;
32
17
  private setValues;
33
- private fireDiscountCodeApplied;
34
- private firePaymentAdded;
18
+ private firePromoCodeApplied;
35
19
  init(): void;
36
20
  resetState(): void;
37
21
  getTotal(): number;
38
- applyDiscountCode(data: any): void;
39
- getDiscountCodeAsString(): string;
22
+ applyPromoCode(data: any): void;
23
+ getPromoCodeAsString(): string;
40
24
  openStripePaymentDialog(): void;
41
25
  openBraintreePaymentDialog(): void;
42
26
  closeBraintreePaymentDialog(): void;
43
- createStripeSession(title: any, description: any, image: any): import("rxjs").Observable<any>;
44
- createBraintreeToken(): import("rxjs").Observable<any>;
45
- pay(paidFor: any, pmId: any, pmStatus: any, pmDetails: any): void;
46
- paymentFailed(stage: PaymentStage): void;
47
27
  static ɵfac: i0.ɵɵFactoryDeclaration<PaymentsService, never>;
48
28
  static ɵprov: i0.ɵɵInjectableDeclaration<PaymentsService>;
49
29
  }
@@ -3,7 +3,7 @@ export * from './base/grid/grid-read.service';
3
3
  export * from './base/grid/grid-edit.service';
4
4
  export * from './services/billing/currencies-api.service';
5
5
  export * from './services/billing/currencies-storage.service';
6
- export * from './services/billing/discountcodes-api.service';
6
+ export * from './services/billing/promocodes-api.service';
7
7
  export * from './services/billing/payments-api.service';
8
8
  export * from './services/billing/subscriptions-api.service';
9
9
  export * from './services/billing/transactions-api.service';
@@ -7,7 +7,7 @@ export declare class PaymentsApiService extends ApiServiceBase {
7
7
  constructor(http: HttpClient);
8
8
  createStripeSession(amount: any, currency: any, name: any, description: any, image: any): Observable<any>;
9
9
  createBraintreeToken(): Observable<any>;
10
- pay(paymentMethod: any, paidFor: any, subtotal: any, promoCode: any, total: any, currency: any, pmId: any, pmStatus: any, pmDetails: any, success?: Function, error?: Function): import("rxjs").Subscription;
10
+ addPayment(paymentMethod: any, paidFor: any, subtotal: any, promoCode: any, total: any, currency: any, pmId: any, pmStatus: any, pmDetails: any, success?: Function, error?: Function): import("rxjs").Subscription;
11
11
  static ɵfac: i0.ɵɵFactoryDeclaration<PaymentsApiService, never>;
12
12
  static ɵprov: i0.ɵɵInjectableDeclaration<PaymentsApiService>;
13
13
  }
@@ -0,0 +1,11 @@
1
+ import { HttpClient } from '@angular/common/http';
2
+ import { Observable } from 'rxjs';
3
+ import { ApiServiceBase } from '../../base/api.service';
4
+ import * as i0 from "@angular/core";
5
+ export declare class PromoCodesApiService extends ApiServiceBase {
6
+ protected http: HttpClient;
7
+ constructor(http: HttpClient);
8
+ getPromoCode(code: any): Observable<any>;
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<PromoCodesApiService, never>;
10
+ static ɵprov: i0.ɵɵInjectableDeclaration<PromoCodesApiService>;
11
+ }
@@ -6,7 +6,7 @@ export declare class SubscriptionsApiService extends ApiServiceBase {
6
6
  protected http: HttpClient;
7
7
  constructor(http: HttpClient);
8
8
  getSubscriptions(data: any): Observable<any[]>;
9
- addSubscription(subscriptionProvider: any, newSubscriptionId: any, planId: any, addons: any, price: any, totalPrice: any, success?: Function, error?: Function): void;
9
+ addSubscription(subscriptionProvider: any, newSubscriptionId: any, planId: any, addons: any, subtotal: any, promoCode: any, total: any, currency: any, success?: Function, error?: Function): void;
10
10
  cancelSubscription(subscriptionProvider: any, subscriptionId: any, success?: Function, error?: Function): void;
11
11
  static ɵfac: i0.ɵɵFactoryDeclaration<SubscriptionsApiService, never>;
12
12
  static ɵprov: i0.ɵɵInjectableDeclaration<SubscriptionsApiService>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osovitny/anatoly",
3
- "version": "3.19.31",
3
+ "version": "3.19.33",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "19.2.11",
6
6
  "@angular/core": "19.2.11",
@@ -1,11 +0,0 @@
1
- import { HttpClient } from '@angular/common/http';
2
- import { Observable } from 'rxjs';
3
- import { ApiServiceBase } from '../../base/api.service';
4
- import * as i0 from "@angular/core";
5
- export declare class DiscountCodesApiService extends ApiServiceBase {
6
- protected http: HttpClient;
7
- constructor(http: HttpClient);
8
- getDiscountCode(code: any): Observable<any>;
9
- static ɵfac: i0.ɵɵFactoryDeclaration<DiscountCodesApiService, never>;
10
- static ɵprov: i0.ɵɵInjectableDeclaration<DiscountCodesApiService>;
11
- }