@osovitny/anatoly 3.17.121 → 3.17.123

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.
@@ -5482,7 +5482,7 @@ class PayPalComponent {
5482
5482
  shipping_preference:
5483
5483
  https://developer.paypal.com/docs/api/payments/v1/?mark=shipping_preference%20#definition-application_context
5484
5484
 
5485
- Copyright (c) 2023-2024 Atlas Cross Inc. All rights reserved.
5485
+ Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
5486
5486
  </file>
5487
5487
  */
5488
5488
  //Node
@@ -5512,7 +5512,8 @@ class PaypalButtonComponent extends ComponentBase {
5512
5512
  }
5513
5513
  initPayPal() {
5514
5514
  let that = this;
5515
- let clientId = AppCoreSettings.external.pm.payPal.clientId;
5515
+ let payPalSettings = AppCoreSettings.externalApi.pm.payPal;
5516
+ let clientId = payPalSettings.clientId;
5516
5517
  let totalPrice = this.ps.getTotal().toString();
5517
5518
  let currency = this.ps.currency;
5518
5519
  this.payPalConfig = {
@@ -5608,6 +5609,201 @@ class PaypalButtonComponent extends ComponentBase {
5608
5609
  }] }); })();
5609
5610
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PaypalButtonComponent, { className: "PaypalButtonComponent", filePath: "lib\\billing\\components\\pm\\paypal\\paypal-button.component.ts", lineNumber: 42 }); })();
5610
5611
 
5612
+ /*
5613
+ <file>
5614
+ Project:
5615
+ @osovitny/anatoly
5616
+
5617
+ Authors:
5618
+ Vadim Osovitny vadim.osovitny@osovitny.com
5619
+
5620
+ Created:
5621
+ 11 Nov 2024
5622
+
5623
+ Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
5624
+ </file>
5625
+ */
5626
+
5627
+ /*
5628
+ <file>
5629
+ Project:
5630
+ @osovitny/anatoly
5631
+
5632
+ Authors:
5633
+ Vadim Osovitny vadim.osovitny@osovitny.com
5634
+
5635
+ Created:
5636
+ 10 Nov 2024
5637
+
5638
+ Copyright (c) 2017-2025 Osovitny Inc. All rights reserved.
5639
+ </file>
5640
+ */
5641
+ //Node
5642
+ class SubscriptionsApiService extends ApiServiceBase {
5643
+ constructor(http) {
5644
+ super(http);
5645
+ this.http = http;
5646
+ this.baseUrl = `${ApiUrl}/billing/subscriptions`;
5647
+ }
5648
+ getSubscriptions(data) {
5649
+ return this.get('getSubscriptions', data);
5650
+ }
5651
+ addSubscription(subscriptionProvider, currentSubscriptionId, newSubscriptionId, planId, success, error) {
5652
+ this.post('addSubscription', { subscriptionProvider, currentSubscriptionId, newSubscriptionId, planId }).subscribe({
5653
+ next: (data) => {
5654
+ if (success)
5655
+ success(data);
5656
+ },
5657
+ error: (e) => {
5658
+ if (error)
5659
+ error(e);
5660
+ }
5661
+ });
5662
+ }
5663
+ cancelSubscription(subscriptionProvider, subscriptionId, success, error) {
5664
+ this.post('cancelSubscription', { subscriptionProvider, subscriptionId }).subscribe({
5665
+ next: (data) => {
5666
+ if (success)
5667
+ success(data);
5668
+ },
5669
+ error: (e) => {
5670
+ if (error)
5671
+ error(e);
5672
+ }
5673
+ });
5674
+ }
5675
+ static { this.ɵfac = function SubscriptionsApiService_Factory(t) { return new (t || SubscriptionsApiService)(i0.ɵɵinject(i1.HttpClient)); }; }
5676
+ static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: SubscriptionsApiService, factory: SubscriptionsApiService.ɵfac }); }
5677
+ }
5678
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SubscriptionsApiService, [{
5679
+ type: Injectable
5680
+ }], () => [{ type: i1.HttpClient }], null); })();
5681
+
5682
+ /*
5683
+ <file>
5684
+ Project:
5685
+ Atlas Cross
5686
+
5687
+ Authors:
5688
+ Vadim Osovitny vadim.osovitny@osovitny.com
5689
+
5690
+ Created:
5691
+ 04 Aug 2022
5692
+
5693
+ Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
5694
+ </file>
5695
+ */
5696
+ //Node
5697
+ class PaypalSubscribeButtonComponent extends ComponentBase {
5698
+ get requestedPlanId() {
5699
+ return this._requestedPlanId;
5700
+ }
5701
+ set requestedPlanId(value) {
5702
+ this._requestedPlanId = value;
5703
+ this.initPayPal();
5704
+ }
5705
+ constructor(zone, appContext, api) {
5706
+ super();
5707
+ this.zone = zone;
5708
+ this.appContext = appContext;
5709
+ this.api = api;
5710
+ this.paymentInProgress = false;
5711
+ this.paymentFailed = false;
5712
+ //Outputs
5713
+ this.statusChange = new EventEmitter();
5714
+ }
5715
+ ngOnInit() {
5716
+ this.setDefaults();
5717
+ this.setValues();
5718
+ }
5719
+ setDefaults() {
5720
+ }
5721
+ setValues() {
5722
+ this.initPayPal();
5723
+ }
5724
+ fireStatusChange(paymentInProgress, paymentFailed) {
5725
+ this.paymentInProgress = paymentInProgress;
5726
+ this.paymentFailed = paymentFailed;
5727
+ this.statusChange.emit({
5728
+ paymentInProgress,
5729
+ paymentFailed
5730
+ });
5731
+ }
5732
+ initPayPal() {
5733
+ let that = this;
5734
+ let payPalSettings = AppCoreSettings.externalApi.pm.payPal;
5735
+ let clientId = payPalSettings.clientId;
5736
+ this.payPalConfig = {
5737
+ currency: 'USD',
5738
+ clientId: clientId,
5739
+ vault: 'true',
5740
+ advanced: {
5741
+ commit: 'true',
5742
+ extraQueryParams: [
5743
+ {
5744
+ name: "disable-funding",
5745
+ value: "credit,card"
5746
+ }
5747
+ ]
5748
+ },
5749
+ createSubscriptionOnClient: function (data) {
5750
+ return {
5751
+ 'plan_id': this.planId,
5752
+ 'custom_id': '0',
5753
+ 'application_context': {
5754
+ 'shipping_preference': "NO_SHIPPING"
5755
+ }
5756
+ };
5757
+ },
5758
+ onApprove: (data, actions) => {
5759
+ try {
5760
+ let subscriptionId = data.subscriptionID;
5761
+ that.addSubscription(subscriptionId);
5762
+ }
5763
+ catch {
5764
+ this.fireStatusChange(false, true);
5765
+ }
5766
+ },
5767
+ onCancel: (data, actions) => {
5768
+ this.fireStatusChange(false, true);
5769
+ },
5770
+ onError: err => {
5771
+ this.fireStatusChange(false, true);
5772
+ },
5773
+ onClick: (data, actions) => {
5774
+ this.fireStatusChange(true, false);
5775
+ }
5776
+ };
5777
+ }
5778
+ addSubscription(newSubscriptionId) {
5779
+ this.zone.run(() => {
5780
+ this.api.addSubscription(SubscriptionProvider.PayPal, this.currentSubscriptionId, newSubscriptionId, this.requestedPlanId, () => {
5781
+ this.fireStatusChange(false, false);
5782
+ this.appContext.updateCurrent();
5783
+ }, () => {
5784
+ this.fireStatusChange(false, true);
5785
+ });
5786
+ });
5787
+ }
5788
+ static { this.ɵfac = function PaypalSubscribeButtonComponent_Factory(t) { return new (t || PaypalSubscribeButtonComponent)(i0.ɵɵdirectiveInject(i0.NgZone), i0.ɵɵdirectiveInject(AppContextService), i0.ɵɵdirectiveInject(SubscriptionsApiService)); }; }
5789
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PaypalSubscribeButtonComponent, selectors: [["anatoly-billing-paypal-subscribe-button"]], inputs: { currentSubscriptionId: "currentSubscriptionId", requestedPlanId: "requestedPlanId" }, outputs: { statusChange: "statusChange" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [[3, "config"]], template: function PaypalSubscribeButtonComponent_Template(rf, ctx) { if (rf & 1) {
5790
+ i0.ɵɵelement(0, "anatoly-billing-paypal-container", 0);
5791
+ } if (rf & 2) {
5792
+ i0.ɵɵproperty("config", ctx.payPalConfig);
5793
+ } }, dependencies: [PayPalComponent], encapsulation: 2 }); }
5794
+ }
5795
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PaypalSubscribeButtonComponent, [{
5796
+ type: Component,
5797
+ args: [{ selector: 'anatoly-billing-paypal-subscribe-button', template: "<anatoly-billing-paypal-container [config]='payPalConfig' />\r\n\r\n" }]
5798
+ }], () => [{ type: i0.NgZone }, { type: AppContextService }, { type: SubscriptionsApiService }], { currentSubscriptionId: [{
5799
+ type: Input
5800
+ }], requestedPlanId: [{
5801
+ type: Input
5802
+ }], statusChange: [{
5803
+ type: Output
5804
+ }] }); })();
5805
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PaypalSubscribeButtonComponent, { className: "PaypalSubscribeButtonComponent", filePath: "lib\\billing\\components\\pm\\paypal\\paypal-subscribe-button.component.ts", lineNumber: 31 }); })();
5806
+
5611
5807
  /*
5612
5808
  <file>
5613
5809
  Project:
@@ -6017,49 +6213,6 @@ class CurrenciesStorageService {
6017
6213
  type: Injectable
6018
6214
  }], () => [{ type: AppContextService }, { type: CurrenciesApiService }], null); })();
6019
6215
 
6020
- /*
6021
- <file>
6022
- Project:
6023
- @osovitny/anatoly
6024
-
6025
- Authors:
6026
- Vadim Osovitny vadim.osovitny@osovitny.com
6027
-
6028
- Created:
6029
- 10 Nov 2024
6030
-
6031
- Copyright (c) 2017-2025 Osovitny Inc. All rights reserved.
6032
- </file>
6033
- */
6034
- //Node
6035
- class SubscriptionsApiService extends ApiServiceBase {
6036
- constructor(http) {
6037
- super(http);
6038
- this.http = http;
6039
- this.baseUrl = `${ApiUrl}/billing/subscriptions`;
6040
- }
6041
- getSubscriptions(data) {
6042
- return this.get('getSubscriptions', data);
6043
- }
6044
- addSubscription(planId, subscriptionProvider, currentSubscriptionId, newSubscriptionId, success, error) {
6045
- this.post('addSubscription', { planId, subscriptionProvider, currentSubscriptionId, newSubscriptionId }).subscribe({
6046
- next: (data) => {
6047
- if (success)
6048
- success(data);
6049
- },
6050
- error: (e) => {
6051
- if (error)
6052
- error(e);
6053
- }
6054
- });
6055
- }
6056
- static { this.ɵfac = function SubscriptionsApiService_Factory(t) { return new (t || SubscriptionsApiService)(i0.ɵɵinject(i1.HttpClient)); }; }
6057
- static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: SubscriptionsApiService, factory: SubscriptionsApiService.ɵfac }); }
6058
- }
6059
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SubscriptionsApiService, [{
6060
- type: Injectable
6061
- }], () => [{ type: i1.HttpClient }], null); })();
6062
-
6063
6216
  /*
6064
6217
  <file>
6065
6218
  Project:
@@ -6764,21 +6917,6 @@ class CountryDropdownlist extends EditComponentBase {
6764
6917
  }], () => [{ type: CoreApiService }, { type: AppContextService }], null); })();
6765
6918
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CountryDropdownlist, { className: "CountryDropdownlist", filePath: "lib\\ui\\components\\dropdownlists\\country\\country.dropdownlist.ts", lineNumber: 28 }); })();
6766
6919
 
6767
- /*
6768
- <file>
6769
- Project:
6770
- @osovitny/anatoly
6771
-
6772
- Authors:
6773
- Vadim Osovitny vadim.osovitny@osovitny.com
6774
-
6775
- Created:
6776
- 11 Nov 2024
6777
-
6778
- Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
6779
- </file>
6780
- */
6781
-
6782
6920
  /*
6783
6921
  <file>
6784
6922
  Project:
@@ -10504,6 +10642,7 @@ const COMPONENTS = [
10504
10642
  //PM
10505
10643
  BraintreeDialog,
10506
10644
  PaypalButtonComponent,
10645
+ PaypalSubscribeButtonComponent,
10507
10646
  PayPalComponent,
10508
10647
  StripeDialog
10509
10648
  ];
@@ -10560,12 +10699,12 @@ class AnatolyBillingModule {
10560
10699
  ]
10561
10700
  }]
10562
10701
  }], null, null); })();
10563
- (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(AnatolyBillingModule, { declarations: [BuyAccessButtonComponent, SubscribePlanButtonComponent, OrderSummaryComponent, PaymentMethodsComponent, PaymentOptionsComponent, BraintreeDialog, PaypalButtonComponent, PayPalComponent, StripeDialog], imports: [CommonModule,
10702
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(AnatolyBillingModule, { declarations: [BuyAccessButtonComponent, SubscribePlanButtonComponent, OrderSummaryComponent, PaymentMethodsComponent, PaymentOptionsComponent, BraintreeDialog, PaypalButtonComponent, PaypalSubscribeButtonComponent, PayPalComponent, StripeDialog], imports: [CommonModule,
10564
10703
  ReactiveFormsModule,
10565
10704
  FormsModule,
10566
10705
  FaModule,
10567
10706
  KendoModule,
10568
- AnatolyUIModule], exports: [BuyAccessButtonComponent, SubscribePlanButtonComponent, OrderSummaryComponent, PaymentMethodsComponent, PaymentOptionsComponent, BraintreeDialog, PaypalButtonComponent, PayPalComponent, StripeDialog] }); })();
10707
+ AnatolyUIModule], exports: [BuyAccessButtonComponent, SubscribePlanButtonComponent, OrderSummaryComponent, PaymentMethodsComponent, PaymentOptionsComponent, BraintreeDialog, PaypalButtonComponent, PaypalSubscribeButtonComponent, PayPalComponent, StripeDialog] }); })();
10569
10708
 
10570
10709
  /*
10571
10710
  <file>
@@ -10630,5 +10769,5 @@ class AnatolyModule {
10630
10769
  * Generated bundle index. Do not edit.
10631
10770
  */
10632
10771
 
10633
- export { AddressComponent, AdminGuard, Alerts, AnatolyBillingModule, AnatolyCoreModule, AnatolyDataModule, AnatolyHttpInterceptor, AnatolyIAMModule, AnatolyIAMPagesModule, AnatolyModule, AnatolyUIModule, ApiServiceBase, ApiUrl, AppContextService, AppCoreSettings, AppName, AppSettings, AppVersion, AppsGoServiceBase, AuthService, AuthenticationGuard, BillingUtils, BraintreeDialog, Browser, BuyAccessButtonComponent, CardBodyComponent, CardComponent, CardFooterComponent, CardHeaderComponent, CheckIconComponent, ClientApps, CompanyComponent, ComponentBase, ContactUsDialog, ContactUsForm, ControlPanelComponent, Convert, Copy2ClipboardComponent, CoreApiService, CountryDropdownlist, CurrenciesApiService, CurrenciesStorageService, DOM, DataPagerComponent, DataViewType, DateConvert, DefaultEditorOptions, DialogBase, DigitalMarketingService, DiscountCodeStatus, DiscountCodeType, DiscountCodesApiService, EditComponentBase, EditPageBase, EmailsApiService, EnumEditComponentBase, FeatureWillBeReadyComponent, FileSizePipe, FormValidationSummaryComponent, GABillingEvents, GAEvents, GlobalErrorHandler, GoServiceBase, GoogleAnalyticsService, GridEditServiceBase, GridReadServiceBase, Guid, HoveringDirective, HtmlEditorComponent, HtmlEditorComponentBase, IdleService, InjectorInstance, IsDevMode, IsProdMode, ItemValidationSummaryComponent, L10NUrl, L10nUtils, ListBase, LoadingComponent, LoadingService, LocalStorageService, LocalizationInjectorInstance, LocalizationModule, LocalizationService, LocalizationSettingsModule, LocalizePipe, LoggingService, MSALUtils, ModerationStatus, ModerationStatusDropdownlist, NativeElementDirective, NoMobileSupportComponent, NodataComponent, NotificationService, OrderSummaryComponent, PageBase, PageSpinnerComponent, PagedPageBase, PayPalComponent, PayPalScriptService, PaymentMethod, PaymentMethodsComponent, PaymentOptionsComponent, PaymentStage, PaymentType, PaymentsApiService, PaymentsService, PaypalButtonComponent, PublishStatus, PublishStatusDropdownlist, QSUtils, ReplaceTextPipe, SafeHtmlPipe, ScriptService, SessionStorageService, SignInButtonComponent, SignOutButtonComponent, SignUpButtonComponent, StarterGuard, StarterService, Stopwatch, StripeDialog, Subs, SubscribePlanButtonComponent, SubscriptionProvider, SubscriptionsApiService, TimezoneDropdownlist, TransactionsApiService, UrlSlugComponent, Utils, ValidationSummaryComponent, XmlFormatter, YouAgreeToOurTermsComponent, dateFormats, dateTimeFormats, getAppSettingsById, getAppSettingsByName, is, localizationInitializerFactory, throwIfAlreadyLoaded, timeFormats, translateLoaderFactory };
10772
+ export { AddressComponent, AdminGuard, Alerts, AnatolyBillingModule, AnatolyCoreModule, AnatolyDataModule, AnatolyHttpInterceptor, AnatolyIAMModule, AnatolyIAMPagesModule, AnatolyModule, AnatolyUIModule, ApiServiceBase, ApiUrl, AppContextService, AppCoreSettings, AppName, AppSettings, AppVersion, AppsGoServiceBase, AuthService, AuthenticationGuard, BillingUtils, BraintreeDialog, Browser, BuyAccessButtonComponent, CardBodyComponent, CardComponent, CardFooterComponent, CardHeaderComponent, CheckIconComponent, ClientApps, CompanyComponent, ComponentBase, ContactUsDialog, ContactUsForm, ControlPanelComponent, Convert, Copy2ClipboardComponent, CoreApiService, CountryDropdownlist, CurrenciesApiService, CurrenciesStorageService, DOM, DataPagerComponent, DataViewType, DateConvert, DefaultEditorOptions, DialogBase, DigitalMarketingService, DiscountCodeStatus, DiscountCodeType, DiscountCodesApiService, EditComponentBase, EditPageBase, EmailsApiService, EnumEditComponentBase, FeatureWillBeReadyComponent, FileSizePipe, FormValidationSummaryComponent, GABillingEvents, GAEvents, GlobalErrorHandler, GoServiceBase, GoogleAnalyticsService, GridEditServiceBase, GridReadServiceBase, Guid, HoveringDirective, HtmlEditorComponent, HtmlEditorComponentBase, IdleService, InjectorInstance, IsDevMode, IsProdMode, ItemValidationSummaryComponent, L10NUrl, L10nUtils, ListBase, LoadingComponent, LoadingService, LocalStorageService, LocalizationInjectorInstance, LocalizationModule, LocalizationService, LocalizationSettingsModule, LocalizePipe, LoggingService, MSALUtils, ModerationStatus, ModerationStatusDropdownlist, NativeElementDirective, NoMobileSupportComponent, NodataComponent, NotificationService, OrderSummaryComponent, PageBase, PageSpinnerComponent, PagedPageBase, PayPalComponent, PayPalScriptService, PaymentMethod, PaymentMethodsComponent, PaymentOptionsComponent, PaymentStage, PaymentType, PaymentsApiService, PaymentsService, PaypalButtonComponent, PaypalSubscribeButtonComponent, PublishStatus, PublishStatusDropdownlist, QSUtils, ReplaceTextPipe, SafeHtmlPipe, ScriptService, SessionStorageService, SignInButtonComponent, SignOutButtonComponent, SignUpButtonComponent, StarterGuard, StarterService, Stopwatch, StripeDialog, Subs, SubscribePlanButtonComponent, SubscriptionProvider, SubscriptionsApiService, TimezoneDropdownlist, TransactionsApiService, UrlSlugComponent, Utils, ValidationSummaryComponent, XmlFormatter, YouAgreeToOurTermsComponent, dateFormats, dateTimeFormats, getAppSettingsById, getAppSettingsByName, is, localizationInitializerFactory, throwIfAlreadyLoaded, timeFormats, translateLoaderFactory };
10634
10773
  //# sourceMappingURL=osovitny-anatoly.mjs.map