@xsolla/payment-client-core 0.2.101 → 0.2.102

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.
@@ -10,4 +10,5 @@ import { ShowMobilePaymentScreenAction } from './show-mobile-payment-screen/show
10
10
  import { ShowXsollaNumberAction } from './show-xsolla-number/show-xsolla-number.action.type';
11
11
  import { ShowCashPaymentInstructionAction } from './show-cash-payment-instruction/show-cash-payment-instruction.action.type';
12
12
  import { ThreeDsRedirectAction } from './three-ds-redirect/three-ds-redirect.action.type';
13
- export type NextAction = CheckStatusAction | ShowFieldsAction | StatusUpdatedAction | ShowErrorsAction | RedirectAction | ThreeDsAction | ThreeDsRedirectAction | SpecialButtonAction | ShowQrCodeAction | ShowMobilePaymentScreenAction | ShowXsollaNumberAction | ShowCashPaymentInstructionAction;
13
+ import { ServerErrorAction } from './server-error/server-error.action.type';
14
+ export type NextAction = CheckStatusAction | ShowFieldsAction | StatusUpdatedAction | ShowErrorsAction | RedirectAction | ThreeDsAction | ThreeDsRedirectAction | SpecialButtonAction | ShowQrCodeAction | ShowMobilePaymentScreenAction | ShowXsollaNumberAction | ShowCashPaymentInstructionAction | ServerErrorAction;
@@ -0,0 +1,10 @@
1
+ import { ActionCreator } from '../action.interface';
2
+ import { ServerErrorAction, ServerErrorActionData, ServerErrorActionType } from './server-error.action.type';
3
+ import * as i0 from "@angular/core";
4
+ export declare class ServerErrorActionCreator implements ActionCreator<unknown, ServerErrorActionType, ServerErrorActionData> {
5
+ type: ServerErrorActionType;
6
+ getActionData(data: ServerErrorActionData): ServerErrorAction;
7
+ isSuitable(): boolean;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<ServerErrorActionCreator, never>;
9
+ static ɵprov: i0.ɵɵInjectableDeclaration<ServerErrorActionCreator>;
10
+ }
@@ -0,0 +1,7 @@
1
+ import { Action } from '../action.interface';
2
+ export type ServerErrorActionType = 'server_error';
3
+ export interface ServerErrorActionData {
4
+ status: number;
5
+ message: string;
6
+ }
7
+ export type ServerErrorAction = Action<ServerErrorActionType, ServerErrorActionData>;
@@ -4,6 +4,7 @@ import { SettingsService } from '../../../settings/settings.service';
4
4
  import { PaymentConfiguration } from '../../payment-configuration.interface';
5
5
  import { NextActionService } from '../../actions/next-action.service';
6
6
  import { ShowErrorsActionCreator } from '../../actions/show-errors/show-errors.action.class';
7
+ import { ServerErrorActionCreator } from '../../actions/server-error/server-error.action.class';
7
8
  import { XpsApiService } from '../../xps-api/xps-api.service';
8
9
  import { InitializeResponseFactory } from './response/initialize-response.token';
9
10
  import { InitializeResponse } from './response/initialize-response.class';
@@ -21,10 +22,11 @@ export declare class InitializeService {
21
22
  private readonly xpsResponseErrorsMappingService;
22
23
  private readonly encryptCreditCardService;
23
24
  private readonly showErrorsActionCreator;
25
+ private readonly serverErrorActionCreator;
24
26
  private readonly userBehaviourAnalyticsService;
25
27
  private readonly paymentSettingsService;
26
28
  private readonly sessionService;
27
- constructor(responseFactory: InitializeResponseFactory, xpsApiService: XpsApiService, settingsService: SettingsService, countryService: CountryService, nextActionService: NextActionService, xpsResponseErrorsMappingService: XpsResponseErrorsMappingService, encryptCreditCardService: EncryptCreditCardService, showErrorsActionCreator: ShowErrorsActionCreator, userBehaviourAnalyticsService: UserBehaviourAnalyticsService, paymentSettingsService: PaymentSettingsService, sessionService: SessionService);
29
+ constructor(responseFactory: InitializeResponseFactory, xpsApiService: XpsApiService, settingsService: SettingsService, countryService: CountryService, nextActionService: NextActionService, xpsResponseErrorsMappingService: XpsResponseErrorsMappingService, encryptCreditCardService: EncryptCreditCardService, showErrorsActionCreator: ShowErrorsActionCreator, serverErrorActionCreator: ServerErrorActionCreator, userBehaviourAnalyticsService: UserBehaviourAnalyticsService, paymentSettingsService: PaymentSettingsService, sessionService: SessionService);
28
30
  request(config: PaymentConfiguration): Promise<InitializeResponse>;
29
31
  private setCreditCardEncryptKey;
30
32
  static ɵfac: i0.ɵɵFactoryDeclaration<InitializeService, never>;
@@ -11,6 +11,8 @@ import { XpsResponseErrorsMappingService } from '../../../errors-mapping/xps-res
11
11
  import { UserBehaviourAnalyticsService } from '../../../user-behaviour-analytics/user-behaviour-analytics.service';
12
12
  import { PaymentConfiguration } from '../../payment-configuration.interface';
13
13
  import { PaymentSettingsService } from '../../payment-settings/payment-settings.service';
14
+ import { NextActionService } from '../../actions/next-action.service';
15
+ import { ServerErrorActionCreator } from '../../actions/server-error/server-error.action.class';
14
16
  import * as i0 from "@angular/core";
15
17
  export declare class SubmitService {
16
18
  private readonly requestFactory;
@@ -22,7 +24,9 @@ export declare class SubmitService {
22
24
  private readonly encryptCreditCardService;
23
25
  private readonly userBehaviourAnalyticsService;
24
26
  private readonly paymentSettingsService;
25
- constructor(requestFactory: SubmitRequestFactory, responseFactory: SubmitResponseFactory, settingsService: SettingsService, deviceFingerPrintService: DeviceFingerPrintService, xpsApiService: XpsApiService, xpsResponseErrorsMappingService: XpsResponseErrorsMappingService, encryptCreditCardService: EncryptCreditCardService, userBehaviourAnalyticsService: UserBehaviourAnalyticsService, paymentSettingsService: PaymentSettingsService);
27
+ private readonly nextActionService;
28
+ private readonly serverErrorActionCreator;
29
+ constructor(requestFactory: SubmitRequestFactory, responseFactory: SubmitResponseFactory, settingsService: SettingsService, deviceFingerPrintService: DeviceFingerPrintService, xpsApiService: XpsApiService, xpsResponseErrorsMappingService: XpsResponseErrorsMappingService, encryptCreditCardService: EncryptCreditCardService, userBehaviourAnalyticsService: UserBehaviourAnalyticsService, paymentSettingsService: PaymentSettingsService, nextActionService: NextActionService, serverErrorActionCreator: ServerErrorActionCreator);
26
30
  request(fields: Field[], form: UntypedFormGroup, config: PaymentConfiguration): Promise<SubmitResponse>;
27
31
  private fillUserSession;
28
32
  static ɵfac: i0.ɵɵFactoryDeclaration<SubmitService, never>;
@@ -9,6 +9,7 @@ import { SyncResponse } from './response/sync-response.class';
9
9
  import { SyncResponseFactory } from './response/sync-response.token';
10
10
  import { NextActionService } from '../../actions/next-action.service';
11
11
  import { ShowErrorsActionCreator } from '../../actions/show-errors/show-errors.action.class';
12
+ import { ServerErrorActionCreator } from '../../actions/server-error/server-error.action.class';
12
13
  import { XpsApiService } from '../../xps-api/xps-api.service';
13
14
  import { FieldAsyncValidation } from './field-async-validation.interface';
14
15
  import { EncryptCreditCardService } from '../../../encrypt-credit-card/encrypt-credit-card.service';
@@ -27,6 +28,7 @@ export declare class SyncService extends EmitDataService<XpsResponse> {
27
28
  private readonly xpsResponseErrorsMappingService;
28
29
  private readonly encryptCreditCardService;
29
30
  private readonly showErrorsActionCreator;
31
+ private readonly serverErrorActionCreator;
30
32
  private readonly userBehaviourAnalyticsService;
31
33
  private readonly paymentSettingsService;
32
34
  private readonly sessionService;
@@ -36,7 +38,7 @@ export declare class SyncService extends EmitDataService<XpsResponse> {
36
38
  private fields;
37
39
  private fieldSyncTimers;
38
40
  private readonly fieldAsyncValidation;
39
- constructor(requestFactory: SyncRequestFactory, responseFactory: SyncResponseFactory, xpsApiService: XpsApiService, nextActionService: NextActionService, settingsService: SettingsService, xpsResponseErrorsMappingService: XpsResponseErrorsMappingService, encryptCreditCardService: EncryptCreditCardService, showErrorsActionCreator: ShowErrorsActionCreator, userBehaviourAnalyticsService: UserBehaviourAnalyticsService, paymentSettingsService: PaymentSettingsService, sessionService: SessionService);
41
+ constructor(requestFactory: SyncRequestFactory, responseFactory: SyncResponseFactory, xpsApiService: XpsApiService, nextActionService: NextActionService, settingsService: SettingsService, xpsResponseErrorsMappingService: XpsResponseErrorsMappingService, encryptCreditCardService: EncryptCreditCardService, showErrorsActionCreator: ShowErrorsActionCreator, serverErrorActionCreator: ServerErrorActionCreator, userBehaviourAnalyticsService: UserBehaviourAnalyticsService, paymentSettingsService: PaymentSettingsService, sessionService: SessionService);
40
42
  get fieldAsyncValidation$(): Observable<FieldAsyncValidation>;
41
43
  setup(form: UntypedFormGroup, fields: Field[], config: PaymentConfiguration): void;
42
44
  reset(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xsolla/payment-client-core",
3
- "version": "0.2.101",
3
+ "version": "0.2.102",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^17.3.3",
6
6
  "@angular/core": "^17.3.3",