@xsolla/payment-client-core 0.0.8 → 0.0.9

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.
@@ -1220,6 +1220,13 @@ class ControlConfigService {
1220
1220
  }
1221
1221
  return converter.convertToFormControl(field);
1222
1222
  }
1223
+ getConfig(field) {
1224
+ const converter = this.getConverter(field);
1225
+ if (!converter) {
1226
+ return null;
1227
+ }
1228
+ return converter.convertToConfig(field);
1229
+ }
1223
1230
  getConverter(field) {
1224
1231
  if (!field) {
1225
1232
  return null;
@@ -2395,13 +2402,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
2395
2402
  }], ctorParameters: function () { return [{ type: StatusRequestService }, { type: ListenStatusService }, { type: NextActionService }]; } });
2396
2403
 
2397
2404
  class PaymentService {
2398
- constructor(initializeService, submitService, syncService, formService, statusService, nextActionService) {
2405
+ constructor(initializeService, submitService, syncService, formService, statusService, nextActionService, controlConfigService) {
2399
2406
  this.initializeService = initializeService;
2400
2407
  this.submitService = submitService;
2401
2408
  this.syncService = syncService;
2402
2409
  this.formService = formService;
2403
2410
  this.statusService = statusService;
2404
2411
  this.nextActionService = nextActionService;
2412
+ this.controlConfigService = controlConfigService;
2405
2413
  this.form = null;
2406
2414
  this.data = null;
2407
2415
  this.fields = [];
@@ -2439,19 +2447,22 @@ class PaymentService {
2439
2447
  pid: this.config.paymentMethodId,
2440
2448
  });
2441
2449
  }
2450
+ getFieldConfig(field) {
2451
+ return this.controlConfigService.getConfig(field);
2452
+ }
2442
2453
  changeFieldValue(name, value) {
2443
2454
  const formControl = this.form?.get(name);
2444
2455
  formControl?.setValue(value);
2445
2456
  }
2446
2457
  }
2447
- 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 }], target: i0.ɵɵFactoryTarget.Injectable });
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 });
2448
2459
  PaymentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: PaymentService, providedIn: 'root' });
2449
2460
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: PaymentService, decorators: [{
2450
2461
  type: Injectable,
2451
2462
  args: [{
2452
2463
  providedIn: 'root',
2453
2464
  }]
2454
- }], ctorParameters: function () { return [{ type: InitializeService }, { type: SubmitService }, { type: SyncService }, { type: FormService }, { type: StatusService }, { type: NextActionService }]; } });
2465
+ }], ctorParameters: function () { return [{ type: InitializeService }, { type: SubmitService }, { type: SyncService }, { type: FormService }, { type: StatusService }, { type: NextActionService }, { type: ControlConfigService }]; } });
2455
2466
 
2456
2467
  class RefundPolicyService {
2457
2468
  constructor(settingsService) {
@@ -2585,12 +2596,15 @@ class CoreLibraryService {
2585
2596
  initialize: async () => this.paymentService.initialize(config),
2586
2597
  submit: async () => this.paymentService.submit(),
2587
2598
  getFields: () => this.paymentService.getFields(),
2588
- changeFieldValue: (name, value) => this.paymentService.changeFieldValue(name, value),
2589
2599
  validate: async (field) => this.paymentService.validate(field),
2590
2600
  getFinanceDetails: () => this.paymentService.getFinanceDetails(),
2591
2601
  runThreeDs: () => this.paymentService.runThreeDs(),
2592
2602
  getStatus: async (params) => this.paymentService.getStatus(params),
2593
2603
  flowUpdates$: this.nextActionService.flowUpdates$,
2604
+ form: {
2605
+ getControlConfig: (field) => this.paymentService.getFieldConfig(field),
2606
+ changeFieldValue: (name, value) => this.paymentService.changeFieldValue(name, value),
2607
+ },
2594
2608
  };
2595
2609
  }
2596
2610
  getLegalComponentConfig() {