@xsolla/payment-client-core 0.1.10 → 0.1.12-test

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.
Files changed (36) hide show
  1. package/esm2020/lib/core/errors-mapping/card-number-sanction-error-codes.const.mjs +5 -0
  2. package/esm2020/lib/core/errors-mapping/field-special-errors-map.const.mjs +9 -0
  3. package/esm2020/lib/core/errors-mapping/xps-response-errors-mapping.service.mjs +52 -0
  4. package/esm2020/lib/core/payment/form/field-status.interface.mjs +1 -1
  5. package/esm2020/lib/core/payment/initialize/initialize.service.mjs +9 -6
  6. package/esm2020/lib/core/payment/payment.interface.mjs +1 -1
  7. package/esm2020/lib/core/payment/payment.service.mjs +3 -1
  8. package/esm2020/lib/core/payment/status/check-status/check-status.service.mjs +8 -5
  9. package/esm2020/lib/core/payment/submit/submit.service.mjs +11 -6
  10. package/esm2020/lib/core/payment/sync/sync.service.mjs +16 -9
  11. package/esm2020/lib/core/user-balance/user-balance.service.mjs +4 -1
  12. package/esm2020/lib/core-library.module.mjs +5 -4
  13. package/esm2020/lib/core-library.service.mjs +7 -2
  14. package/esm2020/lib/shared/pipes/pipes.module.mjs +17 -0
  15. package/esm2020/lib/shared/pipes/unescape-html/unescape-html.pipe.mjs +23 -0
  16. package/fesm2015/xsolla-payment-client-core.mjs +137 -25
  17. package/fesm2015/xsolla-payment-client-core.mjs.map +1 -1
  18. package/fesm2020/xsolla-payment-client-core.mjs +143 -24
  19. package/fesm2020/xsolla-payment-client-core.mjs.map +1 -1
  20. package/lib/core/errors-mapping/card-number-sanction-error-codes.const.d.ts +1 -0
  21. package/lib/core/errors-mapping/field-special-errors-map.const.d.ts +5 -0
  22. package/lib/core/errors-mapping/xps-response-errors-mapping.service.d.ts +12 -0
  23. package/lib/core/payment/form/field-status.interface.d.ts +1 -0
  24. package/lib/core/payment/initialize/initialize.service.d.ts +3 -1
  25. package/lib/core/payment/payment.interface.d.ts +0 -1
  26. package/lib/core/payment/status/check-status/check-status.service.d.ts +3 -1
  27. package/lib/core/payment/submit/submit.service.d.ts +3 -1
  28. package/lib/core/payment/sync/sync.service.d.ts +4 -1
  29. package/lib/core/user-balance/user-balance.service.d.ts +2 -0
  30. package/lib/core-library.module.d.ts +2 -1
  31. package/lib/core-library.service.d.ts +4 -0
  32. package/lib/shared/pipes/pipes.module.d.ts +7 -0
  33. package/lib/shared/pipes/unescape-html/unescape-html.pipe.d.ts +7 -0
  34. package/package.json +1 -1
  35. package/xsolla-payment-client-core-0.1.12-test.tgz +0 -0
  36. package/xsolla-payment-client-core-0.1.10.tgz +0 -0
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, Injectable, Inject, isDevMode, NgModule } from '@angular/core';
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, throwError } from 'rxjs';
4
4
  import * as i1 from '@angular/common/http';
5
5
  import { HttpParams, HttpHeaders, HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
@@ -394,6 +394,9 @@ class UserBalanceService {
394
394
  // @ts-expect-error the map already has the cache with key
395
395
  return this.cache.get(cacheKey);
396
396
  }
397
+ getUserBalanceValue() {
398
+ return this.settingsService.user.user_balance;
399
+ }
397
400
  }
398
401
  UserBalanceService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: UserBalanceService, deps: [{ token: userBalanceResponseFactoryToken }, { token: SettingsService }, { token: SecureApiClient }], target: i0.ɵɵFactoryTarget.Injectable });
399
402
  UserBalanceService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: UserBalanceService, providedIn: 'root' });
@@ -927,6 +930,87 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
927
930
  args: [nextActionsToken]
928
931
  }] }, { type: i0.Injector }]; } });
929
932
 
933
+ /* eslint-disable @typescript-eslint/no-magic-numbers */
934
+ const cardNumberSanctionErrorCodes = [
935
+ 2034, 2035, 5027, 5024, 5025, 2036,
936
+ ];
937
+
938
+ const fieldSpecialErrorsMap = [
939
+ {
940
+ errorCodes: new Set(cardNumberSanctionErrorCodes),
941
+ fieldName: FieldNames.cardNumber,
942
+ },
943
+ ];
944
+
945
+ class UnescapeHtmlPipe {
946
+ transform(html) {
947
+ if (!html) {
948
+ return '';
949
+ }
950
+ if (html.includes('&gt')) {
951
+ const messageDocument = new DOMParser().parseFromString(html, 'text/html');
952
+ return messageDocument?.documentElement?.textContent ?? '';
953
+ }
954
+ return html;
955
+ }
956
+ }
957
+ UnescapeHtmlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: UnescapeHtmlPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
958
+ UnescapeHtmlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.7", ngImport: i0, type: UnescapeHtmlPipe, name: "unescapeHtml" });
959
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: UnescapeHtmlPipe, decorators: [{
960
+ type: Pipe,
961
+ args: [{
962
+ name: 'unescapeHtml',
963
+ }]
964
+ }] });
965
+
966
+ class XpsResponseErrorsMappingService {
967
+ constructor(unescapeHtmlPipe) {
968
+ this.unescapeHtmlPipe = unescapeHtmlPipe;
969
+ }
970
+ mapErrors(response) {
971
+ if (!response.errors?.length) {
972
+ return response;
973
+ }
974
+ let mappedErrors = this.mapFieldSpecialErrors(response.errors);
975
+ mappedErrors = this.unescapeErrorsText(mappedErrors);
976
+ return {
977
+ ...response,
978
+ errors: mappedErrors,
979
+ };
980
+ }
981
+ mapFieldSpecialErrors(errors) {
982
+ return errors.map((error) => {
983
+ if (!error.element_name) {
984
+ const errorMap = fieldSpecialErrorsMap.find((map) => map.errorCodes.has(error.code));
985
+ if (errorMap) {
986
+ return {
987
+ ...error,
988
+ element_name: errorMap.fieldName,
989
+ };
990
+ }
991
+ }
992
+ return error;
993
+ });
994
+ }
995
+ unescapeErrorsText(errors) {
996
+ return errors.map((error) => {
997
+ if (!error.message) {
998
+ return error;
999
+ }
1000
+ return {
1001
+ ...error,
1002
+ message: this.unescapeHtmlPipe.transform(error.message),
1003
+ };
1004
+ });
1005
+ }
1006
+ }
1007
+ XpsResponseErrorsMappingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: XpsResponseErrorsMappingService, deps: [{ token: UnescapeHtmlPipe }], target: i0.ɵɵFactoryTarget.Injectable });
1008
+ XpsResponseErrorsMappingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: XpsResponseErrorsMappingService, providedIn: 'root' });
1009
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: XpsResponseErrorsMappingService, decorators: [{
1010
+ type: Injectable,
1011
+ args: [{ providedIn: 'root' }]
1012
+ }], ctorParameters: function () { return [{ type: UnescapeHtmlPipe }]; } });
1013
+
930
1014
  var ErrorTags;
931
1015
  (function (ErrorTags) {
932
1016
  ErrorTags["APP"] = "appError";
@@ -1329,12 +1413,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
1329
1413
  }], ctorParameters: function () { return [{ type: CreditCardService }]; } });
1330
1414
 
1331
1415
  class InitializeService {
1332
- constructor(responseFactory, xpsApiService, settingsService, countryService, nextActionService, encryptCreditCardService) {
1416
+ constructor(responseFactory, xpsApiService, settingsService, countryService, nextActionService, xpsResponseErrorsMappingService, encryptCreditCardService) {
1333
1417
  this.responseFactory = responseFactory;
1334
1418
  this.xpsApiService = xpsApiService;
1335
1419
  this.settingsService = settingsService;
1336
1420
  this.countryService = countryService;
1337
1421
  this.nextActionService = nextActionService;
1422
+ this.xpsResponseErrorsMappingService = xpsResponseErrorsMappingService;
1338
1423
  this.encryptCreditCardService = encryptCreditCardService;
1339
1424
  // TODO PAYMENTS-15743: replace with new refer id for headless core
1340
1425
  this.ps4ReferId = '22';
@@ -1349,7 +1434,8 @@ class InitializeService {
1349
1434
  };
1350
1435
  return this.xpsApiService
1351
1436
  .directPaymentRequest(requestParams)
1352
- .then((response) => {
1437
+ .then((xpsResponse) => {
1438
+ const response = this.xpsResponseErrorsMappingService.mapErrors(xpsResponse);
1353
1439
  const initializeResponse = this.responseFactory(response);
1354
1440
  if (initializeResponse.paymentForm?.errors?.length) {
1355
1441
  this.nextActionService.emitFlowUpdates(new ShowErrorsAction(initializeResponse.paymentForm.errors));
@@ -1371,7 +1457,7 @@ class InitializeService {
1371
1457
  this.encryptCreditCardService.setPublicKey(atob(publicKeyField.value));
1372
1458
  }
1373
1459
  }
1374
- InitializeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: InitializeService, deps: [{ token: initializeResponseFactoryToken }, { token: XpsApiService }, { token: SettingsService }, { token: CountryService }, { token: NextActionService }, { token: EncryptCreditCardService }], target: i0.ɵɵFactoryTarget.Injectable });
1460
+ InitializeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: InitializeService, deps: [{ token: initializeResponseFactoryToken }, { token: XpsApiService }, { token: SettingsService }, { token: CountryService }, { token: NextActionService }, { token: XpsResponseErrorsMappingService }, { token: EncryptCreditCardService }], target: i0.ɵɵFactoryTarget.Injectable });
1375
1461
  InitializeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: InitializeService, providedIn: 'root' });
1376
1462
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: InitializeService, decorators: [{
1377
1463
  type: Injectable,
@@ -1381,7 +1467,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
1381
1467
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1382
1468
  type: Inject,
1383
1469
  args: [initializeResponseFactoryToken]
1384
- }] }, { type: XpsApiService }, { type: SettingsService }, { type: CountryService }, { type: NextActionService }, { type: EncryptCreditCardService }]; } });
1470
+ }] }, { type: XpsApiService }, { type: SettingsService }, { type: CountryService }, { type: NextActionService }, { type: XpsResponseErrorsMappingService }, { type: EncryptCreditCardService }]; } });
1385
1471
 
1386
1472
  class XpsApiPartRequest {
1387
1473
  addXpsParameters(parameters) {
@@ -1496,12 +1582,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
1496
1582
  }], ctorParameters: function () { return [{ type: SettingsService }]; } });
1497
1583
 
1498
1584
  class SubmitService {
1499
- constructor(requestFactory, responseFactory, settingsService, deviceFingerPrintService, xpsApiService, encryptCreditCardService) {
1585
+ constructor(requestFactory, responseFactory, settingsService, deviceFingerPrintService, xpsApiService, xpsResponseErrorsMappingService, encryptCreditCardService) {
1500
1586
  this.requestFactory = requestFactory;
1501
1587
  this.responseFactory = responseFactory;
1502
1588
  this.settingsService = settingsService;
1503
1589
  this.deviceFingerPrintService = deviceFingerPrintService;
1504
1590
  this.xpsApiService = xpsApiService;
1591
+ this.xpsResponseErrorsMappingService = xpsResponseErrorsMappingService;
1505
1592
  this.encryptCreditCardService = encryptCreditCardService;
1506
1593
  }
1507
1594
  // NB: Never add 'async' statement for this method!
@@ -1522,14 +1609,17 @@ class SubmitService {
1522
1609
  const encryptedRequest = this.encryptCreditCardService.encryptCreditCard(requestParams);
1523
1610
  return this.xpsApiService
1524
1611
  .directPaymentRequest(encryptedRequest)
1525
- .then((response) => this.responseFactory(response))
1612
+ .then((xpsResponse) => {
1613
+ const response = this.xpsResponseErrorsMappingService.mapErrors(xpsResponse);
1614
+ return this.responseFactory(response);
1615
+ })
1526
1616
  .catch((error) => {
1527
1617
  throw new ResponseError(error.message);
1528
1618
  });
1529
1619
  }));
1530
1620
  }
1531
1621
  }
1532
- SubmitService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: SubmitService, deps: [{ token: submitRequestFactoryToken }, { token: submitResponseFactoryToken }, { token: SettingsService }, { token: DeviceFingerPrintService }, { token: XpsApiService }, { token: EncryptCreditCardService }], target: i0.ɵɵFactoryTarget.Injectable });
1622
+ SubmitService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: SubmitService, deps: [{ token: submitRequestFactoryToken }, { token: submitResponseFactoryToken }, { token: SettingsService }, { token: DeviceFingerPrintService }, { token: XpsApiService }, { token: XpsResponseErrorsMappingService }, { token: EncryptCreditCardService }], target: i0.ɵɵFactoryTarget.Injectable });
1533
1623
  SubmitService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: SubmitService, providedIn: 'root' });
1534
1624
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: SubmitService, decorators: [{
1535
1625
  type: Injectable,
@@ -1540,7 +1630,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
1540
1630
  }] }, { type: undefined, decorators: [{
1541
1631
  type: Inject,
1542
1632
  args: [submitResponseFactoryToken]
1543
- }] }, { type: SettingsService }, { type: DeviceFingerPrintService }, { type: XpsApiService }, { type: EncryptCreditCardService }]; } });
1633
+ }] }, { type: SettingsService }, { type: DeviceFingerPrintService }, { type: XpsApiService }, { type: XpsResponseErrorsMappingService }, { type: EncryptCreditCardService }]; } });
1544
1634
 
1545
1635
  class EmitDataService {
1546
1636
  constructor() {
@@ -1612,13 +1702,14 @@ const syncResponseFactoryProvider = {
1612
1702
  };
1613
1703
 
1614
1704
  class SyncService extends EmitDataService {
1615
- constructor(requestFactory, responseFactory, xpsApiService, nextActionService, settingsService, encryptCreditCardService) {
1705
+ constructor(requestFactory, responseFactory, xpsApiService, nextActionService, settingsService, xpsResponseErrorsMappingService, encryptCreditCardService) {
1616
1706
  super();
1617
1707
  this.requestFactory = requestFactory;
1618
1708
  this.responseFactory = responseFactory;
1619
1709
  this.xpsApiService = xpsApiService;
1620
1710
  this.nextActionService = nextActionService;
1621
1711
  this.settingsService = settingsService;
1712
+ this.xpsResponseErrorsMappingService = xpsResponseErrorsMappingService;
1622
1713
  this.encryptCreditCardService = encryptCreditCardService;
1623
1714
  this.prevFieldSyncStates = {};
1624
1715
  this.form = new UntypedFormGroup({});
@@ -1679,10 +1770,9 @@ class SyncService extends EmitDataService {
1679
1770
  const encryptedRequest = this.encryptCreditCardService.encryptCreditCard(requestParams);
1680
1771
  return this.xpsApiService
1681
1772
  .directPaymentRequest(encryptedRequest)
1682
- .then((response) => {
1683
- if (response.errors?.length) {
1684
- this.nextActionService.emitFlowUpdates(new ShowErrorsAction(response.errors));
1685
- }
1773
+ .then((xpsResponse) => {
1774
+ const response = this.xpsResponseErrorsMappingService.mapErrors(xpsResponse);
1775
+ this.emitFormErrors(response);
1686
1776
  this.emit(response);
1687
1777
  return this.responseFactory(field, response);
1688
1778
  });
@@ -1698,8 +1788,14 @@ class SyncService extends EmitDataService {
1698
1788
  setPrevFieldSyncState(field, value, result) {
1699
1789
  this.prevFieldSyncStates[field.name] = { value, result };
1700
1790
  }
1791
+ emitFormErrors(response) {
1792
+ const formErrors = response.errors?.filter((error) => !error.element_name);
1793
+ if (formErrors?.length) {
1794
+ this.nextActionService.emitFlowUpdates(new ShowErrorsAction(formErrors));
1795
+ }
1796
+ }
1701
1797
  }
1702
- SyncService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: SyncService, deps: [{ token: syncRequestFactoryToken }, { token: syncResponseFactoryToken }, { token: XpsApiService }, { token: NextActionService }, { token: SettingsService }, { token: EncryptCreditCardService }], target: i0.ɵɵFactoryTarget.Injectable });
1798
+ SyncService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: SyncService, deps: [{ token: syncRequestFactoryToken }, { token: syncResponseFactoryToken }, { token: XpsApiService }, { token: NextActionService }, { token: SettingsService }, { token: XpsResponseErrorsMappingService }, { token: EncryptCreditCardService }], target: i0.ɵɵFactoryTarget.Injectable });
1703
1799
  SyncService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: SyncService, providedIn: 'root' });
1704
1800
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: SyncService, decorators: [{
1705
1801
  type: Injectable,
@@ -1712,7 +1808,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
1712
1808
  }] }, { type: undefined, decorators: [{
1713
1809
  type: Inject,
1714
1810
  args: [syncResponseFactoryToken]
1715
- }] }, { type: XpsApiService }, { type: NextActionService }, { type: SettingsService }, { type: EncryptCreditCardService }]; } });
1811
+ }] }, { type: XpsApiService }, { type: NextActionService }, { type: SettingsService }, { type: XpsResponseErrorsMappingService }, { type: EncryptCreditCardService }]; } });
1716
1812
 
1717
1813
  class ControlConfig {
1718
1814
  constructor() {
@@ -3766,10 +3862,11 @@ const checkStatusResponseFactoryProvider = {
3766
3862
  };
3767
3863
 
3768
3864
  class CheckStatusService extends XpsApiPart {
3769
- constructor(xpsApiService, settingsService, requestFactory, responseFactory) {
3865
+ constructor(xpsApiService, settingsService, xpsResponseErrorsMappingService, requestFactory, responseFactory) {
3770
3866
  super();
3771
3867
  this.xpsApiService = xpsApiService;
3772
3868
  this.settingsService = settingsService;
3869
+ this.xpsResponseErrorsMappingService = xpsResponseErrorsMappingService;
3773
3870
  this.requestFactory = requestFactory;
3774
3871
  this.responseFactory = responseFactory;
3775
3872
  }
@@ -3780,7 +3877,8 @@ class CheckStatusService extends XpsApiPart {
3780
3877
  const requestParams = this.requestFactory(this.settingsService.token, this.invoice);
3781
3878
  this.xpsApiService
3782
3879
  .directPaymentRequest(requestParams)
3783
- .then((response) => {
3880
+ .then((xpsResponse) => {
3881
+ const response = this.xpsResponseErrorsMappingService.mapErrors(xpsResponse);
3784
3882
  const checkStatusResponse = this.responseFactory({
3785
3883
  status: response.status,
3786
3884
  final: response.final,
@@ -3793,14 +3891,14 @@ class CheckStatusService extends XpsApiPart {
3793
3891
  });
3794
3892
  }
3795
3893
  }
3796
- CheckStatusService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CheckStatusService, deps: [{ token: XpsApiService }, { token: SettingsService }, { token: checkStatusRequestFactoryToken }, { token: checkStatusResponseFactoryToken }], target: i0.ɵɵFactoryTarget.Injectable });
3894
+ CheckStatusService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CheckStatusService, deps: [{ token: XpsApiService }, { token: SettingsService }, { token: XpsResponseErrorsMappingService }, { token: checkStatusRequestFactoryToken }, { token: checkStatusResponseFactoryToken }], target: i0.ɵɵFactoryTarget.Injectable });
3797
3895
  CheckStatusService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CheckStatusService, providedIn: 'root' });
3798
3896
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CheckStatusService, decorators: [{
3799
3897
  type: Injectable,
3800
3898
  args: [{
3801
3899
  providedIn: 'root',
3802
3900
  }]
3803
- }], ctorParameters: function () { return [{ type: XpsApiService }, { type: SettingsService }, { type: undefined, decorators: [{
3901
+ }], ctorParameters: function () { return [{ type: XpsApiService }, { type: SettingsService }, { type: XpsResponseErrorsMappingService }, { type: undefined, decorators: [{
3804
3902
  type: Inject,
3805
3903
  args: [checkStatusRequestFactoryToken]
3806
3904
  }] }, { type: undefined, decorators: [{
@@ -4982,6 +5080,7 @@ class PaymentService {
4982
5080
  }
4983
5081
  this.fields = this.getFields();
4984
5082
  this.form = this.formService.createForm(this.fields);
5083
+ this.syncService.setup(this.form, this.fields);
4985
5084
  return this.nextActionService.getNextAction(submitResponse);
4986
5085
  }
4987
5086
  getFields() {
@@ -5074,6 +5173,7 @@ class PaymentService {
5074
5173
  validationStatus: control.status,
5075
5174
  errors: control.errors,
5076
5175
  isFocused: this.focusFieldName === name,
5176
+ isTouched: control.touched,
5077
5177
  };
5078
5178
  });
5079
5179
  this.formFieldsStatusSubject.next(formFieldsStatus);
@@ -5262,7 +5362,6 @@ class CoreLibraryService {
5262
5362
  getFinanceDetails: () => this.paymentService.getFinanceDetails(),
5263
5363
  runThreeDs: () => this.paymentService.runThreeDs(),
5264
5364
  getStatus: async () => this.paymentService.getStatus(),
5265
- flowUpdates$: this.nextActionService.flowUpdates$,
5266
5365
  financeDetailsUpdates$: this.financeDetailsService.data$,
5267
5366
  form: {
5268
5367
  fieldsStatus$: this.paymentService.formFieldsStatus$,
@@ -5280,6 +5379,9 @@ class CoreLibraryService {
5280
5379
  cardTypeUpdates$: this.creditCardStateService.data$,
5281
5380
  };
5282
5381
  }
5382
+ get flowUpdates$() {
5383
+ return this.nextActionService.flowUpdates$;
5384
+ }
5283
5385
  get financeDetailsUpdates$() {
5284
5386
  return this.financeDetailsService.data$;
5285
5387
  }
@@ -5293,6 +5395,9 @@ class CoreLibraryService {
5293
5395
  const sanitizedName = field.name.replace(/^fix_/i, '');
5294
5396
  return masksFunctionsMap[sanitizedName];
5295
5397
  }
5398
+ getUserBalanceValue() {
5399
+ return this.userBalanceService.getUserBalanceValue();
5400
+ }
5296
5401
  }
5297
5402
  CoreLibraryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CoreLibraryService, deps: [{ token: SettingsService }, { token: CountryService }, { token: PaymentMethodsService }, { token: SavedMethodsService }, { token: UserBalanceService }, { token: PaymentConfigService }, { token: PaymentService }, { token: DeviceFingerPrintService }, { token: FinanceDetailsService }, { token: LegalService }, { token: StatusService }, { token: NextActionService }, { token: CreditCardService }, { token: CreditCardStateService }], target: i0.ɵɵFactoryTarget.Injectable });
5298
5403
  CoreLibraryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CoreLibraryService, providedIn: 'root' });
@@ -5441,10 +5546,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
5441
5546
  }]
5442
5547
  }] });
5443
5548
 
5549
+ class PipesModule {
5550
+ }
5551
+ PipesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: PipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
5552
+ PipesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.7", ngImport: i0, type: PipesModule, declarations: [UnescapeHtmlPipe], exports: [UnescapeHtmlPipe] });
5553
+ PipesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: PipesModule, providers: [UnescapeHtmlPipe] });
5554
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: PipesModule, decorators: [{
5555
+ type: NgModule,
5556
+ args: [{
5557
+ declarations: [UnescapeHtmlPipe],
5558
+ providers: [UnescapeHtmlPipe],
5559
+ exports: [UnescapeHtmlPipe],
5560
+ }]
5561
+ }] });
5562
+
5444
5563
  class CoreLibraryModule {
5445
5564
  }
5446
5565
  CoreLibraryModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CoreLibraryModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
5447
- CoreLibraryModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.7", ngImport: i0, type: CoreLibraryModule, imports: [HttpClientModule, FormModule] });
5566
+ CoreLibraryModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.7", ngImport: i0, type: CoreLibraryModule, imports: [HttpClientModule, FormModule, PipesModule] });
5448
5567
  CoreLibraryModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CoreLibraryModule, providers: [
5449
5568
  {
5450
5569
  provide: HTTP_INTERCEPTORS,
@@ -5473,11 +5592,11 @@ CoreLibraryModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", versi
5473
5592
  },
5474
5593
  ...nextActions,
5475
5594
  ...flowUpdateNextActions,
5476
- ], imports: [HttpClientModule, FormModule] });
5595
+ ], imports: [HttpClientModule, FormModule, PipesModule] });
5477
5596
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CoreLibraryModule, decorators: [{
5478
5597
  type: NgModule,
5479
5598
  args: [{
5480
- imports: [HttpClientModule, FormModule],
5599
+ imports: [HttpClientModule, FormModule, PipesModule],
5481
5600
  providers: [
5482
5601
  {
5483
5602
  provide: HTTP_INTERCEPTORS,