@xsolla/payment-client-core 0.1.14-test4 → 0.1.14-test6

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.
@@ -2966,7 +2966,7 @@ var StatusSearchParam;
2966
2966
  StatusSearchParam["testPs"] = "fix_testPs";
2967
2967
  StatusSearchParam["testXsolla"] = "fix_testXsolla";
2968
2968
  StatusSearchParam["userReturnStatus"] = "fix_userReturnStatus";
2969
- StatusSearchParam["savePaymentMethod"] = "savePaymentMethod";
2969
+ StatusSearchParam["isSavePaymentAccount"] = "isSavePaymentAccount";
2970
2970
  })(StatusSearchParam || (StatusSearchParam = {}));
2971
2971
 
2972
2972
  const requiredStatusSearchParams = [
@@ -3047,9 +3047,9 @@ const statusSearchParamsMap = new Map([
3047
3047
  },
3048
3048
  ],
3049
3049
  [
3050
- StatusSearchParam.savePaymentMethod,
3050
+ StatusSearchParam.isSavePaymentAccount,
3051
3051
  {
3052
- key: 'savePaymentMethod',
3052
+ key: 'isSavePaymentAccount',
3053
3053
  converter: numberConverter,
3054
3054
  },
3055
3055
  ],
@@ -4648,8 +4648,7 @@ class SavePaymentMethodStatusService {
4648
4648
  }
4649
4649
  startWaitingStatusUpdates(invoice) {
4650
4650
  this.listenStatusService.listen(invoice);
4651
- this.listenStatusService.statusUpdated$
4652
- .pipe(skip(1))
4651
+ this.listenStatusSubscription = this.listenStatusService.statusUpdated$
4653
4652
  .subscribe(({ statusResponse }) => {
4654
4653
  if (statusResponse.status) {
4655
4654
  this.loadNewPaymentAccountData(statusResponse.status);
@@ -4670,6 +4669,7 @@ class SavePaymentMethodStatusService {
4670
4669
  }
4671
4670
  handleSavingStatus(status, account) {
4672
4671
  this.listenStatusService.stopListening();
4672
+ this.listenStatusSubscription.unsubscribe();
4673
4673
  const paymentAccountWasSaved = status?.titleClass === TitleClass.done && account !== null;
4674
4674
  const isSavePaymentMethod = true;
4675
4675
  this.savePaymentMethodStatus = paymentAccountWasSaved ? SavePaymentMethodStatus.success : SavePaymentMethodStatus.failed;
@@ -4697,7 +4697,7 @@ class StatusService {
4697
4697
  async getStatus(params) {
4698
4698
  // todo: если params.savePaymentMethod, то надо выполнить логику для
4699
4699
  // account status
4700
- const isSavePaymentMethodMode = !!params?.savePaymentMethod;
4700
+ const isSavePaymentMethodMode = !!params?.isSavePaymentAccount;
4701
4701
  if (isSavePaymentMethodMode) {
4702
4702
  return this.savePaymentMethodStatusService.getStatus(params); // todo: saveMethodStatus.getStatus();
4703
4703
  }
@@ -4710,6 +4710,7 @@ class StatusService {
4710
4710
  }
4711
4711
  async getStatusWithUrlSearchParams(url) {
4712
4712
  const searchParams = this.getRequestParamsFromUrl(url);
4713
+ console.log('searchParams', searchParams);
4713
4714
  if (!searchParams) {
4714
4715
  throw new Error('No required search params to get status');
4715
4716
  }
@@ -5294,7 +5295,7 @@ class PaymentService {
5294
5295
  signature: this.data.signature ?? '',
5295
5296
  locale: this.data.fields.find((field) => field.name === 'locale')?.value ??
5296
5297
  'en',
5297
- savePaymentMethod: this.data.isSavingMethodMode ? 1 : 0,
5298
+ isSavePaymentAccount: this.data.isSavingMethodMode ? 1 : 0,
5298
5299
  };
5299
5300
  return this.statusService.getStatus(params);
5300
5301
  }