@xsolla/payment-client-core 0.2.14 → 0.2.16

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/countries-api/countries-api.service.mjs +38 -0
  2. package/esm2020/lib/core/countries-api/country-response.interface.mjs +2 -0
  3. package/esm2020/lib/core/countries-api/country.interface.mjs +2 -0
  4. package/esm2020/lib/core/payment/form/controls/search-select/select-control.config.mjs +8 -0
  5. package/esm2020/lib/core/payment/form/converters/cvv/cvv.converter.mjs +3 -3
  6. package/esm2020/lib/core/payment/form/converters/pricepoint/pricepoint.converter.mjs +2 -2
  7. package/esm2020/lib/core/payment/form/converters/select/select.converter.mjs +4 -3
  8. package/esm2020/lib/core/payment/form/converters/zip/zip.converter.mjs +2 -5
  9. package/esm2020/lib/core/payment/form/form.service.mjs +4 -1
  10. package/esm2020/lib/core/payment/payment.interface.mjs +1 -1
  11. package/esm2020/lib/core/payment/payment.service.mjs +4 -1
  12. package/esm2020/lib/core/sdk-payment-systems/apple-pay/apple-pay.service.mjs +3 -7
  13. package/esm2020/lib/core-library.service.mjs +10 -9
  14. package/esm2020/public-api.mjs +3 -1
  15. package/fesm2015/xsolla-payment-client-core.mjs +60 -29
  16. package/fesm2015/xsolla-payment-client-core.mjs.map +1 -1
  17. package/fesm2020/xsolla-payment-client-core.mjs +55 -29
  18. package/fesm2020/xsolla-payment-client-core.mjs.map +1 -1
  19. package/lib/core/countries-api/countries-api.service.d.ts +15 -0
  20. package/lib/core/countries-api/country-response.interface.d.ts +4 -0
  21. package/lib/core/countries-api/country.interface.d.ts +5 -0
  22. package/lib/core/payment/form/controls/search-select/{search-select-control.config.d.ts → select-control.config.d.ts} +2 -2
  23. package/lib/core/payment/form/converters/select/select.converter.d.ts +2 -2
  24. package/lib/core/payment/form/form.service.d.ts +2 -0
  25. package/lib/core/payment/payment.interface.d.ts +1 -0
  26. package/lib/core/payment/payment.service.d.ts +1 -0
  27. package/lib/core-library.service.d.ts +5 -3
  28. package/package.json +1 -1
  29. package/public-api.d.ts +2 -0
  30. package/xsolla-payment-client-core-0.2.16.tgz +0 -0
  31. package/esm2020/lib/core/payment/form/controls/search-select/search-select-control.config.mjs +0 -8
  32. package/esm2020/lib/core/payment/form/mask-config.interface.mjs +0 -2
  33. package/esm2020/lib/core/payment/form/masks-functions.map.mjs +0 -7
  34. package/lib/core/payment/form/mask-config.interface.d.ts +0 -6
  35. package/lib/core/payment/form/masks-functions.map.d.ts +0 -3
  36. package/xsolla-payment-client-core-0.2.14.tgz +0 -0
@@ -0,0 +1,15 @@
1
+ import { CountryResponse } from './country-response.interface';
2
+ import { BehaviorSubject } from 'rxjs';
3
+ import { SettingsService } from '../settings/settings.service';
4
+ import { SecureApiClient } from '../http/secure-api/secure-api.service';
5
+ import * as i0 from "@angular/core";
6
+ export declare class CountriesApiService {
7
+ private readonly secureApi;
8
+ private readonly settingsService;
9
+ countries$: BehaviorSubject<CountryResponse['countryList'] | null>;
10
+ private readonly apiRoute;
11
+ constructor(secureApi: SecureApiClient, settingsService: SettingsService);
12
+ request(): Promise<CountryResponse['countryList']>;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<CountriesApiService, never>;
14
+ static ɵprov: i0.ɵɵInjectableDeclaration<CountriesApiService>;
15
+ }
@@ -0,0 +1,4 @@
1
+ import { Country } from './country.interface';
2
+ export interface CountryResponse {
3
+ countryList: Country[];
4
+ }
@@ -0,0 +1,5 @@
1
+ export interface Country {
2
+ ISO: string;
3
+ aliases: null | string;
4
+ name: string;
5
+ }
@@ -2,10 +2,10 @@ import { ControlConfig } from '../control-config';
2
2
  import { SafeHtml } from '@angular/platform-browser';
3
3
  import { SearchSelectOption } from './search-select-option.interface';
4
4
  import { SelectOption } from './select-option.interface';
5
- export declare class SearchSelectControlConfig extends ControlConfig {
5
+ export declare class SelectControlConfig extends ControlConfig {
6
6
  controlType: string;
7
7
  name: string;
8
8
  title?: string | SafeHtml;
9
9
  options?: SelectOption[] | SearchSelectOption[];
10
- hasSearch?: boolean;
10
+ initValue?: string;
11
11
  }
@@ -1,11 +1,11 @@
1
1
  import { Converter } from '../converter.abstract';
2
2
  import { SyncService } from '../../../sync/sync.service';
3
- import { SearchSelectControlConfig } from '../../controls/search-select/search-select-control.config';
3
+ import { SelectControlConfig } from '../../controls/search-select/select-control.config';
4
4
  import { Field } from '../../../field.interface';
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class SelectConverter extends Converter {
7
7
  constructor(syncService: SyncService);
8
- protected createControlConfig(field: Field): SearchSelectControlConfig;
8
+ protected createControlConfig(field: Field): SelectControlConfig;
9
9
  static ɵfac: i0.ɵɵFactoryDeclaration<SelectConverter, never>;
10
10
  static ɵprov: i0.ɵɵInjectableDeclaration<SelectConverter>;
11
11
  }
@@ -3,12 +3,14 @@ import { Field } from '../field.interface';
3
3
  import { ControlConfigService } from './controls/control-config.service';
4
4
  import { FieldFormStates } from './field-form-states.interface';
5
5
  import { FormState } from './form-state.interface';
6
+ import { FieldNames } from '../field-names.enum';
6
7
  import * as i0 from "@angular/core";
7
8
  export declare class FormService {
8
9
  protected readonly controlConfigService: ControlConfigService;
9
10
  fieldFormStates: FieldFormStates;
10
11
  constructor(controlConfigService: ControlConfigService);
11
12
  createForm(fields: Field[]): UntypedFormGroup;
13
+ getFieldFormState(fieldName: FieldNames): FormState | null;
12
14
  updateFieldFormState(form: UntypedFormGroup, fields: Field[], fieldName: string, formState: FormState): void;
13
15
  private getVisibleFields;
14
16
  static ɵfac: i0.ɵɵFactoryDeclaration<FormService, never>;
@@ -26,6 +26,7 @@ export interface Payment {
26
26
  getControlConfig(field: Field): ControlConfig | null;
27
27
  changeFieldState(name: string, state: InputEventName): void;
28
28
  updateFieldFormState(fieldName: string, formState: FormState): void;
29
+ getFieldFormState(fieldName: FieldNames): FormState | null;
29
30
  formMessages$: Observable<string[]>;
30
31
  getFormStatus(): FormControlStatus | undefined;
31
32
  getControlStatus(name: FieldNames): ControlStatus | null;
@@ -72,6 +72,7 @@ export declare class PaymentService {
72
72
  runThreeDs(): void;
73
73
  getFinanceDetails(): FinanceDetails | null;
74
74
  updateFieldFormState(fieldName: string, formState: FormState): void;
75
+ getFieldFormState(fieldName: FieldNames): FormState | null;
75
76
  getStatus(): Promise<Status>;
76
77
  listenFinalStatus(): Promise<void>;
77
78
  getFieldConfig(field: Field): ControlConfig | null;
@@ -10,7 +10,6 @@ import { UserBalanceService } from './core/user-balance/user-balance.service';
10
10
  import { PaymentConfig } from './core/payment/payment-config.interface';
11
11
  import { PaymentService } from './core/payment/payment.service';
12
12
  import { Payment } from './core/payment/payment.interface';
13
- import { Field } from './core/payment/field.interface';
14
13
  import { DeviceFingerPrintService } from './core/device-finger-print/device-finger-print.service';
15
14
  import { LegalService } from './core/legal/legal.service';
16
15
  import { LegalComponentConfig } from './core/legal/legal.component.config';
@@ -38,6 +37,8 @@ import { SendEventMethodOptionsInterface } from './core/user-behaviour-analytics
38
37
  import { PerformanceService } from './core/performance/performance.service';
39
38
  import { CombinedPaymentMethods } from './core/combined-payment-methods/combined-payment-methods.interface';
40
39
  import { CombinedPaymentMethodsService } from './core/combined-payment-methods/combined-payment-methods.service';
40
+ import { CountriesApiService } from './core/countries-api/countries-api.service';
41
+ import { CountryResponse } from './core/countries-api/country-response.interface';
41
42
  import * as i0 from "@angular/core";
42
43
  export declare class CoreLibraryService {
43
44
  private readonly settingsService;
@@ -59,6 +60,7 @@ export declare class CoreLibraryService {
59
60
  private readonly userBehaviourAnalyticsService;
60
61
  private readonly performanceService;
61
62
  private readonly combinedPaymentMethodsService;
63
+ private readonly countriesApiService;
62
64
  paymentMethods: {
63
65
  getList: (isSaveMethodMode?: boolean) => Promise<PaymentMethod[]>;
64
66
  getQuickMethods: () => Promise<PaymentMethod[]>;
@@ -68,7 +70,7 @@ export declare class CoreLibraryService {
68
70
  deleteSavedMethod: (id: number, type: string) => Promise<boolean>;
69
71
  };
70
72
  sdkPaymentSystems: SdkPaymentSystems;
71
- constructor(settingsService: SettingsService, countryService: CountryService, paymentMethodsService: PaymentMethodsService, savedMethodsService: SavedMethodsService, userBalanceService: UserBalanceService, paymentConfigService: PaymentConfigService, paymentService: PaymentService, deviceFingerPrintService: DeviceFingerPrintService, financeDetailsService: FinanceDetailsService, legalService: LegalService, statusService: StatusService, nextActionService: NextActionService, creditCardService: CreditCardService, creditCardStateService: CreditCardStateService, formMessagesService: FormMessagesService, editSavedMethodsService: EditSavedMethodsService, userBehaviourAnalyticsService: UserBehaviourAnalyticsService, performanceService: PerformanceService, combinedPaymentMethodsService: CombinedPaymentMethodsService);
73
+ constructor(settingsService: SettingsService, countryService: CountryService, paymentMethodsService: PaymentMethodsService, savedMethodsService: SavedMethodsService, userBalanceService: UserBalanceService, paymentConfigService: PaymentConfigService, paymentService: PaymentService, deviceFingerPrintService: DeviceFingerPrintService, financeDetailsService: FinanceDetailsService, legalService: LegalService, statusService: StatusService, nextActionService: NextActionService, creditCardService: CreditCardService, creditCardStateService: CreditCardStateService, formMessagesService: FormMessagesService, editSavedMethodsService: EditSavedMethodsService, userBehaviourAnalyticsService: UserBehaviourAnalyticsService, performanceService: PerformanceService, combinedPaymentMethodsService: CombinedPaymentMethodsService, countriesApiService: CountriesApiService);
72
74
  init(configuration: InitConfiguration): Promise<void>;
73
75
  getStatus(url?: string): Promise<Status>;
74
76
  sendAnalytics(action: string, type: keyof typeof userBehaviourEventTypes, options?: SendEventMethodOptionsInterface): void;
@@ -76,6 +78,7 @@ export declare class CoreLibraryService {
76
78
  qrCode: string;
77
79
  pid: number | null;
78
80
  };
81
+ getCountries(): Promise<CountryResponse['countryList']>;
79
82
  setCountry(country: string): void;
80
83
  getCountry(): string;
81
84
  createPayment(config: PaymentConfig): Payment;
@@ -84,7 +87,6 @@ export declare class CoreLibraryService {
84
87
  get financeDetailsUpdates$(): Observable<FinanceDetails>;
85
88
  get cardTypeUpdates$(): Observable<CreditCardState>;
86
89
  getLegalComponentConfig(): LegalComponentConfig;
87
- getFieldMask(field: Field): undefined | (() => string);
88
90
  getUserBalanceValue(): Balance | null;
89
91
  get paymentForm$(): Observable<FormControlStatus | null>;
90
92
  get formResponse$(): Observable<FormResponse | null>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xsolla/payment-client-core",
3
- "version": "0.2.14",
3
+ "version": "0.2.16",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^15.2.0",
6
6
  "@angular/core": "^15.2.0",
package/public-api.d.ts CHANGED
@@ -8,3 +8,5 @@ export * from './lib/core/sdk-payment-systems/apple-pay/apple-pay-params.interfa
8
8
  export * from './lib/core/user-behaviour-analytics/user-behaviour-event/user-behaviour-event-types';
9
9
  export * from './lib/core/payment/form/control-status.interface';
10
10
  export * from './lib/core/payment/field-names.enum';
11
+ export * from './lib/core/credit-card/credit-card-types.enum';
12
+ export * from './lib/core/countries-api/country-response.interface';
@@ -1,8 +0,0 @@
1
- import { ControlConfig } from '../control-config';
2
- export class SearchSelectControlConfig extends ControlConfig {
3
- constructor() {
4
- super(...arguments);
5
- this.controlType = 'search-select';
6
- }
7
- }
8
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VhcmNoLXNlbGVjdC1jb250cm9sLmNvbmZpZy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL3BheW1lbnQtY2xpZW50LWNvcmUvc3JjL2xpYi9jb3JlL3BheW1lbnQvZm9ybS9jb250cm9scy9zZWFyY2gtc2VsZWN0L3NlYXJjaC1zZWxlY3QtY29udHJvbC5jb25maWcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBS2xELE1BQU0sT0FBTyx5QkFBMEIsU0FBUSxhQUFhO0lBQTVEOztRQUNTLGdCQUFXLE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lsiZXhwb3J0IGludGVyZmFjZSBNYXNrQ29uZmlnIHtcbiAgZ3VpZGU6IGJvb2xlYW47XG4gIHVubWFza01vZGVsVmFsdWU6IGJvb2xlYW47XG4gIHNob3dNYXNrOiBib29sZWFuO1xuICBtYXNrPygpOiBzdHJpbmc7XG59XG4iXX0=
@@ -1,7 +0,0 @@
1
- export const masksFunctionsMap = {
2
- zip: () => {
3
- const zipLength = 5;
4
- return new Array(zipLength).fill('9').join('');
5
- },
6
- };
7
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFza3MtZnVuY3Rpb25zLm1hcC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL3BheW1lbnQtY2xpZW50LWNvcmUvc3JjL2xpYi9jb3JlL3BheW1lbnQvZm9ybS9tYXNrcy1mdW5jdGlvbnMubWFwLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE1BQU0sQ0FBQyxNQUFNLGlCQUFpQixHQUFnRDtJQUM1RSxHQUFHLEVBQUUsR0FBRyxFQUFFO1FBQ1IsTUFBTSxTQUFTLEdBQUcsQ0FBQyxDQUFDO1FBQ3BCLE9BQU8sSUFBSSxLQUFLLENBQUMsU0FBUyxDQUFDLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDLElBQUksQ0FBQyxFQUFFLENBQUMsQ0FBQztJQUNqRCxDQUFDO0NBQ0YsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBjb25zdCBtYXNrc0Z1bmN0aW9uc01hcDogeyBbZmllbGROYW1lT3JUeXBlOiBzdHJpbmddOiAoKSA9PiBzdHJpbmcgfSA9IHtcbiAgemlwOiAoKSA9PiB7XG4gICAgY29uc3QgemlwTGVuZ3RoID0gNTtcbiAgICByZXR1cm4gbmV3IEFycmF5KHppcExlbmd0aCkuZmlsbCgnOScpLmpvaW4oJycpO1xuICB9LFxufTtcbiJdfQ==
@@ -1,6 +0,0 @@
1
- export interface MaskConfig {
2
- guide: boolean;
3
- unmaskModelValue: boolean;
4
- showMask: boolean;
5
- mask?(): string;
6
- }
@@ -1,3 +0,0 @@
1
- export declare const masksFunctionsMap: {
2
- [fieldNameOrType: string]: () => string;
3
- };