@xsolla/payment-client-core 0.0.14 → 0.1.0

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 (30) hide show
  1. package/esm2020/lib/core/payment/actions/next-action.interface.mjs +1 -1
  2. package/esm2020/lib/core/payment/actions/next-action.service.mjs +6 -2
  3. package/esm2020/lib/core/payment/actions/next-actions.mjs +6 -2
  4. package/esm2020/lib/core/payment/actions/show-errors/show-errors.action.class.mjs +9 -0
  5. package/esm2020/lib/core/payment/actions/show-errors/show-errors.action.token.mjs +13 -0
  6. package/esm2020/lib/core/payment/actions/show-errors/show-errors.action.type.mjs +2 -0
  7. package/esm2020/lib/core/payment/config/config.service.mjs +4 -1
  8. package/esm2020/lib/core/payment/extended-xps-error.mjs +2 -0
  9. package/esm2020/lib/core/payment/initialize/initialize.service.mjs +13 -6
  10. package/esm2020/lib/core/payment/payment.service.mjs +28 -1
  11. package/esm2020/lib/core/payment/sync/sync.service.mjs +11 -5
  12. package/esm2020/lib/core/url/url.service.mjs +7 -1
  13. package/esm2020/lib/core-library.module.mjs +4 -2
  14. package/fesm2015/xsolla-payment-client-core.mjs +258 -180
  15. package/fesm2015/xsolla-payment-client-core.mjs.map +1 -1
  16. package/fesm2020/xsolla-payment-client-core.mjs +249 -177
  17. package/fesm2020/xsolla-payment-client-core.mjs.map +1 -1
  18. package/lib/core/payment/actions/next-action.interface.d.ts +2 -1
  19. package/lib/core/payment/actions/next-action.service.d.ts +1 -1
  20. package/lib/core/payment/actions/next-actions.d.ts +1 -0
  21. package/lib/core/payment/actions/show-errors/show-errors.action.class.d.ts +8 -0
  22. package/lib/core/payment/actions/show-errors/show-errors.action.token.d.ts +4 -0
  23. package/lib/core/payment/actions/show-errors/show-errors.action.type.d.ts +7 -0
  24. package/lib/core/payment/extended-xps-error.d.ts +4 -0
  25. package/lib/core/payment/initialize/initialize.service.d.ts +3 -1
  26. package/lib/core/payment/payment.service.d.ts +3 -1
  27. package/lib/core/payment/sync/sync.service.d.ts +3 -1
  28. package/package.json +1 -1
  29. package/xsolla-payment-client-core-0.1.0.tgz +0 -0
  30. package/xsolla-payment-client-core-0.0.14.tgz +0 -0
@@ -2,4 +2,5 @@ import { CheckStatusAction } from './check-status/check-status.action.type';
2
2
  import { ShowFieldsAction } from './show-fields/show-fields.action.type';
3
3
  import { StatusUpdatedAction } from './status-updated/status-updated.action.type';
4
4
  import { RedirectAction } from './redirect/redirect.action.type';
5
- export type NextAction = CheckStatusAction | ShowFieldsAction | StatusUpdatedAction | RedirectAction;
5
+ import { ShowErrorsAction } from './show-errors/show-errors.action.class';
6
+ export type NextAction = CheckStatusAction | ShowFieldsAction | StatusUpdatedAction | ShowErrorsAction | RedirectAction;
@@ -1,8 +1,8 @@
1
1
  import { Injector } from '@angular/core';
2
+ import { Observable } from 'rxjs';
2
3
  import { NextAction } from './next-action.interface';
3
4
  import { SubmitResponse } from '../submit/response/submit-response.class';
4
5
  import { NextActionTokens } from './next-actions';
5
- import { Observable } from 'rxjs';
6
6
  import * as i0 from "@angular/core";
7
7
  export declare class NextActionService {
8
8
  private readonly nextActionTokens;
@@ -3,3 +3,4 @@ import { Action } from './action.interface';
3
3
  export type NextActionTokens = ValueProvider[];
4
4
  export declare const nextActionsToken: InjectionToken<Action<string, object>>;
5
5
  export declare const nextActions: NextActionTokens;
6
+ export declare const flowUpdateNextActions: NextActionTokens;
@@ -0,0 +1,8 @@
1
+ import { ExtendedXpsError } from '../../extended-xps-error';
2
+ import { Action } from '../action.interface';
3
+ import { ShowErrorsActionData, ShowErrorsActionType } from './show-errors.action.type';
4
+ export declare class ShowErrorsAction implements Action {
5
+ type: ShowErrorsActionType;
6
+ data: ShowErrorsActionData;
7
+ constructor(errors: ExtendedXpsError[]);
8
+ }
@@ -0,0 +1,4 @@
1
+ import { InjectionToken, ValueProvider } from '@angular/core';
2
+ import { ActionFactoryValue } from '../action-factory-value.interface';
3
+ export declare const showErrorsActionFactoryToken: InjectionToken<ActionFactoryValue>;
4
+ export declare const showErrorsActionFactoryProvider: ValueProvider;
@@ -0,0 +1,7 @@
1
+ import { ExtendedXpsError } from '../../extended-xps-error';
2
+ import { Action } from '../action.interface';
3
+ export type ShowErrorsActionType = 'show_errors';
4
+ export interface ShowErrorsActionData {
5
+ errors: ExtendedXpsError[] | null;
6
+ }
7
+ export type ShowErrorsAction = Action<ShowErrorsActionType, ShowErrorsActionData>;
@@ -0,0 +1,4 @@
1
+ import { XpsError } from './xps-error.interface';
2
+ export interface ExtendedXpsError extends XpsError {
3
+ fieldValidationError?: string;
4
+ }
@@ -4,15 +4,17 @@ import { SettingsService } from '../../settings/settings.service';
4
4
  import { PaymentConfig } from '../payment-config.interface';
5
5
  import { InitializeResponseFactory } from './initialize-response.token';
6
6
  import { InitializeResponse } from './initialize-response.class';
7
+ import { NextActionService } from '../actions/next-action.service';
7
8
  import * as i0 from "@angular/core";
8
9
  export declare class InitializeService {
9
10
  protected readonly responseFactory: InitializeResponseFactory;
10
11
  private readonly secureApi;
11
12
  private readonly settingsService;
12
13
  private readonly countryService;
14
+ private readonly nextActionService;
13
15
  private readonly apiRoute;
14
16
  private readonly ps4ReferId;
15
- constructor(responseFactory: InitializeResponseFactory, secureApi: SecureApiClient, settingsService: SettingsService, countryService: CountryService);
17
+ constructor(responseFactory: InitializeResponseFactory, secureApi: SecureApiClient, settingsService: SettingsService, countryService: CountryService, nextActionService: NextActionService);
16
18
  request(config: PaymentConfig): Promise<InitializeResponse>;
17
19
  static ɵfac: i0.ɵɵFactoryDeclaration<InitializeService, never>;
18
20
  static ɵprov: i0.ɵɵInjectableDeclaration<InitializeService>;
@@ -1,4 +1,4 @@
1
- import { UntypedFormGroup, ValidationErrors } from '@angular/forms';
1
+ import { UntypedFormGroup } from '@angular/forms';
2
2
  import { FormService } from './form/form.service';
3
3
  import { InitializeService } from './initialize/initialize.service';
4
4
  import { Status } from './status/status.interface';
@@ -13,6 +13,7 @@ import { FinanceDetailsService } from './finance-details/finance-details.service
13
13
  import { NextAction } from './actions/next-action.interface';
14
14
  import { Field } from './field.interface';
15
15
  import { PaymentConfig } from './payment-config.interface';
16
+ import { ValidationErrors } from './form/validators/validation-errors.interface';
16
17
  import * as i0 from "@angular/core";
17
18
  export declare class PaymentService {
18
19
  private readonly initializeService;
@@ -43,6 +44,7 @@ export declare class PaymentService {
43
44
  private emitFinanceDetails;
44
45
  private setupSyncService;
45
46
  private listenFinanceDetails;
47
+ private listenSyncValidationErrors;
46
48
  static ɵfac: i0.ɵɵFactoryDeclaration<PaymentService, never>;
47
49
  static ɵprov: i0.ɵɵInjectableDeclaration<PaymentService>;
48
50
  }
@@ -7,17 +7,19 @@ import { XpsResponse } from '../xps-response.interface';
7
7
  import { SyncRequestFactory } from './sync-request.token';
8
8
  import { SyncResponse } from './sync-response.class';
9
9
  import { SyncResponseFactory } from './sync-response.token';
10
+ import { NextActionService } from '../actions/next-action.service';
10
11
  import * as i0 from "@angular/core";
11
12
  export declare class SyncService extends EmitDataService<XpsResponse> {
12
13
  private readonly requestFactory;
13
14
  private readonly responseFactory;
14
15
  private readonly secureApi;
16
+ private readonly nextActionService;
15
17
  private readonly settingsService;
16
18
  private readonly apiRoute;
17
19
  private prevFieldSyncStates;
18
20
  private form;
19
21
  private fields;
20
- constructor(requestFactory: SyncRequestFactory, responseFactory: SyncResponseFactory, secureApi: SecureApiClient, settingsService: SettingsService);
22
+ constructor(requestFactory: SyncRequestFactory, responseFactory: SyncResponseFactory, secureApi: SecureApiClient, nextActionService: NextActionService, settingsService: SettingsService);
21
23
  setup(form: UntypedFormGroup, fields: Field[]): void;
22
24
  reset(): void;
23
25
  validate(field: Field): Promise<ValidationErrors | null>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xsolla/payment-client-core",
3
- "version": "0.0.14",
3
+ "version": "0.1.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^15.2.0",
6
6
  "@angular/core": "^15.2.0",