@xsolla/payment-client-core 0.2.65 → 0.2.66

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.
@@ -0,0 +1,2 @@
1
+ import { FieldNames } from '../../field-names.enum';
2
+ export declare const fieldsAllowedToOverride: Set<FieldNames>;
@@ -0,0 +1,14 @@
1
+ import { XpsBoolean } from '../../../xps-boolean.enum';
2
+ type AllowedFieldValidator = (val: unknown) => boolean;
3
+ interface OverrideFieldConfig {
4
+ validator: AllowedFieldValidator;
5
+ defaultValue: XpsBoolean | string;
6
+ }
7
+ /**
8
+ * Configuration for fields that can be overridden by partner.
9
+ * We can extend this configuration with additional fields in the future.
10
+ */
11
+ export declare const overrideFieldConfigs: {
12
+ [key: string]: OverrideFieldConfig;
13
+ };
14
+ export {};
@@ -1,4 +1,8 @@
1
+ import { XpsBoolean } from '../xps-boolean.enum';
1
2
  import { creditCardPaymentMethodId } from './credit-card-payment-methods-id.variable';
3
+ export interface OverridedField {
4
+ initialValue: XpsBoolean | string;
5
+ }
2
6
  export interface BasePaymentConfiguration {
3
7
  paymentMethodId: number;
4
8
  returnUrl: string;
@@ -6,6 +10,9 @@ export interface BasePaymentConfiguration {
6
10
  paymentWithSavedMethod?: boolean;
7
11
  savedMethodId?: number;
8
12
  savePaymentMethod?: boolean;
13
+ overrideFormFields?: {
14
+ [key: string]: OverridedField;
15
+ };
9
16
  }
10
17
  interface SpecialPaymentSettings {
11
18
  useSingleExpirationDateField?: boolean;
@@ -76,6 +76,7 @@ export declare class PaymentService {
76
76
  initialize(config: PaymentConfiguration): Promise<InitializedForm>;
77
77
  submit(): Promise<NextAction | null | void>;
78
78
  submitWithFields(fields?: Field[]): Promise<SubmitResponse>;
79
+ setupInitialFieldValues(): void;
79
80
  getFields(): Field[];
80
81
  getControlStatus(name: FieldNames): ControlStatus | null;
81
82
  getInitialDataForSdkPaymentSystems(): Promise<SdkPaymentSystemsInitialData>;
@@ -0,0 +1,2 @@
1
+ import { XpsBoolean } from '../xps-boolean.enum';
2
+ export declare function isXpsBoolean(value: unknown): value is XpsBoolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xsolla/payment-client-core",
3
- "version": "0.2.65",
3
+ "version": "0.2.66",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^17.3.3",
6
6
  "@angular/core": "^17.3.3",