@xsolla/payment-client-core 0.0.9 → 0.0.10-1

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 (53) hide show
  1. package/esm2020/lib/core/payment/emit-data.service.abstract.mjs +11 -0
  2. package/esm2020/lib/core/payment/finance-details/cart-item.interface.mjs +2 -0
  3. package/esm2020/lib/core/payment/finance-details/cart-line.interface.mjs +2 -0
  4. package/esm2020/lib/core/payment/finance-details/cart-pricing.interface.mjs +2 -0
  5. package/esm2020/lib/core/payment/finance-details/default-image-patterns.const.mjs +10 -0
  6. package/esm2020/lib/core/payment/finance-details/finance-details-response.token.mjs +8 -0
  7. package/esm2020/lib/core/payment/finance-details/finance-details.class.mjs +214 -0
  8. package/esm2020/lib/core/payment/finance-details/finance-details.service.mjs +25 -0
  9. package/esm2020/lib/core/payment/finance-details/price.helpers.mjs +15 -0
  10. package/esm2020/lib/core/payment/finance-details/price.interface.mjs +2 -0
  11. package/esm2020/lib/core/payment/form/converters/converter.abstract.mjs +2 -5
  12. package/esm2020/lib/core/payment/form/converters/zip.converter.mjs +3 -3
  13. package/esm2020/lib/core/payment/initialize/initialize-request-params.interface.mjs +1 -1
  14. package/esm2020/lib/core/payment/initialize/initialize.service.mjs +4 -1
  15. package/esm2020/lib/core/payment/payment.interface.mjs +1 -1
  16. package/esm2020/lib/core/payment/payment.service.mjs +42 -8
  17. package/esm2020/lib/core/payment/sync/sync.service.mjs +13 -2
  18. package/esm2020/lib/core/payment/xps-finance.interface.mjs +2 -0
  19. package/esm2020/lib/core/payment/xps-purchase.interface.mjs +2 -0
  20. package/esm2020/lib/core/payment/xps-response.interface.mjs +1 -1
  21. package/esm2020/lib/core/payment/xps-summary.interface.mjs +2 -0
  22. package/esm2020/lib/core-library.module.mjs +4 -1
  23. package/esm2020/lib/core-library.service.mjs +9 -6
  24. package/fesm2015/xsolla-payment-client-core.mjs +347 -16
  25. package/fesm2015/xsolla-payment-client-core.mjs.map +1 -1
  26. package/fesm2020/xsolla-payment-client-core.mjs +336 -16
  27. package/fesm2020/xsolla-payment-client-core.mjs.map +1 -1
  28. package/lib/core/payment/emit-data.service.abstract.d.ts +7 -0
  29. package/lib/core/payment/finance-details/cart-item.interface.d.ts +13 -0
  30. package/lib/core/payment/finance-details/cart-line.interface.d.ts +8 -0
  31. package/lib/core/payment/finance-details/cart-pricing.interface.d.ts +10 -0
  32. package/lib/core/payment/finance-details/default-image-patterns.const.d.ts +6 -0
  33. package/lib/core/payment/finance-details/finance-details-response.token.d.ts +7 -0
  34. package/lib/core/payment/finance-details/finance-details.class.d.ts +25 -0
  35. package/lib/core/payment/finance-details/finance-details.service.d.ts +12 -0
  36. package/lib/core/payment/finance-details/price.helpers.d.ts +6 -0
  37. package/lib/core/payment/finance-details/price.interface.d.ts +4 -0
  38. package/lib/core/payment/form/converters/converter.abstract.d.ts +1 -2
  39. package/lib/core/payment/initialize/initialize-request-params.interface.d.ts +1 -0
  40. package/lib/core/payment/initialize/initialize.service.d.ts +1 -0
  41. package/lib/core/payment/payment.interface.d.ts +3 -2
  42. package/lib/core/payment/payment.service.d.ts +11 -3
  43. package/lib/core/payment/sync/sync.service.d.ts +6 -2
  44. package/lib/core/payment/xps-finance.interface.d.ts +57 -0
  45. package/lib/core/payment/xps-purchase.interface.d.ts +15 -0
  46. package/lib/core/payment/xps-response.interface.d.ts +2 -74
  47. package/lib/core/payment/xps-summary.interface.d.ts +6 -0
  48. package/lib/core-library.service.d.ts +3 -1
  49. package/package.json +1 -1
  50. package/xsolla-payment-client-core-0.0.10-1.tgz +0 -0
  51. package/esm2020/lib/core/payment/finance-details.interface.mjs +0 -2
  52. package/lib/core/payment/finance-details.interface.d.ts +0 -2
  53. package/xsolla-payment-client-core-0.0.9.tgz +0 -0
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { InjectionToken, Injectable, Inject, isDevMode, NgModule } from '@angular/core';
3
- import { firstValueFrom, lastValueFrom, map, BehaviorSubject, Subject, filter as filter$1, takeUntil, skip, throwError } from 'rxjs';
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';
6
6
  import { UntypedFormGroup, Validators, UntypedFormControl, ReactiveFormsModule } from '@angular/forms';
@@ -454,11 +454,14 @@ class InitializeService {
454
454
  this.settingsService = settingsService;
455
455
  this.countryService = countryService;
456
456
  this.apiRoute = 'directpayment';
457
+ // TODO PAYMENTS-15743: replace with new refer id for headless core
458
+ this.ps4ReferId = '22';
457
459
  }
458
460
  async request(config) {
459
461
  const requestParams = {
460
462
  access_token: this.settingsService.token,
461
463
  pid: String(config.paymentMethodId),
464
+ refer: this.ps4ReferId,
462
465
  country: this.countryService.getCountry(),
463
466
  returnUrl: config.returnUrl,
464
467
  };
@@ -856,6 +859,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
856
859
  args: [submitResponseFactoryToken]
857
860
  }] }, { type: SettingsService }, { type: DeviceFingerPrintService }, { type: SecureApiClient }]; } });
858
861
 
862
+ class EmitDataService {
863
+ constructor() {
864
+ this.dataSubject = new Subject();
865
+ this.data$ = this.dataSubject.asObservable();
866
+ }
867
+ emit(data) {
868
+ this.dataSubject.next(data);
869
+ }
870
+ }
871
+
859
872
  class XpsRequest {
860
873
  addXpsParameters(parameters) {
861
874
  for (const key in parameters) {
@@ -920,8 +933,9 @@ const syncResponseFactoryProvider = {
920
933
  useValue: (...args) => new SyncResponse(...args),
921
934
  };
922
935
 
923
- class SyncService {
936
+ class SyncService extends EmitDataService {
924
937
  constructor(requestFactory, responseFactory, secureApi, settingsService) {
938
+ super();
925
939
  this.requestFactory = requestFactory;
926
940
  this.responseFactory = responseFactory;
927
941
  this.secureApi = secureApi;
@@ -961,6 +975,14 @@ class SyncService {
961
975
  return response.rewritableError ?? null;
962
976
  });
963
977
  }
978
+ getSyncValidationErrors(field) {
979
+ const control = this.form.get(field.name);
980
+ if (!control) {
981
+ return null;
982
+ }
983
+ const rewritableError = control.errors?.rewritableError;
984
+ return rewritableError ? { message: rewritableError.message } : null;
985
+ }
964
986
  async request(field) {
965
987
  const requestParams = this.requestFactory({
966
988
  token: this.settingsService.token,
@@ -972,6 +994,7 @@ class SyncService {
972
994
  headers: new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded; charset=utf-8'),
973
995
  responseType: 'json',
974
996
  })).then((response) => {
997
+ this.emit(response);
975
998
  return this.responseFactory(field, response);
976
999
  });
977
1000
  }
@@ -1058,7 +1081,7 @@ class Converter {
1058
1081
  return config;
1059
1082
  }
1060
1083
  convertToFormControl(field) {
1061
- return new UntypedFormControl(this.getValue(field), this.getValidators(field), this.getAsyncValidators(field));
1084
+ return new UntypedFormControl(this.getValue(field), this.getValidators(field));
1062
1085
  }
1063
1086
  getValidators(field) {
1064
1087
  const validators = [];
@@ -1077,9 +1100,6 @@ class Converter {
1077
1100
  }
1078
1101
  return validators;
1079
1102
  }
1080
- getAsyncValidators(field) {
1081
- return async () => this.syncService.validate(field);
1082
- }
1083
1103
  createDefaultControlConfig(controlConfigClass, field) {
1084
1104
  const config = new controlConfigClass();
1085
1105
  this.copyCommonOptions(config, field);
@@ -1164,8 +1184,8 @@ class ZipConverter extends Converter {
1164
1184
  const validators = super
1165
1185
  .getValidators(field)
1166
1186
  .concat([
1167
- convert(Validators.minLength(minLength), 'Enter at least ${minLength} characters'),
1168
- convert(Validators.maxLength(maxLength), 'Enter no more than ${maxLength} characters'),
1187
+ convert(Validators.minLength(minLength), `Enter at least ${minLength} characters`),
1188
+ convert(Validators.maxLength(maxLength), `Enter no more than ${maxLength} characters`),
1169
1189
  ]);
1170
1190
  if (this.isUsCountry) {
1171
1191
  validators.push(convert(restrictedValueValidator('00000'), 'Enter a valid ZIP code'));
@@ -2401,25 +2421,295 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
2401
2421
  }]
2402
2422
  }], ctorParameters: function () { return [{ type: StatusRequestService }, { type: ListenStatusService }, { type: NextActionService }]; } });
2403
2423
 
2424
+ /**
2425
+ * default image for purchase item is set on Publisher Account side.
2426
+ * for purchase checkout items the image url is converted into base64 string.
2427
+ * to determine default image fixed templates are used
2428
+ */
2429
+ const defaultImagePatterns = [
2430
+ /^data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAAAAADmVT4XAAACMUlEQVR4Ae3YgYqdMBSE4fP/,
2431
+ /virtual_item_default_image/,
2432
+ ];
2433
+
2434
+ function extractMoneyCurrency(money, allowZero = true) {
2435
+ return {
2436
+ amount: money?.amount ?? (allowZero ? 0 : null),
2437
+ currency: money?.currency ?? '',
2438
+ };
2439
+ }
2440
+ function createPriceOrUndefined(amount, currency) {
2441
+ return amount !== undefined && amount !== null
2442
+ ? {
2443
+ amount,
2444
+ currency,
2445
+ }
2446
+ : undefined;
2447
+ }
2448
+
2449
+ class FinanceDetails {
2450
+ get shouldShowZeroIndirectTaxRate() {
2451
+ return !!(this.finance?.vat?.visible || this.finance?.vat_user?.visible);
2452
+ }
2453
+ get isSalesTaxes() {
2454
+ return !!(this.finance?.sales_tax?.amount || this.finance?.sales_tax_user?.amount);
2455
+ }
2456
+ constructor(parameters) {
2457
+ this.purchase = parameters.purchase;
2458
+ this.finance = parameters.finance;
2459
+ }
2460
+ getFormattedPurchaseForCart() {
2461
+ const checkouts = this.purchase.checkout_items?.map((item) => {
2462
+ return {
2463
+ imgSrc: item.image_url,
2464
+ hasDefaultImg: this.isDefaultImage(item.image_url),
2465
+ title: item.name,
2466
+ price: extractMoneyCurrency(item, false),
2467
+ priceBeforeDiscount: createPriceOrUndefined(item.amount_before_discount, item.currency),
2468
+ quantity: item.quantity,
2469
+ description: item.description,
2470
+ tax: this.getTaxForItem(item.indirect_tax_rate),
2471
+ isBonus: item.is_bonus,
2472
+ };
2473
+ });
2474
+ const virtualCurrencies = this.purchase.virtual_currency?.map((item) => {
2475
+ return {
2476
+ imgSrc: item.image_url,
2477
+ hasDefaultImg: this.isDefaultImage(item.image_url),
2478
+ title: `${item.quantity} ${item.name}`,
2479
+ price: extractMoneyCurrency(item),
2480
+ description: item.description,
2481
+ isBonus: item.is_bonus,
2482
+ };
2483
+ });
2484
+ const virtualItems = this.purchase.virtual_items?.map((item) => {
2485
+ return {
2486
+ imgSrc: item.image_url,
2487
+ hasDefaultImg: this.isDefaultImage(item.image_url),
2488
+ title: item.name,
2489
+ price: extractMoneyCurrency(item),
2490
+ description: item.description,
2491
+ quantity: item.quantity,
2492
+ isBonus: item.is_bonus,
2493
+ };
2494
+ });
2495
+ let checkoutArray = undefined;
2496
+ if (this.purchase.checkout) {
2497
+ checkoutArray = [
2498
+ {
2499
+ title: this.purchase.checkout.description
2500
+ ? this.purchase.checkout.description
2501
+ : 'In-game purchase',
2502
+ price: extractMoneyCurrency(this.purchase.checkout),
2503
+ isBonus: this.purchase.checkout.is_bonus ?? false,
2504
+ },
2505
+ ];
2506
+ }
2507
+ return [
2508
+ ...(checkouts ?? []),
2509
+ ...(virtualCurrencies ?? []),
2510
+ ...(virtualItems ?? []),
2511
+ ...(checkoutArray ?? []),
2512
+ ];
2513
+ }
2514
+ getFormattedPricingForCart() {
2515
+ // subtotal details fields
2516
+ const subtotalDetailsSorting = [
2517
+ {
2518
+ key: 'discount',
2519
+ title: 'Discount',
2520
+ },
2521
+ {
2522
+ key: 'fee',
2523
+ title: 'Payment system fee',
2524
+ },
2525
+ {
2526
+ key: 'user_balance',
2527
+ title: 'Balance',
2528
+ },
2529
+ ];
2530
+ return {
2531
+ subtotal: {
2532
+ title: 'Subtotal',
2533
+ money: createPriceOrUndefined(this.finance.sub_total.amount, this.finance.sub_total.currency),
2534
+ },
2535
+ subtotalPayment: {
2536
+ title: '',
2537
+ money: createPriceOrUndefined(this.finance.sub_total.payment_amount, this.finance.sub_total.payment_currency),
2538
+ },
2539
+ total: {
2540
+ title: 'Total',
2541
+ money: extractMoneyCurrency(this.finance.total),
2542
+ },
2543
+ totalDetails: this.getTaxesForTotalDetails(),
2544
+ subtotalDetails: [
2545
+ ...subtotalDetailsSorting.map((sorting) => {
2546
+ const field = this.finance[sorting.key];
2547
+ if (field) {
2548
+ return {
2549
+ ...sorting,
2550
+ money: {
2551
+ amount: sorting.key === 'discount' && field.amount
2552
+ ? -field.amount
2553
+ : field.amount,
2554
+ currency: field.currency,
2555
+ },
2556
+ };
2557
+ }
2558
+ return sorting;
2559
+ }),
2560
+ ...this.getTaxesForSubtotalDetails(),
2561
+ ],
2562
+ };
2563
+ }
2564
+ getPaymentCountry() {
2565
+ return this.finance?.payment_country.iso;
2566
+ }
2567
+ getTaxForItem(indirectTaxRate) {
2568
+ if (indirectTaxRate ||
2569
+ (this.shouldShowZeroIndirectTaxRate && indirectTaxRate === 0)) {
2570
+ if (this.isSalesTaxes) {
2571
+ return {
2572
+ content: `Sales tax ${indirectTaxRate}%`,
2573
+ };
2574
+ }
2575
+ if (this.isIndia()) {
2576
+ return {
2577
+ content: `GST ${indirectTaxRate}%`,
2578
+ };
2579
+ }
2580
+ if (this.isGhana()) {
2581
+ return {
2582
+ content: 'VAT, NHIL, GETFund Levy, and Covid-19 Levy',
2583
+ };
2584
+ }
2585
+ return {
2586
+ content: `VAT ${indirectTaxRate}%`,
2587
+ };
2588
+ }
2589
+ return null;
2590
+ }
2591
+ getTaxesForSubtotalDetails() {
2592
+ const ret = [];
2593
+ // subtotal. VAT %p
2594
+ if (this.finance.vat_user &&
2595
+ (this.finance?.vat_user?.amount ?? this.finance?.vat_user?.visible)) {
2596
+ ret.push({
2597
+ key: 'vat_user',
2598
+ title: this.getVatLabelForSubtotalDetails(),
2599
+ money: extractMoneyCurrency(this.finance.vat_user),
2600
+ });
2601
+ }
2602
+ if (this.finance.sales_tax_user?.amount) {
2603
+ ret.push({
2604
+ key: 'sales_tax_user',
2605
+ title: 'Sales tax',
2606
+ money: extractMoneyCurrency(this.finance.sales_tax_user),
2607
+ });
2608
+ }
2609
+ return ret;
2610
+ }
2611
+ getVatLabelForSubtotalDetails() {
2612
+ if (this.isIndia()) {
2613
+ return `GST ${this.finance.vat_user?.percent ?? ''}%`;
2614
+ }
2615
+ if (this.isGhana()) {
2616
+ return `VAT, NHIL, GETFund Levy, and Covid-19 Levy`;
2617
+ }
2618
+ return `VAT ${this.finance.vat_user?.percent ?? ''}%`;
2619
+ }
2620
+ getTaxesForTotalDetails() {
2621
+ const ret = [];
2622
+ // for totalDetails. VAT
2623
+ if ((this.finance?.vat?.amount || this.finance?.vat?.visible) &&
2624
+ !this.finance?.vat_user?.amount) {
2625
+ ret.push({
2626
+ key: 'vat',
2627
+ title: this.getVatLabelForTotalDetails(),
2628
+ money: extractMoneyCurrency(this.finance.vat),
2629
+ });
2630
+ }
2631
+ if (this.finance?.sales_tax?.amount &&
2632
+ !this.finance?.sales_tax_user?.amount) {
2633
+ ret.push({
2634
+ key: 'sales_tax',
2635
+ title: 'Sales tax included',
2636
+ money: extractMoneyCurrency(this.finance.sales_tax),
2637
+ });
2638
+ }
2639
+ return ret;
2640
+ }
2641
+ getVatLabelForTotalDetails() {
2642
+ if (this.isIndia()) {
2643
+ return `Including ${this.finance.vat.percent}% GST`;
2644
+ }
2645
+ if (this.isGhana()) {
2646
+ return 'Including VAT, NHIL, GETFund Levy, and Covid-19 Levy';
2647
+ }
2648
+ return `Including ${this.finance.vat.percent}% VAT`;
2649
+ }
2650
+ isIndia() {
2651
+ return this.finance?.payment_country.iso === 'IN';
2652
+ }
2653
+ isGhana() {
2654
+ return this.finance?.payment_country.iso === 'GH';
2655
+ }
2656
+ isDefaultImage(url) {
2657
+ return defaultImagePatterns.some((regex) => regex.test(url));
2658
+ }
2659
+ }
2660
+
2661
+ const financeDetailsResponseFactoryToken = new InjectionToken('FinanceDetails');
2662
+ const financeDetailsResponseFactoryProvider = {
2663
+ provide: financeDetailsResponseFactoryToken,
2664
+ useValue: (...args) => new FinanceDetails(...args),
2665
+ };
2666
+
2667
+ class FinanceDetailsService extends EmitDataService {
2668
+ constructor(responseFactory) {
2669
+ super();
2670
+ this.responseFactory = responseFactory;
2671
+ }
2672
+ emit(summary) {
2673
+ if (summary) {
2674
+ super.emit(this.responseFactory(summary));
2675
+ }
2676
+ }
2677
+ }
2678
+ FinanceDetailsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FinanceDetailsService, deps: [{ token: financeDetailsResponseFactoryToken }], target: i0.ɵɵFactoryTarget.Injectable });
2679
+ FinanceDetailsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FinanceDetailsService, providedIn: 'root' });
2680
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FinanceDetailsService, decorators: [{
2681
+ type: Injectable,
2682
+ args: [{ providedIn: 'root' }]
2683
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
2684
+ type: Inject,
2685
+ args: [financeDetailsResponseFactoryToken]
2686
+ }] }]; } });
2687
+
2404
2688
  class PaymentService {
2405
- constructor(initializeService, submitService, syncService, formService, statusService, nextActionService, controlConfigService) {
2689
+ constructor(initializeService, submitService, syncService, formService, statusService, financeDetailsService, nextActionService, controlConfigService) {
2406
2690
  this.initializeService = initializeService;
2407
2691
  this.submitService = submitService;
2408
2692
  this.syncService = syncService;
2409
2693
  this.formService = formService;
2410
2694
  this.statusService = statusService;
2695
+ this.financeDetailsService = financeDetailsService;
2411
2696
  this.nextActionService = nextActionService;
2412
2697
  this.controlConfigService = controlConfigService;
2413
2698
  this.form = null;
2414
2699
  this.data = null;
2700
+ this.financeDetails = null;
2415
2701
  this.fields = [];
2702
+ this.destroy$ = new Subject();
2416
2703
  }
2417
2704
  async initialize(config) {
2705
+ this.destroy$ = new Subject();
2706
+ this.listenFinanceDetails();
2418
2707
  this.config = config;
2419
2708
  this.data = await this.initializeService.request(config);
2420
2709
  this.fields = this.getFields();
2421
2710
  this.form = this.formService.createForm(this.fields);
2422
- this.syncService.setup(this.form, this.fields);
2711
+ this.emitFinanceDetails(this.data.paymentForm?.summary);
2712
+ this.setupSyncService(this.form, this.fields);
2423
2713
  return this.fields;
2424
2714
  }
2425
2715
  async submit() {
@@ -2427,19 +2717,24 @@ class PaymentService {
2427
2717
  throw new Error('form is empty!');
2428
2718
  }
2429
2719
  const submitResponse = await this.submitService.request(this.fields, this.form);
2720
+ this.emitFinanceDetails(submitResponse.summary);
2430
2721
  return this.nextActionService.getNextAction(submitResponse);
2431
2722
  }
2432
2723
  getFields() {
2433
2724
  return this.data?.paymentForm?.fields ?? [];
2434
2725
  }
2435
2726
  async validate(field) {
2727
+ const syncErrors = this.syncService.getSyncValidationErrors(field);
2728
+ if (syncErrors) {
2729
+ return Promise.resolve(syncErrors);
2730
+ }
2436
2731
  return this.syncService.validate(field);
2437
2732
  }
2438
2733
  runThreeDs() {
2439
2734
  throw new Error('Method not implemented.');
2440
2735
  }
2441
2736
  getFinanceDetails() {
2442
- throw new Error('Method not implemented.');
2737
+ return this.financeDetails;
2443
2738
  }
2444
2739
  async getStatus(params) {
2445
2740
  return this.statusService.getStatus({
@@ -2454,15 +2749,36 @@ class PaymentService {
2454
2749
  const formControl = this.form?.get(name);
2455
2750
  formControl?.setValue(value);
2456
2751
  }
2752
+ destroy() {
2753
+ this.data = null;
2754
+ this.financeDetails = null;
2755
+ this.form = null;
2756
+ this.fields = [];
2757
+ this.destroy$.next();
2758
+ }
2759
+ emitFinanceDetails(summary) {
2760
+ this.financeDetailsService.emit(summary);
2761
+ }
2762
+ setupSyncService(form, fields) {
2763
+ this.syncService.setup(form, fields);
2764
+ this.syncService.data$
2765
+ .pipe(takeUntil(this.destroy$))
2766
+ .subscribe((response) => this.emitFinanceDetails(response.summary));
2767
+ }
2768
+ listenFinanceDetails() {
2769
+ this.financeDetailsService.data$
2770
+ .pipe(takeUntil(this.destroy$))
2771
+ .subscribe((financeDetails) => (this.financeDetails = financeDetails));
2772
+ }
2457
2773
  }
2458
- PaymentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: PaymentService, deps: [{ token: InitializeService }, { token: SubmitService }, { token: SyncService }, { token: FormService }, { token: StatusService }, { token: NextActionService }, { token: ControlConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
2774
+ PaymentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: PaymentService, deps: [{ token: InitializeService }, { token: SubmitService }, { token: SyncService }, { token: FormService }, { token: StatusService }, { token: FinanceDetailsService }, { token: NextActionService }, { token: ControlConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
2459
2775
  PaymentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: PaymentService, providedIn: 'root' });
2460
2776
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: PaymentService, decorators: [{
2461
2777
  type: Injectable,
2462
2778
  args: [{
2463
2779
  providedIn: 'root',
2464
2780
  }]
2465
- }], ctorParameters: function () { return [{ type: InitializeService }, { type: SubmitService }, { type: SyncService }, { type: FormService }, { type: StatusService }, { type: NextActionService }, { type: ControlConfigService }]; } });
2781
+ }], ctorParameters: function () { return [{ type: InitializeService }, { type: SubmitService }, { type: SyncService }, { type: FormService }, { type: StatusService }, { type: FinanceDetailsService }, { type: NextActionService }, { type: ControlConfigService }]; } });
2466
2782
 
2467
2783
  class RefundPolicyService {
2468
2784
  constructor(settingsService) {
@@ -2567,7 +2883,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
2567
2883
  }], ctorParameters: function () { return [{ type: SettingsService }, { type: RefundPolicyService }, { type: SecureConnectionService }, { type: DisclaimerService }]; } });
2568
2884
 
2569
2885
  class CoreLibraryService {
2570
- constructor(settingsService, countryService, paymentMethodsService, savedMethodsService, userBalanceService, paymentService, deviceFingerPrintService, legalService, nextActionService) {
2886
+ constructor(settingsService, countryService, paymentMethodsService, savedMethodsService, userBalanceService, paymentService, deviceFingerPrintService, financeDetailsService, legalService, nextActionService) {
2571
2887
  this.settingsService = settingsService;
2572
2888
  this.countryService = countryService;
2573
2889
  this.paymentMethodsService = paymentMethodsService;
@@ -2575,6 +2891,7 @@ class CoreLibraryService {
2575
2891
  this.userBalanceService = userBalanceService;
2576
2892
  this.paymentService = paymentService;
2577
2893
  this.deviceFingerPrintService = deviceFingerPrintService;
2894
+ this.financeDetailsService = financeDetailsService;
2578
2895
  this.legalService = legalService;
2579
2896
  this.nextActionService = nextActionService;
2580
2897
  this.paymentMethods = {
@@ -2601,6 +2918,7 @@ class CoreLibraryService {
2601
2918
  runThreeDs: () => this.paymentService.runThreeDs(),
2602
2919
  getStatus: async (params) => this.paymentService.getStatus(params),
2603
2920
  flowUpdates$: this.nextActionService.flowUpdates$,
2921
+ financeDetailsUpdates$: this.financeDetailsService.data$,
2604
2922
  form: {
2605
2923
  getControlConfig: (field) => this.paymentService.getFieldConfig(field),
2606
2924
  changeFieldValue: (name, value) => this.paymentService.changeFieldValue(name, value),
@@ -2611,14 +2929,14 @@ class CoreLibraryService {
2611
2929
  return this.legalService.getLegalComponentConfig();
2612
2930
  }
2613
2931
  }
2614
- 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: PaymentService }, { token: DeviceFingerPrintService }, { token: LegalService }, { token: NextActionService }], target: i0.ɵɵFactoryTarget.Injectable });
2932
+ 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: PaymentService }, { token: DeviceFingerPrintService }, { token: FinanceDetailsService }, { token: LegalService }, { token: NextActionService }], target: i0.ɵɵFactoryTarget.Injectable });
2615
2933
  CoreLibraryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CoreLibraryService, providedIn: 'root' });
2616
2934
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CoreLibraryService, decorators: [{
2617
2935
  type: Injectable,
2618
2936
  args: [{
2619
2937
  providedIn: 'root',
2620
2938
  }]
2621
- }], ctorParameters: function () { return [{ type: SettingsService }, { type: CountryService }, { type: PaymentMethodsService }, { type: SavedMethodsService }, { type: UserBalanceService }, { type: PaymentService }, { type: DeviceFingerPrintService }, { type: LegalService }, { type: NextActionService }]; } });
2939
+ }], ctorParameters: function () { return [{ type: SettingsService }, { type: CountryService }, { type: PaymentMethodsService }, { type: SavedMethodsService }, { type: UserBalanceService }, { type: PaymentService }, { type: DeviceFingerPrintService }, { type: FinanceDetailsService }, { type: LegalService }, { type: NextActionService }]; } });
2622
2940
 
2623
2941
  class HttpError extends AppError {
2624
2942
  constructor(error, req) {
@@ -2723,6 +3041,7 @@ CoreLibraryModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", versi
2723
3041
  statusResponseFactoryProvider,
2724
3042
  checkStatusRequestFactoryProvider,
2725
3043
  checkStatusResponseFactoryProvider,
3044
+ financeDetailsResponseFactoryProvider,
2726
3045
  {
2727
3046
  provide: nextActionsToken,
2728
3047
  useValue: nextActions,
@@ -2752,6 +3071,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
2752
3071
  statusResponseFactoryProvider,
2753
3072
  checkStatusRequestFactoryProvider,
2754
3073
  checkStatusResponseFactoryProvider,
3074
+ financeDetailsResponseFactoryProvider,
2755
3075
  {
2756
3076
  provide: nextActionsToken,
2757
3077
  useValue: nextActions,