@xsolla/payment-client-core 0.2.5 → 0.2.7

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 i2 from '@angular/common/http';
4
+ import * as i1 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 from '@angular/router';
9
+ import * as i1$1 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: i2.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: i1.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: i2.HttpClient }, { type: undefined, decorators: [{
81
+ }], ctorParameters: function () { return [{ type: i1.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: i2.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: i1.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: i2.HttpClient }, { type: i0.NgZone }]; } });
4307
+ }] }, { type: SettingsService }, { type: i1.HttpClient }, { type: i0.NgZone }]; } });
4308
4308
 
4309
4309
  class CentrifugoWebSocketService {
4310
4310
  constructor(elkLoggerService) {
@@ -5830,18 +5830,14 @@ class GooglePayService {
5830
5830
  get googlePaymentClientWasInitialized() {
5831
5831
  return !!this.googlePaymentClient;
5832
5832
  }
5833
- constructor(window, commonPayProcessingService, httpClient, injector) {
5833
+ constructor(window, commonPayProcessingService, injector) {
5834
5834
  this.window = window;
5835
5835
  this.commonPayProcessingService = commonPayProcessingService;
5836
- this.httpClient = httpClient;
5837
5836
  this.injector = injector;
5838
5837
  this.googlePayScriptUrl = 'https://pay.google.com/gp/p/js/pay.js';
5839
5838
  this.readyToPay = new BehaviorSubject(null);
5840
5839
  this.checkout = null;
5841
5840
  this.googlePaymentClient = null;
5842
- this.commonPayProcessingService.status$.subscribe((path) => {
5843
- this.sendUserBack(path);
5844
- });
5845
5841
  }
5846
5842
  get readyToPay$() {
5847
5843
  return this.readyToPay.asObservable();
@@ -5849,9 +5845,6 @@ class GooglePayService {
5849
5845
  isReadyToPay() {
5850
5846
  return this.readyToPay.getValue();
5851
5847
  }
5852
- sendUserBack(path) {
5853
- this.httpClient.get(path, { responseType: 'text' }).subscribe();
5854
- }
5855
5848
  initGooglePayLibrary(data) {
5856
5849
  this.isSandbox = data.isSandbox;
5857
5850
  this.country = data.country;
@@ -5922,16 +5915,10 @@ class GooglePayService {
5922
5915
  if (!this.checkout) {
5923
5916
  throw new AppError('Google Pay: no checkout data in then');
5924
5917
  }
5925
- const returnUrl = new URL(this.checkout.request.form.fields.returnSuccessUrl);
5918
+ let returnUrl = this.checkout.request.form.fields.returnSuccessUrl;
5926
5919
  const data = this.checkout.request.form.fields;
5927
- if (data.cpf_number) {
5928
- returnUrl.searchParams.append('cpf_number', data.cpf_number.toString());
5929
- }
5930
- returnUrl.searchParams.append('descriptor', data.descriptor);
5931
- returnUrl.searchParams.append('paymentData', JSON.stringify(paymentData));
5932
- this.commonPayProcessingService.emitPayment(returnUrl.toString());
5933
- console.log('return url success', returnUrl.toString());
5934
- console.log('return url success obj', returnUrl);
5920
+ returnUrl += `&cpf_number=${data.cpf_number}&descriptor=${data.descriptor}&paymentData=${JSON.stringify(paymentData)}`;
5921
+ this.commonPayProcessingService.emitPayment(returnUrl);
5935
5922
  return checkStatusAction;
5936
5923
  }
5937
5924
  catch (error) {
@@ -5945,7 +5932,6 @@ class GooglePayService {
5945
5932
  return null;
5946
5933
  }
5947
5934
  const returnUrl = this.checkout.request.form.fields.returnFailUrl;
5948
- console.log('fail return url', returnUrl);
5949
5935
  this.commonPayProcessingService.emitPayment(returnUrl);
5950
5936
  return checkStatusAction;
5951
5937
  }
@@ -5995,7 +5981,7 @@ class GooglePayService {
5995
5981
  return statusCode.toLowerCase() === 'canceled';
5996
5982
  }
5997
5983
  }
5998
- 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 });
5984
+ GooglePayService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: GooglePayService, deps: [{ token: windowToken }, { token: PaymentSystemProcessingService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
5999
5985
  GooglePayService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: GooglePayService, providedIn: 'root' });
6000
5986
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: GooglePayService, decorators: [{
6001
5987
  type: Injectable,
@@ -6005,7 +5991,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
6005
5991
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
6006
5992
  type: Inject,
6007
5993
  args: [windowToken]
6008
- }] }, { type: PaymentSystemProcessingService }, { type: i2.HttpClient }, { type: i0.Injector }]; } });
5994
+ }] }, { type: PaymentSystemProcessingService }, { type: i0.Injector }]; } });
6009
5995
 
6010
5996
  class CoreLibraryService {
6011
5997
  constructor(settingsService, countryService, paymentMethodsService, savedMethodsService, userBalanceService, paymentConfigService, paymentService, deviceFingerPrintService, financeDetailsService, legalService, statusService, nextActionService, creditCardService, creditCardStateService, formMessagesService, editSavedMethodsService, googlePayService, commonPayProcessingService) {
@@ -6172,11 +6158,11 @@ class HttpExceptionsInterceptor {
6172
6158
  }));
6173
6159
  }
6174
6160
  }
6175
- HttpExceptionsInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: HttpExceptionsInterceptor, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
6161
+ 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 });
6176
6162
  HttpExceptionsInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: HttpExceptionsInterceptor });
6177
6163
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: HttpExceptionsInterceptor, decorators: [{
6178
6164
  type: Injectable
6179
- }], ctorParameters: function () { return [{ type: i1.Router }]; } });
6165
+ }], ctorParameters: function () { return [{ type: i1$1.Router }]; } });
6180
6166
 
6181
6167
  class ValidatorsModule {
6182
6168
  }