@xsolla/payment-client-core 0.2.0 → 0.2.1

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,12 +1,12 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { InjectionToken, Injectable, Inject, Pipe, isDevMode, NgModule } from '@angular/core';
3
3
  import { firstValueFrom, lastValueFrom, map, Subject, BehaviorSubject, filter as filter$1, takeUntil, skip, take, throwError } from 'rxjs';
4
- import * as i1 from '@angular/common/http';
4
+ import * as i2 from '@angular/common/http';
5
5
  import { HttpParams, HttpHeaders, HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
6
6
  import JSEncrypt from 'jsencrypt';
7
7
  import { UntypedFormGroup, Validators, UntypedFormControl, ReactiveFormsModule } from '@angular/forms';
8
8
  import { filter, map as map$1, tap, catchError } from 'rxjs/operators';
9
- import * as i1$1 from '@angular/router';
9
+ import * as i1 from '@angular/router';
10
10
  import { CommonModule } from '@angular/common';
11
11
 
12
12
  const masksFunctionsMap = {
@@ -71,14 +71,14 @@ class SecureApiClient {
71
71
  return this.isSandboxMode ? sandboxApiUrl : defaultApiUrl;
72
72
  }
73
73
  }
74
- SecureApiClient.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: SecureApiClient, deps: [{ token: i1.HttpClient }, { token: windowToken }], target: i0.ɵɵFactoryTarget.Injectable });
74
+ SecureApiClient.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: SecureApiClient, deps: [{ token: i2.HttpClient }, { token: windowToken }], target: i0.ɵɵFactoryTarget.Injectable });
75
75
  SecureApiClient.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: SecureApiClient, providedIn: 'root' });
76
76
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: SecureApiClient, decorators: [{
77
77
  type: Injectable,
78
78
  args: [{
79
79
  providedIn: 'root',
80
80
  }]
81
- }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
81
+ }], ctorParameters: function () { return [{ type: i2.HttpClient }, { type: undefined, decorators: [{
82
82
  type: Inject,
83
83
  args: [windowToken]
84
84
  }] }]; } });
@@ -4294,7 +4294,7 @@ class ElkLoggerService {
4294
4294
  })).catch((err) => console.error('Elk Logger: request error', err));
4295
4295
  }
4296
4296
  }
4297
- ElkLoggerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ElkLoggerService, deps: [{ token: windowToken }, { token: SettingsService }, { token: i1.HttpClient }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
4297
+ ElkLoggerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ElkLoggerService, deps: [{ token: windowToken }, { token: SettingsService }, { token: i2.HttpClient }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
4298
4298
  ElkLoggerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ElkLoggerService, providedIn: 'root' });
4299
4299
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ElkLoggerService, decorators: [{
4300
4300
  type: Injectable,
@@ -4304,7 +4304,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
4304
4304
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
4305
4305
  type: Inject,
4306
4306
  args: [windowToken]
4307
- }] }, { type: SettingsService }, { type: i1.HttpClient }, { type: i0.NgZone }]; } });
4307
+ }] }, { type: SettingsService }, { type: i2.HttpClient }, { type: i0.NgZone }]; } });
4308
4308
 
4309
4309
  class CentrifugoWebSocketService {
4310
4310
  constructor(elkLoggerService) {
@@ -5830,9 +5830,8 @@ class GooglePayService {
5830
5830
  get googlePaymentClientWasInitialized() {
5831
5831
  return !!this.googlePaymentClient;
5832
5832
  }
5833
- constructor(window, elkLoggerService, commonPayProcessingService, httpClient, injector) {
5833
+ constructor(window, commonPayProcessingService, httpClient, injector) {
5834
5834
  this.window = window;
5835
- this.elkLoggerService = elkLoggerService;
5836
5835
  this.commonPayProcessingService = commonPayProcessingService;
5837
5836
  this.httpClient = httpClient;
5838
5837
  this.injector = injector;
@@ -5864,9 +5863,6 @@ class GooglePayService {
5864
5863
  return;
5865
5864
  }
5866
5865
  this.commonPayProcessingService.loadScript(this.googlePayScriptUrl, this.onLoadScript.bind(this));
5867
- this.elkLoggerService.log('Google Pay: loading script is starting', [
5868
- ErrorTags.GOOGLEPAY,
5869
- ]);
5870
5866
  }
5871
5867
  checkPaymentDevice(base64checkoutData) {
5872
5868
  this.commonPayProcessingService.initialize$
@@ -5889,12 +5885,7 @@ class GooglePayService {
5889
5885
  this.readyToPay.next(false);
5890
5886
  const result = response.result?.toString() ?? '';
5891
5887
  const isHavePaymentClient = Boolean(this.googlePaymentClient).toString();
5892
- this.elkLoggerService.log(`Google Pay: possibly no response.result or googlePaymentClient is missing, result - ${result}, isHavePaymentClient - ${isHavePaymentClient}`, [ErrorTags.GOOGLEPAY], {
5893
- result: response.result,
5894
- response: response,
5895
- googlePaymentClient: !!this.googlePaymentClient,
5896
- });
5897
- throw new Error();
5888
+ throw new Error(`Google Pay: possibly no response.result or googlePaymentClient is missing, result - ${result}, isHavePaymentClient - ${isHavePaymentClient}`);
5898
5889
  })
5899
5890
  .catch((error) => {
5900
5891
  this.readyToPay.next(false);
@@ -5938,9 +5929,6 @@ class GooglePayService {
5938
5929
  return checkStatusAction;
5939
5930
  }
5940
5931
  catch (error) {
5941
- this.elkLoggerService.log(`Google Pay: google payment window error. ${JSON.stringify(error)}`, [ErrorTags.GOOGLEPAY], {
5942
- error: error,
5943
- });
5944
5932
  if (!this.checkout) {
5945
5933
  throw new AppError(`Google Pay: no checkout data`);
5946
5934
  }
@@ -5978,19 +5966,13 @@ class GooglePayService {
5978
5966
  new this.window.google.payments.api.PaymentsClient({
5979
5967
  environment,
5980
5968
  });
5981
- this.elkLoggerService.log(`Google Pay: payments client is initialized, paymentsClient - ${Boolean(this.googlePaymentClient).toString()}`, [ErrorTags.GOOGLEPAY], { environment: environment, initialized: !!this.googlePaymentClient });
5982
5969
  }
5983
5970
  onLoadScript() {
5984
5971
  if (!this.window.google) {
5985
5972
  const retryTimeout = 1000;
5986
5973
  setTimeout(() => {
5987
5974
  const isAvailableGoogleClient = !!this.window.google;
5988
- if (!isAvailableGoogleClient) {
5989
- this.elkLoggerService.log('Google Pay: google library is missing', [
5990
- ErrorTags.GOOGLEPAY,
5991
- ]);
5992
- }
5993
- else {
5975
+ if (isAvailableGoogleClient) {
5994
5976
  this.setupGooglePayClient();
5995
5977
  this.commonPayProcessingService.emitInitialize(true);
5996
5978
  }
@@ -6006,7 +5988,7 @@ class GooglePayService {
6006
5988
  return statusCode.toLowerCase() === 'canceled';
6007
5989
  }
6008
5990
  }
6009
- GooglePayService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: GooglePayService, deps: [{ token: windowToken }, { token: ElkLoggerService }, { token: PaymentSystemProcessingService }, { token: i1.HttpClient }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
5991
+ GooglePayService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: GooglePayService, deps: [{ token: windowToken }, { token: PaymentSystemProcessingService }, { token: i2.HttpClient }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
6010
5992
  GooglePayService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: GooglePayService, providedIn: 'root' });
6011
5993
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: GooglePayService, decorators: [{
6012
5994
  type: Injectable,
@@ -6016,7 +5998,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
6016
5998
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
6017
5999
  type: Inject,
6018
6000
  args: [windowToken]
6019
- }] }, { type: ElkLoggerService }, { type: PaymentSystemProcessingService }, { type: i1.HttpClient }, { type: i0.Injector }]; } });
6001
+ }] }, { type: PaymentSystemProcessingService }, { type: i2.HttpClient }, { type: i0.Injector }]; } });
6020
6002
 
6021
6003
  class CoreLibraryService {
6022
6004
  constructor(settingsService, countryService, paymentMethodsService, savedMethodsService, userBalanceService, paymentConfigService, paymentService, deviceFingerPrintService, financeDetailsService, legalService, statusService, nextActionService, creditCardService, creditCardStateService, formMessagesService, editSavedMethodsService, googlePayService, commonPayProcessingService) {
@@ -6184,11 +6166,11 @@ class HttpExceptionsInterceptor {
6184
6166
  }));
6185
6167
  }
6186
6168
  }
6187
- HttpExceptionsInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: HttpExceptionsInterceptor, deps: [{ token: i1$1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
6169
+ HttpExceptionsInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: HttpExceptionsInterceptor, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
6188
6170
  HttpExceptionsInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: HttpExceptionsInterceptor });
6189
6171
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: HttpExceptionsInterceptor, decorators: [{
6190
6172
  type: Injectable
6191
- }], ctorParameters: function () { return [{ type: i1$1.Router }]; } });
6173
+ }], ctorParameters: function () { return [{ type: i1.Router }]; } });
6192
6174
 
6193
6175
  class ValidatorsModule {
6194
6176
  }