@xsolla/payment-client-core 0.2.75 → 0.2.77

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.
@@ -1,3 +1,4 @@
1
+ import { ValidatorFn } from '@angular/forms';
1
2
  import { Field } from '../../../field.interface';
2
3
  import { SyncService } from '../../../requests/sync/sync.service';
3
4
  import { TextControlConfig } from '../../controls/text-control.config';
@@ -5,6 +6,7 @@ import { Converter } from '../converter.abstract';
5
6
  import * as i0 from "@angular/core";
6
7
  export declare class CpfNumberConverter extends Converter {
7
8
  constructor(syncService: SyncService);
9
+ getValidators(field: Field): ValidatorFn[];
8
10
  protected createControlConfig(field: Field): TextControlConfig;
9
11
  static ɵfac: i0.ɵɵFactoryDeclaration<CpfNumberConverter, never>;
10
12
  static ɵprov: i0.ɵɵInjectableDeclaration<CpfNumberConverter>;
@@ -0,0 +1,6 @@
1
+ import { ValidatorFn } from '../validator-fn.type';
2
+ /**
3
+ * Checks number match CPF validation algorithm.
4
+ * Based on https://en.wikipedia.org/wiki/CPF_number
5
+ */
6
+ export declare const cpfFormulaValidator: ValidatorFn;
@@ -112,6 +112,7 @@ export declare class PaymentService {
112
112
  private initializeBehaviourStrategies;
113
113
  private destroyBehaviourStrategies;
114
114
  private autoSubmitBehaviourStrategies;
115
+ private handleSubmitWithErrors;
115
116
  static ɵfac: i0.ɵɵFactoryDeclaration<PaymentService, never>;
116
117
  static ɵprov: i0.ɵɵInjectableDeclaration<PaymentService>;
117
118
  }
@@ -2,6 +2,7 @@ import { XpsResponse } from '../../../xps-response.interface';
2
2
  import { Field } from '../../../field.interface';
3
3
  import { Invoice } from '../../../invoice.interface';
4
4
  import { XpsCommand } from '../../../xps-comand.enum';
5
+ import { FieldNames } from '../../../field-names.enum';
5
6
  import { XsollaNumber } from './xsolla-number.interface';
6
7
  export declare class SubmitResponse {
7
8
  readonly responseNumber: number;
@@ -25,4 +26,6 @@ export declare class SubmitResponse {
25
26
  messages: XpsResponse['messages'];
26
27
  xsollaNumber: XsollaNumber;
27
28
  constructor(parameters: XpsResponse, responseNumber?: number);
29
+ setFieldValue(fieldName: FieldNames, value: string): void;
30
+ getFieldValue(fieldName: string): string | undefined;
28
31
  }
@@ -0,0 +1,8 @@
1
+ import { UntypedFormGroup } from '@angular/forms';
2
+ import { SubmitResponse } from '../requests/submit/response/submit-response.class';
3
+ interface UpdateAfterErrorRule {
4
+ description: string;
5
+ apply(submitResponse: SubmitResponse, form: UntypedFormGroup | null): void;
6
+ }
7
+ export declare const updateAfterErrorRules: UpdateAfterErrorRule[];
8
+ export {};
@@ -10,13 +10,14 @@ import { XpsError } from './xps-error.interface';
10
10
  import { XpsMessage } from './xps-message.interface';
11
11
  import { XpsSummary } from './xps-summary.interface';
12
12
  import { ThreeDsForm } from './three-ds/three-ds-form.interface';
13
+ export interface KeyValue<T> {
14
+ [key: string]: T;
15
+ }
13
16
  export interface XpsResponse {
14
17
  checkout: {
15
18
  action: string;
16
19
  method: string;
17
- data: {
18
- [key: string]: string;
19
- };
20
+ data: KeyValue<string>;
20
21
  };
21
22
  cardBinCountry?: string;
22
23
  idCardType: string;
@@ -42,9 +43,7 @@ export interface XpsResponse {
42
43
  };
43
44
  accountXsolla: string;
44
45
  public_id: string;
45
- form: {
46
- [key: string]: Field;
47
- };
46
+ form: KeyValue<Field>;
48
47
  taxDisclaimer: string | null;
49
48
  number: number;
50
49
  barcode: unknown;
@@ -61,9 +60,7 @@ export interface XpsResponse {
61
60
  name: string;
62
61
  };
63
62
  error?: {
64
- fields: {
65
- [key: string]: string;
66
- };
63
+ fields: KeyValue<string>;
67
64
  };
68
65
  invoiceCreated: XpsBoolean;
69
66
  messages?: XpsMessage[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xsolla/payment-client-core",
3
- "version": "0.2.75",
3
+ "version": "0.2.77",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^17.3.3",
6
6
  "@angular/core": "^17.3.3",