@osovitny/anatoly 3.17.122 → 3.17.124

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,199 @@ 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: (data) => ({
5750
+ plan_id: this.requestedPlanId,
5751
+ custom_id: '0',
5752
+ application_context: {
5753
+ shipping_preference: "NO_SHIPPING"
5754
+ }
5755
+ }),
5756
+ onApprove: (data, actions) => {
5757
+ try {
5758
+ let subscriptionId = data.subscriptionID;
5759
+ that.addSubscription(subscriptionId);
5760
+ }
5761
+ catch {
5762
+ this.fireStatusChange(false, true);
5763
+ }
5764
+ },
5765
+ onCancel: (data, actions) => {
5766
+ this.fireStatusChange(false, true);
5767
+ },
5768
+ onError: err => {
5769
+ this.fireStatusChange(false, true);
5770
+ },
5771
+ onClick: (data, actions) => {
5772
+ this.fireStatusChange(true, false);
5773
+ }
5774
+ };
5775
+ }
5776
+ addSubscription(newSubscriptionId) {
5777
+ this.zone.run(() => {
5778
+ this.api.addSubscription(SubscriptionProvider.PayPal, this.currentSubscriptionId, newSubscriptionId, this.requestedPlanId, () => {
5779
+ this.fireStatusChange(false, false);
5780
+ this.appContext.updateCurrent();
5781
+ }, () => {
5782
+ this.fireStatusChange(false, true);
5783
+ });
5784
+ });
5785
+ }
5786
+ static { this.ɵfac = function PaypalSubscribeButtonComponent_Factory(t) { return new (t || PaypalSubscribeButtonComponent)(i0.ɵɵdirectiveInject(i0.NgZone), i0.ɵɵdirectiveInject(AppContextService), i0.ɵɵdirectiveInject(SubscriptionsApiService)); }; }
5787
+ 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) {
5788
+ i0.ɵɵelement(0, "anatoly-billing-paypal-container", 0);
5789
+ } if (rf & 2) {
5790
+ i0.ɵɵproperty("config", ctx.payPalConfig);
5791
+ } }, dependencies: [PayPalComponent], encapsulation: 2 }); }
5792
+ }
5793
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PaypalSubscribeButtonComponent, [{
5794
+ type: Component,
5795
+ args: [{ selector: 'anatoly-billing-paypal-subscribe-button', template: "<anatoly-billing-paypal-container [config]='payPalConfig' />\r\n\r\n" }]
5796
+ }], () => [{ type: i0.NgZone }, { type: AppContextService }, { type: SubscriptionsApiService }], { currentSubscriptionId: [{
5797
+ type: Input
5798
+ }], requestedPlanId: [{
5799
+ type: Input
5800
+ }], statusChange: [{
5801
+ type: Output
5802
+ }] }); })();
5803
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PaypalSubscribeButtonComponent, { className: "PaypalSubscribeButtonComponent", filePath: "lib\\billing\\components\\pm\\paypal\\paypal-subscribe-button.component.ts", lineNumber: 31 }); })();
5804
+
5611
5805
  /*
5612
5806
  <file>
5613
5807
  Project:
@@ -6017,61 +6211,6 @@ class CurrenciesStorageService {
6017
6211
  type: Injectable
6018
6212
  }], () => [{ type: AppContextService }, { type: CurrenciesApiService }], null); })();
6019
6213
 
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(subscriptionProvider, currentSubscriptionId, newSubscriptionId, planId, success, error) {
6045
- this.post('addSubscription', { subscriptionProvider, currentSubscriptionId, newSubscriptionId, planId }).subscribe({
6046
- next: (data) => {
6047
- if (success)
6048
- success(data);
6049
- },
6050
- error: (e) => {
6051
- if (error)
6052
- error(e);
6053
- }
6054
- });
6055
- }
6056
- cancelSubscription(subscriptionProvider, subscriptionId, success, error) {
6057
- this.post('cancelSubscription', { subscriptionProvider, subscriptionId }).subscribe({
6058
- next: (data) => {
6059
- if (success)
6060
- success(data);
6061
- },
6062
- error: (e) => {
6063
- if (error)
6064
- error(e);
6065
- }
6066
- });
6067
- }
6068
- static { this.ɵfac = function SubscriptionsApiService_Factory(t) { return new (t || SubscriptionsApiService)(i0.ɵɵinject(i1.HttpClient)); }; }
6069
- static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: SubscriptionsApiService, factory: SubscriptionsApiService.ɵfac }); }
6070
- }
6071
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SubscriptionsApiService, [{
6072
- type: Injectable
6073
- }], () => [{ type: i1.HttpClient }], null); })();
6074
-
6075
6214
  /*
6076
6215
  <file>
6077
6216
  Project:
@@ -6776,21 +6915,6 @@ class CountryDropdownlist extends EditComponentBase {
6776
6915
  }], () => [{ type: CoreApiService }, { type: AppContextService }], null); })();
6777
6916
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CountryDropdownlist, { className: "CountryDropdownlist", filePath: "lib\\ui\\components\\dropdownlists\\country\\country.dropdownlist.ts", lineNumber: 28 }); })();
6778
6917
 
6779
- /*
6780
- <file>
6781
- Project:
6782
- @osovitny/anatoly
6783
-
6784
- Authors:
6785
- Vadim Osovitny vadim.osovitny@osovitny.com
6786
-
6787
- Created:
6788
- 11 Nov 2024
6789
-
6790
- Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
6791
- </file>
6792
- */
6793
-
6794
6918
  /*
6795
6919
  <file>
6796
6920
  Project:
@@ -10516,6 +10640,7 @@ const COMPONENTS = [
10516
10640
  //PM
10517
10641
  BraintreeDialog,
10518
10642
  PaypalButtonComponent,
10643
+ PaypalSubscribeButtonComponent,
10519
10644
  PayPalComponent,
10520
10645
  StripeDialog
10521
10646
  ];
@@ -10572,12 +10697,12 @@ class AnatolyBillingModule {
10572
10697
  ]
10573
10698
  }]
10574
10699
  }], null, null); })();
10575
- (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(AnatolyBillingModule, { declarations: [BuyAccessButtonComponent, SubscribePlanButtonComponent, OrderSummaryComponent, PaymentMethodsComponent, PaymentOptionsComponent, BraintreeDialog, PaypalButtonComponent, PayPalComponent, StripeDialog], imports: [CommonModule,
10700
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(AnatolyBillingModule, { declarations: [BuyAccessButtonComponent, SubscribePlanButtonComponent, OrderSummaryComponent, PaymentMethodsComponent, PaymentOptionsComponent, BraintreeDialog, PaypalButtonComponent, PaypalSubscribeButtonComponent, PayPalComponent, StripeDialog], imports: [CommonModule,
10576
10701
  ReactiveFormsModule,
10577
10702
  FormsModule,
10578
10703
  FaModule,
10579
10704
  KendoModule,
10580
- AnatolyUIModule], exports: [BuyAccessButtonComponent, SubscribePlanButtonComponent, OrderSummaryComponent, PaymentMethodsComponent, PaymentOptionsComponent, BraintreeDialog, PaypalButtonComponent, PayPalComponent, StripeDialog] }); })();
10705
+ AnatolyUIModule], exports: [BuyAccessButtonComponent, SubscribePlanButtonComponent, OrderSummaryComponent, PaymentMethodsComponent, PaymentOptionsComponent, BraintreeDialog, PaypalButtonComponent, PaypalSubscribeButtonComponent, PayPalComponent, StripeDialog] }); })();
10581
10706
 
10582
10707
  /*
10583
10708
  <file>
@@ -10642,5 +10767,5 @@ class AnatolyModule {
10642
10767
  * Generated bundle index. Do not edit.
10643
10768
  */
10644
10769
 
10645
- 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 };
10770
+ 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 };
10646
10771
  //# sourceMappingURL=osovitny-anatoly.mjs.map