@xsolla/payment-client-core 0.2.87 → 0.2.88

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.
@@ -1353,6 +1353,7 @@ var FieldNames;
1353
1353
  FieldNames["payViaCheckoutUrl"] = "payViaCheckoutUrl";
1354
1354
  FieldNames["googlePayInitData"] = "googlePayInitData";
1355
1355
  FieldNames["googlePayPaymentData"] = "googlePayPaymentData";
1356
+ FieldNames["googlePay3dsRedirect"] = "googlePay3DSRedirect";
1356
1357
  FieldNames["externalCardIssuerCountry"] = "externalCardIssuerCountry";
1357
1358
  })(FieldNames || (FieldNames = {}));
1358
1359
 
@@ -1688,13 +1689,6 @@ class RedirectActionCreator {
1688
1689
  return (response.currentCommand === XpsCommand.checkout &&
1689
1690
  Boolean(response.parameters.checkout));
1690
1691
  }
1691
- getRedirect(submitResponse) {
1692
- return {
1693
- redirectUrl: this.getRedirectUrl(submitResponse),
1694
- isNewWindowRequired: this.getIsNewWindowRequired(submitResponse),
1695
- data: submitResponse.parameters.checkout.data,
1696
- };
1697
- }
1698
1692
  getRedirectUrl(submitResponse) {
1699
1693
  const responseRedirectUrl = submitResponse.parameters.checkout.action;
1700
1694
  const pid = submitResponse?.fields?.find(({ name }) => name === 'fix_pid')?.value;
@@ -1707,6 +1701,13 @@ class RedirectActionCreator {
1707
1701
  }
1708
1702
  return this.preparePagesUrl(pagesPath);
1709
1703
  }
1704
+ getRedirect(submitResponse) {
1705
+ return {
1706
+ redirectUrl: this.getRedirectUrl(submitResponse),
1707
+ isNewWindowRequired: this.getIsNewWindowRequired(submitResponse),
1708
+ data: submitResponse.parameters.checkout?.data ?? {},
1709
+ };
1710
+ }
1710
1711
  getIsNewWindowRequired(submitResponse) {
1711
1712
  if (!cardsWith3ds.has(submitResponse?.parameters?.pid)) {
1712
1713
  return false;
@@ -2122,8 +2123,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImpor
2122
2123
  type: Injectable
2123
2124
  }] });
2124
2125
 
2126
+ class GoogleThreeDsRedirectActionCreator extends RedirectActionCreator {
2127
+ isSuitable(response) {
2128
+ return (response.currentCommand === XpsCommand.checkout &&
2129
+ !response.parameters.checkout &&
2130
+ Boolean(response.parameters.form?.googlePay3DSRedirect?.value));
2131
+ }
2132
+ getRedirectUrl(submitResponse) {
2133
+ return (String(submitResponse.parameters.form?.googlePay3DSRedirect?.value) ?? '');
2134
+ }
2135
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: GoogleThreeDsRedirectActionCreator, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
2136
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: GoogleThreeDsRedirectActionCreator }); }
2137
+ }
2138
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: GoogleThreeDsRedirectActionCreator, decorators: [{
2139
+ type: Injectable
2140
+ }] });
2141
+
2125
2142
  const nextActionsToken = new InjectionToken('Action');
2143
+ // The order of strategies is important
2126
2144
  const nextActions = [
2145
+ GoogleThreeDsRedirectActionCreator,
2127
2146
  ShowFieldsActionCreator,
2128
2147
  CheckStatusActionCreator,
2129
2148
  SpecialButtonActionCreator,
@@ -7390,7 +7409,10 @@ class PaymentService {
7390
7409
  this.fields = this.getFields();
7391
7410
  this.form = this.formService.createForm(this.fields);
7392
7411
  this.syncService.setup(this.form, this.fields, this.config);
7393
- return submitResponse;
7412
+ return {
7413
+ response: submitResponse,
7414
+ nextAction: this.nextActionService.getNextAction(submitResponse),
7415
+ };
7394
7416
  }
7395
7417
  setupInitialFieldValues() {
7396
7418
  const fieldsToOverride = this.config.overrideFormFields;