@xsolla/payment-client-core 0.2.4 → 0.2.5

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.
@@ -5850,7 +5850,7 @@ class GooglePayService {
5850
5850
  return this.readyToPay.getValue();
5851
5851
  }
5852
5852
  sendUserBack(path) {
5853
- this.httpClient.get(decodeURI(path), { responseType: 'text' }).subscribe();
5853
+ this.httpClient.get(path, { responseType: 'text' }).subscribe();
5854
5854
  }
5855
5855
  initGooglePayLibrary(data) {
5856
5856
  this.isSandbox = data.isSandbox;
@@ -5922,10 +5922,16 @@ class GooglePayService {
5922
5922
  if (!this.checkout) {
5923
5923
  throw new AppError('Google Pay: no checkout data in then');
5924
5924
  }
5925
- let returnUrl = this.checkout.request.form.fields.returnSuccessUrl;
5925
+ const returnUrl = new URL(this.checkout.request.form.fields.returnSuccessUrl);
5926
5926
  const data = this.checkout.request.form.fields;
5927
- returnUrl += `&cpf_number=${data.cpf_number}&descriptor=${data.descriptor}&paymentData=${JSON.stringify(paymentData)}`;
5928
- this.commonPayProcessingService.emitPayment(returnUrl);
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);
5929
5935
  return checkStatusAction;
5930
5936
  }
5931
5937
  catch (error) {
@@ -5939,6 +5945,7 @@ class GooglePayService {
5939
5945
  return null;
5940
5946
  }
5941
5947
  const returnUrl = this.checkout.request.form.fields.returnFailUrl;
5948
+ console.log('fail return url', returnUrl);
5942
5949
  this.commonPayProcessingService.emitPayment(returnUrl);
5943
5950
  return checkStatusAction;
5944
5951
  }
@@ -6040,7 +6047,6 @@ class CoreLibraryService {
6040
6047
  checkPaymentDevice: (base64checkoutData) => this.googlePayService.checkPaymentDevice(base64checkoutData),
6041
6048
  proceedCheckout: async () => this.googlePayService.proceedCheckout(),
6042
6049
  createButton: (onClickHandler) => this.googlePayService.createButton(onClickHandler),
6043
- sendUserBack: (path) => this.googlePayService.sendUserBack(path),
6044
6050
  },
6045
6051
  getInitialData: () => this.paymentService.getInitialDataForSdkPaymentSystems(),
6046
6052
  };