@xsolla/payment-client-core 0.2.11 → 0.2.13
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.
- package/esm2020/lib/core/combined-payment-methods/combined-payment-methods.interface.mjs +2 -0
- package/esm2020/lib/core/combined-payment-methods/combined-payment-methods.service.mjs +32 -0
- package/esm2020/lib/core/extended-window.interface.mjs +1 -1
- package/esm2020/lib/core/payment/field-names.enum.mjs +4 -1
- package/esm2020/lib/core/payment/form/control-status.interface.mjs +2 -0
- package/esm2020/lib/core/payment/initialize/initialize.service.mjs +17 -7
- package/esm2020/lib/core/payment/payment.interface.mjs +1 -1
- package/esm2020/lib/core/payment/payment.service.mjs +12 -1
- package/esm2020/lib/core/payment/status/listen-status/listen-status.service.mjs +16 -4
- package/esm2020/lib/core/payment/submit/submit.service.mjs +21 -4
- package/esm2020/lib/core/payment/sync/sync.service.mjs +14 -4
- package/esm2020/lib/core/payment/xps-api/xps-api.service.mjs +7 -5
- package/esm2020/lib/core/payment-methods/payment-methods.service.mjs +4 -1
- package/esm2020/lib/core/performance/performance.service.mjs +111 -0
- package/esm2020/lib/core/performance/xhr-action.interface.mjs +2 -0
- package/esm2020/lib/core/performance/xhr-action.service.mjs +114 -0
- package/esm2020/lib/core/sdk-payment-systems/google-pay/google-pay.service.mjs +10 -10
- package/esm2020/lib/core/sdk-payment-systems/payment-systems/payment-system-processing.service.mjs +3 -3
- package/esm2020/lib/core/sdk-payment-systems/sdk-payment-systems.interface.mjs +1 -1
- package/esm2020/lib/core/settings/configuration.interface.mjs +1 -1
- package/esm2020/lib/core/settings/settings.service.mjs +4 -6
- package/esm2020/lib/core/user-behaviour-analytics/event-builder/event-builder.service.mjs +144 -0
- package/esm2020/lib/core/user-behaviour-analytics/event-builder/event-parameter-types.mjs +9 -0
- package/esm2020/lib/core/user-behaviour-analytics/event-builder/invoice.interface.mjs +2 -0
- package/esm2020/lib/core/user-behaviour-analytics/event-builder/purchase.type.mjs +2 -0
- package/esm2020/lib/core/user-behaviour-analytics/event-builder/user-behaviour-event.interface.mjs +2 -0
- package/esm2020/lib/core/user-behaviour-analytics/one-time-analytics-events.const.mjs +5 -0
- package/esm2020/lib/core/user-behaviour-analytics/user-behaviour-analytics.interface.mjs +2 -0
- package/esm2020/lib/core/user-behaviour-analytics/user-behaviour-analytics.service.mjs +158 -0
- package/esm2020/lib/core/user-behaviour-analytics/user-behaviour-event/user-behaviour-event-categories.mjs +5 -0
- package/esm2020/lib/core/user-behaviour-analytics/user-behaviour-event/user-behaviour-event-types.mjs +8 -0
- package/esm2020/lib/core/user-behaviour-analytics/user-behaviour-event-name.enum.mjs +8 -0
- package/esm2020/lib/core/user-behaviour-analytics/user-session-options.mjs +2 -0
- package/esm2020/lib/core-library.service.mjs +17 -21
- package/esm2020/public-api.mjs +6 -1
- package/fesm2015/xsolla-payment-client-core.mjs +6978 -6356
- package/fesm2015/xsolla-payment-client-core.mjs.map +1 -1
- package/fesm2020/xsolla-payment-client-core.mjs +6795 -6189
- package/fesm2020/xsolla-payment-client-core.mjs.map +1 -1
- package/lib/core/combined-payment-methods/combined-payment-methods.interface.d.ts +9 -0
- package/lib/core/combined-payment-methods/combined-payment-methods.service.d.ts +12 -0
- package/lib/core/extended-window.interface.d.ts +1 -0
- package/lib/core/payment/field-names.enum.d.ts +3 -0
- package/lib/core/payment/form/control-status.interface.d.ts +7 -0
- package/lib/core/payment/initialize/initialize.service.d.ts +3 -1
- package/lib/core/payment/payment.interface.d.ts +3 -0
- package/lib/core/payment/payment.service.d.ts +3 -0
- package/lib/core/payment/status/listen-status/listen-status.service.d.ts +3 -1
- package/lib/core/payment/submit/submit.service.d.ts +4 -1
- package/lib/core/payment/sync/sync.service.d.ts +3 -1
- package/lib/core/payment/xps-api/xps-api.service.d.ts +3 -1
- package/lib/core/payment-methods/payment-methods.service.d.ts +2 -0
- package/lib/core/performance/performance.service.d.ts +24 -0
- package/lib/core/performance/xhr-action.interface.d.ts +8 -0
- package/lib/core/performance/xhr-action.service.d.ts +25 -0
- package/lib/core/sdk-payment-systems/google-pay/google-pay.service.d.ts +2 -2
- package/lib/core/sdk-payment-systems/payment-systems/payment-system-processing.service.d.ts +1 -1
- package/lib/core/sdk-payment-systems/sdk-payment-systems.interface.d.ts +0 -16
- package/lib/core/settings/configuration.interface.d.ts +0 -1
- package/lib/core/settings/settings.service.d.ts +1 -2
- package/lib/core/user-behaviour-analytics/event-builder/event-builder.service.d.ts +22 -0
- package/lib/core/user-behaviour-analytics/event-builder/event-parameter-types.d.ts +7 -0
- package/lib/core/user-behaviour-analytics/event-builder/invoice.interface.d.ts +14 -0
- package/lib/core/user-behaviour-analytics/event-builder/purchase.type.d.ts +1 -0
- package/lib/core/user-behaviour-analytics/event-builder/user-behaviour-event.interface.d.ts +52 -0
- package/lib/core/user-behaviour-analytics/one-time-analytics-events.const.d.ts +1 -0
- package/lib/core/user-behaviour-analytics/user-behaviour-analytics.interface.d.ts +36 -0
- package/lib/core/user-behaviour-analytics/user-behaviour-analytics.service.d.ts +43 -0
- package/lib/core/user-behaviour-analytics/user-behaviour-event/user-behaviour-event-categories.d.ts +4 -0
- package/lib/core/user-behaviour-analytics/user-behaviour-event/user-behaviour-event-types.d.ts +7 -0
- package/lib/core/user-behaviour-analytics/user-behaviour-event-name.enum.d.ts +6 -0
- package/lib/core/user-behaviour-analytics/user-session-options.d.ts +15 -0
- package/lib/core-library.service.d.ts +12 -5
- package/package.json +1 -1
- package/public-api.d.ts +5 -0
- package/xsolla-payment-client-core-0.2.13.tgz +0 -0
- package/xsolla-payment-client-core-0.2.11.tgz +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PaymentMethod } from '../payment-methods/payment-method.interface';
|
|
2
|
+
import { SavedMethod } from '../saved-methods/saved-method.interface';
|
|
3
|
+
export interface CombinedPaymentMethods {
|
|
4
|
+
paymentMethods: {
|
|
5
|
+
quick: PaymentMethod[];
|
|
6
|
+
remained: PaymentMethod[];
|
|
7
|
+
};
|
|
8
|
+
savedMethods: SavedMethod[];
|
|
9
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SavedMethodsService } from '../saved-methods/saved-methods.service';
|
|
2
|
+
import { PaymentMethodsService } from '../payment-methods/payment-methods.service';
|
|
3
|
+
import { CombinedPaymentMethods } from './combined-payment-methods.interface';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class CombinedPaymentMethodsService {
|
|
6
|
+
private readonly paymentMethodsService;
|
|
7
|
+
private readonly savedMethodsService;
|
|
8
|
+
constructor(paymentMethodsService: PaymentMethodsService, savedMethodsService: SavedMethodsService);
|
|
9
|
+
getCombinedPaymentMethods(): Promise<CombinedPaymentMethods>;
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CombinedPaymentMethodsService, never>;
|
|
11
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CombinedPaymentMethodsService>;
|
|
12
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ApplePaySession } from 'braintree-web';
|
|
2
2
|
import { GooglePayLibrary } from './sdk-payment-systems/google-pay/google-pay-library.interface';
|
|
3
3
|
export interface ExtendedWindow extends Window {
|
|
4
|
+
PerformanceObserver?: typeof PerformanceObserver;
|
|
4
5
|
ApplePaySession: typeof ApplePaySession;
|
|
5
6
|
BraintreeData?: {
|
|
6
7
|
_getDeviceData(): unknown;
|
|
@@ -20,6 +20,7 @@ export declare enum FieldNames {
|
|
|
20
20
|
description = "description",
|
|
21
21
|
email = "email",
|
|
22
22
|
psEmail = "psEmail",
|
|
23
|
+
bazitemail = "bazitemail",
|
|
23
24
|
euCheck = "eu_check",
|
|
24
25
|
extraCvv = "extra_cvv",
|
|
25
26
|
extraCardNumber = "extra_card_number",
|
|
@@ -59,5 +60,7 @@ export declare enum FieldNames {
|
|
|
59
60
|
sum = "sum",
|
|
60
61
|
out = "out",
|
|
61
62
|
tinkoffDisclaimer = "ps.tinkoff.disclaimer",
|
|
63
|
+
ppEmail = "pp_email",
|
|
64
|
+
redeemPoints = "redeemPoints",
|
|
62
65
|
omnibusDirective = "omnibus_directive"
|
|
63
66
|
}
|
|
@@ -8,6 +8,7 @@ import { XpsApiService } from '../xps-api/xps-api.service';
|
|
|
8
8
|
import { InitializeResponseFactory } from './response/initialize-response.token';
|
|
9
9
|
import { InitializeResponse } from './response/initialize-response.class';
|
|
10
10
|
import { XpsResponseErrorsMappingService } from '../../errors-mapping/xps-response-errors-mapping.service';
|
|
11
|
+
import { UserBehaviourAnalyticsService } from '../../user-behaviour-analytics/user-behaviour-analytics.service';
|
|
11
12
|
import * as i0 from "@angular/core";
|
|
12
13
|
export declare class InitializeService {
|
|
13
14
|
protected readonly responseFactory: InitializeResponseFactory;
|
|
@@ -18,8 +19,9 @@ export declare class InitializeService {
|
|
|
18
19
|
private readonly xpsResponseErrorsMappingService;
|
|
19
20
|
private readonly encryptCreditCardService;
|
|
20
21
|
private readonly showErrorsActionCreator;
|
|
22
|
+
private readonly userBehaviourAnalyticsService;
|
|
21
23
|
private readonly ps4ReferId;
|
|
22
|
-
constructor(responseFactory: InitializeResponseFactory, xpsApiService: XpsApiService, settingsService: SettingsService, countryService: CountryService, nextActionService: NextActionService, xpsResponseErrorsMappingService: XpsResponseErrorsMappingService, encryptCreditCardService: EncryptCreditCardService, showErrorsActionCreator: ShowErrorsActionCreator);
|
|
24
|
+
constructor(responseFactory: InitializeResponseFactory, xpsApiService: XpsApiService, settingsService: SettingsService, countryService: CountryService, nextActionService: NextActionService, xpsResponseErrorsMappingService: XpsResponseErrorsMappingService, encryptCreditCardService: EncryptCreditCardService, showErrorsActionCreator: ShowErrorsActionCreator, userBehaviourAnalyticsService: UserBehaviourAnalyticsService);
|
|
23
25
|
request(config: PaymentConfig): Promise<InitializeResponse>;
|
|
24
26
|
private setCreditCardEncryptKey;
|
|
25
27
|
static ɵfac: i0.ɵɵFactoryDeclaration<InitializeService, never>;
|
|
@@ -8,6 +8,8 @@ import { FinanceDetails } from './finance-details/finance-details.interface';
|
|
|
8
8
|
import { InputEventName } from './form/input-event.enum';
|
|
9
9
|
import { FormFieldsStatus } from './form/form-fields-status.interface';
|
|
10
10
|
import { FormState } from './form/form-state.interface';
|
|
11
|
+
import { FieldNames } from './field-names.enum';
|
|
12
|
+
import { ControlStatus } from './form/control-status.interface';
|
|
11
13
|
export interface Payment {
|
|
12
14
|
initialize(): Promise<Field[]>;
|
|
13
15
|
submit(): Promise<NextAction | null | void>;
|
|
@@ -26,6 +28,7 @@ export interface Payment {
|
|
|
26
28
|
updateFieldFormState(fieldName: string, formState: FormState): void;
|
|
27
29
|
formMessages$: Observable<string[]>;
|
|
28
30
|
getFormStatus(): FormControlStatus | undefined;
|
|
31
|
+
getControlStatus(name: FieldNames): ControlStatus | null;
|
|
29
32
|
};
|
|
30
33
|
financeDetailsUpdates$: Observable<FinanceDetails>;
|
|
31
34
|
addExtraField(name: string, value: string): void;
|
|
@@ -19,6 +19,7 @@ import { InputEventName } from './form/input-event.enum';
|
|
|
19
19
|
import { FormFieldsStatus } from './form/form-fields-status.interface';
|
|
20
20
|
import { ThreeDsService } from './three-ds/three-ds.service';
|
|
21
21
|
import { CreditCardStateService } from './credit-card-state/credit-card-state.service';
|
|
22
|
+
import { FieldNames } from './field-names.enum';
|
|
22
23
|
import { FormState } from './form/form-state.interface';
|
|
23
24
|
import { FormMessagesService } from './form-messages/form-messages.service';
|
|
24
25
|
import { SettingsService } from '../settings/settings.service';
|
|
@@ -26,6 +27,7 @@ import { CountryService } from '../country/country.service';
|
|
|
26
27
|
import { SdkPaymentSystemsInitialData } from '../sdk-payment-systems/sdk-payment-systems-initial-data.interface';
|
|
27
28
|
import { FormResponse } from './form-response.interface';
|
|
28
29
|
import { CheckStatusActionCreator } from './actions/check-status/check-status.action.class';
|
|
30
|
+
import { ControlStatus } from './form/control-status.interface';
|
|
29
31
|
import * as i0 from "@angular/core";
|
|
30
32
|
export declare class PaymentService {
|
|
31
33
|
private readonly initializeService;
|
|
@@ -62,6 +64,7 @@ export declare class PaymentService {
|
|
|
62
64
|
initialize(config: PaymentConfig): Promise<Field[]>;
|
|
63
65
|
submit(): Promise<NextAction | null | void>;
|
|
64
66
|
getFields(): Field[];
|
|
67
|
+
getControlStatus(name: FieldNames): ControlStatus | null;
|
|
65
68
|
getInitialDataForSdkPaymentSystems(): SdkPaymentSystemsInitialData;
|
|
66
69
|
getQrCode(): string;
|
|
67
70
|
getPid(): number | null;
|
|
@@ -4,11 +4,13 @@ import { CheckStatusService } from '../check-status/check-status.service';
|
|
|
4
4
|
import { WebsocketStatusService } from '../websocket-status/websocket-status.service';
|
|
5
5
|
import { StatusSettings } from '../status-settings.interface';
|
|
6
6
|
import { StatusUpdated } from '../status-updated.interface';
|
|
7
|
+
import { UserBehaviourAnalyticsService } from '../../../user-behaviour-analytics/user-behaviour-analytics.service';
|
|
7
8
|
import * as i0 from "@angular/core";
|
|
8
9
|
export declare class ListenStatusService {
|
|
9
10
|
private readonly statusService;
|
|
10
11
|
private readonly checkStatusService;
|
|
11
12
|
private readonly websocketStatusService;
|
|
13
|
+
private readonly userBehaviourAnalyticsService;
|
|
12
14
|
isListening: boolean;
|
|
13
15
|
private readonly websocketOpenedSubject;
|
|
14
16
|
private readonly statusUpdatedSubject;
|
|
@@ -16,7 +18,7 @@ export declare class ListenStatusService {
|
|
|
16
18
|
private destroy$;
|
|
17
19
|
get websocketOpened$(): Observable<StatusSettings>;
|
|
18
20
|
get statusUpdated$(): Observable<StatusUpdated>;
|
|
19
|
-
constructor(statusService: StatusRequestService, checkStatusService: CheckStatusService, websocketStatusService: WebsocketStatusService);
|
|
21
|
+
constructor(statusService: StatusRequestService, checkStatusService: CheckStatusService, websocketStatusService: WebsocketStatusService, userBehaviourAnalyticsService: UserBehaviourAnalyticsService);
|
|
20
22
|
listen(invoice: number): Observable<StatusSettings>;
|
|
21
23
|
stopListening(): void;
|
|
22
24
|
private subscribeStatusUpdate;
|
|
@@ -8,6 +8,7 @@ import { DeviceFingerPrintService } from '../../device-finger-print/device-finge
|
|
|
8
8
|
import { XpsApiService } from '../xps-api/xps-api.service';
|
|
9
9
|
import { EncryptCreditCardService } from '../../encrypt-credit-card/encrypt-credit-card.service';
|
|
10
10
|
import { XpsResponseErrorsMappingService } from '../../errors-mapping/xps-response-errors-mapping.service';
|
|
11
|
+
import { UserBehaviourAnalyticsService } from '../../user-behaviour-analytics/user-behaviour-analytics.service';
|
|
11
12
|
import * as i0 from "@angular/core";
|
|
12
13
|
export declare class SubmitService {
|
|
13
14
|
private readonly requestFactory;
|
|
@@ -17,8 +18,10 @@ export declare class SubmitService {
|
|
|
17
18
|
private readonly xpsApiService;
|
|
18
19
|
private readonly xpsResponseErrorsMappingService;
|
|
19
20
|
private readonly encryptCreditCardService;
|
|
20
|
-
|
|
21
|
+
private readonly userBehaviourAnalyticsService;
|
|
22
|
+
constructor(requestFactory: SubmitRequestFactory, responseFactory: SubmitResponseFactory, settingsService: SettingsService, deviceFingerPrintService: DeviceFingerPrintService, xpsApiService: XpsApiService, xpsResponseErrorsMappingService: XpsResponseErrorsMappingService, encryptCreditCardService: EncryptCreditCardService, userBehaviourAnalyticsService: UserBehaviourAnalyticsService);
|
|
21
23
|
request(fields: Field[], form: UntypedFormGroup): Promise<SubmitResponse>;
|
|
24
|
+
private fillUserSession;
|
|
22
25
|
static ɵfac: i0.ɵɵFactoryDeclaration<SubmitService, never>;
|
|
23
26
|
static ɵprov: i0.ɵɵInjectableDeclaration<SubmitService>;
|
|
24
27
|
}
|
|
@@ -13,6 +13,7 @@ import { XpsApiService } from '../xps-api/xps-api.service';
|
|
|
13
13
|
import { FieldAsyncValidation } from './field-async-validation.interface';
|
|
14
14
|
import { EncryptCreditCardService } from '../../encrypt-credit-card/encrypt-credit-card.service';
|
|
15
15
|
import { XpsResponseErrorsMappingService } from '../../errors-mapping/xps-response-errors-mapping.service';
|
|
16
|
+
import { UserBehaviourAnalyticsService } from '../../user-behaviour-analytics/user-behaviour-analytics.service';
|
|
16
17
|
import * as i0 from "@angular/core";
|
|
17
18
|
export declare class SyncService extends EmitDataService<XpsResponse> {
|
|
18
19
|
private readonly requestFactory;
|
|
@@ -23,12 +24,13 @@ export declare class SyncService extends EmitDataService<XpsResponse> {
|
|
|
23
24
|
private readonly xpsResponseErrorsMappingService;
|
|
24
25
|
private readonly encryptCreditCardService;
|
|
25
26
|
private readonly showErrorsActionCreator;
|
|
27
|
+
private readonly userBehaviourAnalyticsService;
|
|
26
28
|
private prevFieldSyncStates;
|
|
27
29
|
private form;
|
|
28
30
|
private fields;
|
|
29
31
|
private fieldSyncTimers;
|
|
30
32
|
private readonly fieldAsyncValidation;
|
|
31
|
-
constructor(requestFactory: SyncRequestFactory, responseFactory: SyncResponseFactory, xpsApiService: XpsApiService, nextActionService: NextActionService, settingsService: SettingsService, xpsResponseErrorsMappingService: XpsResponseErrorsMappingService, encryptCreditCardService: EncryptCreditCardService, showErrorsActionCreator: ShowErrorsActionCreator);
|
|
33
|
+
constructor(requestFactory: SyncRequestFactory, responseFactory: SyncResponseFactory, xpsApiService: XpsApiService, nextActionService: NextActionService, settingsService: SettingsService, xpsResponseErrorsMappingService: XpsResponseErrorsMappingService, encryptCreditCardService: EncryptCreditCardService, showErrorsActionCreator: ShowErrorsActionCreator, userBehaviourAnalyticsService: UserBehaviourAnalyticsService);
|
|
32
34
|
get fieldAsyncValidation$(): Observable<FieldAsyncValidation>;
|
|
33
35
|
setup(form: UntypedFormGroup, fields: Field[]): void;
|
|
34
36
|
reset(): void;
|
|
@@ -4,14 +4,16 @@ import { SettingsService } from '../../settings/settings.service';
|
|
|
4
4
|
import { XpsRequest } from '../xps-request.interface';
|
|
5
5
|
import { XpsResponse } from '../xps-response.interface';
|
|
6
6
|
import { CountryService } from '../../country/country.service';
|
|
7
|
+
import { UserAgentService } from '../../user-agent/user-agent.service';
|
|
7
8
|
import * as i0 from "@angular/core";
|
|
8
9
|
export declare class XpsApiService {
|
|
9
10
|
private readonly window;
|
|
10
11
|
private readonly secureApiClient;
|
|
11
12
|
private readonly settingsService;
|
|
12
13
|
private readonly countryService;
|
|
14
|
+
private readonly userAgentService;
|
|
13
15
|
private readonly directPaymentApiRoute;
|
|
14
|
-
constructor(window: ExtendedWindow, secureApiClient: SecureApiClient, settingsService: SettingsService, countryService: CountryService);
|
|
16
|
+
constructor(window: ExtendedWindow, secureApiClient: SecureApiClient, settingsService: SettingsService, countryService: CountryService, userAgentService: UserAgentService);
|
|
15
17
|
directPaymentRequest(parameters: XpsRequest): Promise<XpsResponse>;
|
|
16
18
|
private collectAnalyticsParameters;
|
|
17
19
|
private collectUserSessionId;
|
|
@@ -2,6 +2,7 @@ import { CountryService } from '../country/country.service';
|
|
|
2
2
|
import { SecureApiClient } from '../http/secure-api/secure-api.service';
|
|
3
3
|
import { SettingsService } from '../settings/settings.service';
|
|
4
4
|
import { PaymentMethod } from './payment-method.interface';
|
|
5
|
+
import { PaymentMethodsResponse } from './payment-methods-response.class';
|
|
5
6
|
import { PaymentMethodsResponseFactory } from './payment-methods-response.token';
|
|
6
7
|
import * as i0 from "@angular/core";
|
|
7
8
|
export declare class PaymentMethodsService {
|
|
@@ -12,6 +13,7 @@ export declare class PaymentMethodsService {
|
|
|
12
13
|
private readonly apiRoute;
|
|
13
14
|
private readonly cache;
|
|
14
15
|
constructor(responseFactory: PaymentMethodsResponseFactory, settingsService: SettingsService, countryService: CountryService, secureApi: SecureApiClient);
|
|
16
|
+
getAllMethods(): Promise<PaymentMethodsResponse>;
|
|
15
17
|
getList(isSaveMethodMode?: boolean): Promise<PaymentMethod[]>;
|
|
16
18
|
getQuickMethods(): Promise<PaymentMethod[]>;
|
|
17
19
|
private request;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { NgZone } from '@angular/core';
|
|
2
|
+
import { UserBehaviourAnalyticsService } from '../user-behaviour-analytics/user-behaviour-analytics.service';
|
|
3
|
+
import { XhrActionService } from './xhr-action.service';
|
|
4
|
+
import { ExtendedWindow } from '../extended-window.interface';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class PerformanceService {
|
|
7
|
+
private readonly userBehaviourAnalyticsService;
|
|
8
|
+
private readonly xhrActionService;
|
|
9
|
+
private readonly window;
|
|
10
|
+
private readonly zone;
|
|
11
|
+
private readonly navigationPerformance;
|
|
12
|
+
private readonly resourcesPerformance;
|
|
13
|
+
private get network();
|
|
14
|
+
private get runApp();
|
|
15
|
+
constructor(userBehaviourAnalyticsService: UserBehaviourAnalyticsService, xhrActionService: XhrActionService, window: ExtendedWindow, zone: NgZone);
|
|
16
|
+
init(): undefined | void;
|
|
17
|
+
private getInitRequest;
|
|
18
|
+
private sendMeasurement;
|
|
19
|
+
private measureRunApp;
|
|
20
|
+
private measureInitialValues;
|
|
21
|
+
private listenXhrActions;
|
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PerformanceService, never>;
|
|
23
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<PerformanceService>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { XhrAction } from './xhr-action.interface';
|
|
3
|
+
import { ExtendedWindow } from '../extended-window.interface';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class XhrActionService {
|
|
6
|
+
private readonly window;
|
|
7
|
+
private readonly pauseTime;
|
|
8
|
+
private readonly userInputEventNames;
|
|
9
|
+
private isXhrActionStarted;
|
|
10
|
+
private apiRequestEntries;
|
|
11
|
+
private cdnRequestEntries;
|
|
12
|
+
private readonly entriesSubject;
|
|
13
|
+
constructor(window: ExtendedWindow);
|
|
14
|
+
getXhrAction(): Observable<XhrAction>;
|
|
15
|
+
private processEntry;
|
|
16
|
+
private startXhrAction;
|
|
17
|
+
private stopXhrAction;
|
|
18
|
+
private getUserInput;
|
|
19
|
+
private getPerformance;
|
|
20
|
+
private getApiRequestName;
|
|
21
|
+
private getDuration;
|
|
22
|
+
private getPauseEvent;
|
|
23
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<XhrActionService, never>;
|
|
24
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<XhrActionService>;
|
|
25
|
+
}
|
|
@@ -7,7 +7,7 @@ import { CheckStatusAction } from '../../payment/actions/check-status/check-stat
|
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
8
8
|
export declare class GooglePayService {
|
|
9
9
|
private readonly window;
|
|
10
|
-
readonly
|
|
10
|
+
readonly paymentSystemProcessingService: PaymentSystemProcessingService;
|
|
11
11
|
readonly injector: Injector;
|
|
12
12
|
private readonly googlePayScriptUrl;
|
|
13
13
|
private readonly readyToPay;
|
|
@@ -17,7 +17,7 @@ export declare class GooglePayService {
|
|
|
17
17
|
private country;
|
|
18
18
|
private get libraryWasInitialized();
|
|
19
19
|
private get googlePaymentClientWasInitialized();
|
|
20
|
-
constructor(window: ExtendedWindow,
|
|
20
|
+
constructor(window: ExtendedWindow, paymentSystemProcessingService: PaymentSystemProcessingService, injector: Injector);
|
|
21
21
|
get readyToPay$(): Observable<boolean | null>;
|
|
22
22
|
isReadyToPay(): boolean | null;
|
|
23
23
|
initGooglePayLibrary(data: GooglePayInitParams): void;
|
|
@@ -10,7 +10,7 @@ export declare class PaymentSystemProcessingService {
|
|
|
10
10
|
constructor(window: ExtendedWindow);
|
|
11
11
|
get initialize$(): Observable<boolean>;
|
|
12
12
|
get status$(): Observable<string>;
|
|
13
|
-
|
|
13
|
+
emitStatusUrl(statusUrl: string): void;
|
|
14
14
|
emitInitialize(isInitialized: boolean): void;
|
|
15
15
|
getDecodedCheckout<T extends CommonCheckout>(base64checkoutData: string): T;
|
|
16
16
|
loadScript(url: string, onLoad: () => void, addScriptCustomAttributes?: (script: HTMLScriptElement) => HTMLScriptElement): void;
|
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { GooglePayInitParams } from './google-pay/google-pay-init-params.interface';
|
|
3
1
|
import { SdkPaymentSystemsInitialData } from './sdk-payment-systems-initial-data.interface';
|
|
4
|
-
import { CheckStatusAction } from '../payment/actions/check-status/check-status.action.type';
|
|
5
2
|
export interface SdkPaymentSystems {
|
|
6
|
-
googlePay: {
|
|
7
|
-
readyToPay$: Observable<boolean | null>;
|
|
8
|
-
isReadyToPay(): boolean | null;
|
|
9
|
-
initGooglePayLibrary(params: GooglePayInitParams): void;
|
|
10
|
-
checkPaymentDevice(base64checkoutData: string): void;
|
|
11
|
-
proceedCheckout(): Promise<CheckStatusAction | null>;
|
|
12
|
-
createButton(onClickHandler: () => void): HTMLButtonElement | null;
|
|
13
|
-
};
|
|
14
|
-
commonPayProcessingService: {
|
|
15
|
-
initialize$: Observable<boolean>;
|
|
16
|
-
isInitialized(): boolean;
|
|
17
|
-
status$: Observable<string>;
|
|
18
|
-
};
|
|
19
3
|
getInitialData(): SdkPaymentSystemsInitialData;
|
|
20
4
|
}
|
|
@@ -14,15 +14,14 @@ export declare class SettingsService {
|
|
|
14
14
|
get settings(): DeepReadonly<Settings>;
|
|
15
15
|
get user(): DeepReadonly<User>;
|
|
16
16
|
get utilsResponse(): DeepReadonly<UtilsResponse>;
|
|
17
|
+
get unsafeUtilsResponse(): DeepReadonly<UtilsResponse | null>;
|
|
17
18
|
get isEmpty(): boolean;
|
|
18
19
|
get token(): string;
|
|
19
|
-
get isMobile(): boolean;
|
|
20
20
|
get hasResponse(): boolean;
|
|
21
21
|
isInitialized: boolean;
|
|
22
22
|
private response;
|
|
23
23
|
private _token;
|
|
24
24
|
private sandboxMode;
|
|
25
|
-
private _isMobile;
|
|
26
25
|
constructor(secureApi: SecureApiClient);
|
|
27
26
|
init(configuration: InitConfiguration): Promise<void>;
|
|
28
27
|
isSandboxMode(): boolean;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { UserBehaviourEvent } from './user-behaviour-event.interface';
|
|
2
|
+
import { CreateEventMethodOptionsInterface } from '../user-behaviour-analytics.interface';
|
|
3
|
+
import { SettingsService } from '../../settings/settings.service';
|
|
4
|
+
import { UserAgentService } from '../../user-agent/user-agent.service';
|
|
5
|
+
import { ExtendedWindow } from '../../extended-window.interface';
|
|
6
|
+
import { UserSessionOptions } from '../user-session-options';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export declare class EventBuilderService {
|
|
9
|
+
private readonly settingsService;
|
|
10
|
+
private readonly userAgentService;
|
|
11
|
+
private readonly window;
|
|
12
|
+
constructor(settingsService: SettingsService, userAgentService: UserAgentService, window: ExtendedWindow);
|
|
13
|
+
createEvent(options: CreateEventMethodOptionsInterface, userSessionOptions: UserSessionOptions): UserBehaviourEvent;
|
|
14
|
+
private getDate;
|
|
15
|
+
private getTimezone;
|
|
16
|
+
private convertToEventParameterType;
|
|
17
|
+
private convertValueForPostMessage;
|
|
18
|
+
private isSubscription;
|
|
19
|
+
private getPaymentMethodId;
|
|
20
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EventBuilderService, never>;
|
|
21
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<EventBuilderService>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface Invoice {
|
|
2
|
+
purchase_invoice_id: number | null;
|
|
3
|
+
geotype_id: number | null;
|
|
4
|
+
payment_country: string | null;
|
|
5
|
+
payment_method_contr_id: number | null;
|
|
6
|
+
ps_type: number | null;
|
|
7
|
+
purchase_sum: number | null;
|
|
8
|
+
purchase_currency: string | null;
|
|
9
|
+
purchase_sku: string | null;
|
|
10
|
+
purchase_digital_content_sku: string | null;
|
|
11
|
+
purchase_description: string | null;
|
|
12
|
+
digital_content_cart_id: number | null;
|
|
13
|
+
digital_good_cart_id: number | null;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type Purchase = 'virtual_item' | 'virtual_currency' | 'subscription' | 'pay2play';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Purchase } from './purchase.type';
|
|
2
|
+
import { Invoice } from './invoice.interface';
|
|
3
|
+
import { userBehaviourEventTypes } from '../user-behaviour-event/user-behaviour-event-types';
|
|
4
|
+
export interface UserBehaviourEvent extends Invoice {
|
|
5
|
+
action: string;
|
|
6
|
+
type: keyof typeof userBehaviourEventTypes;
|
|
7
|
+
value: string | number[] | null;
|
|
8
|
+
state: string | null;
|
|
9
|
+
date: string;
|
|
10
|
+
milliseconds: number | null;
|
|
11
|
+
timezone: string;
|
|
12
|
+
session_id: string | null;
|
|
13
|
+
referrer_url: string | null;
|
|
14
|
+
project_id: number | null;
|
|
15
|
+
payment_country: string | null;
|
|
16
|
+
instance_id: number | null;
|
|
17
|
+
is_pay_with_saved_method: number | null;
|
|
18
|
+
purchase_external_id: string | null;
|
|
19
|
+
purchase_type: Purchase;
|
|
20
|
+
virtual_currency_amount: number | null;
|
|
21
|
+
coupon_code: string | null;
|
|
22
|
+
theme_version: string | null;
|
|
23
|
+
subscription_package_id: number | null;
|
|
24
|
+
subscription_product_id: number | null;
|
|
25
|
+
subscription_recurrent_id: number | null;
|
|
26
|
+
user_id: string | null;
|
|
27
|
+
user_access_token: string | null;
|
|
28
|
+
user_name: string | null;
|
|
29
|
+
user_email: string | null;
|
|
30
|
+
user_country: string | null;
|
|
31
|
+
user_ip: string | null;
|
|
32
|
+
user_mobile_operator_name: string | null;
|
|
33
|
+
user_operation_system: string | null;
|
|
34
|
+
user_browser: string | null;
|
|
35
|
+
user_browser_version: string | null;
|
|
36
|
+
user_locale: string | null;
|
|
37
|
+
user_utm: string | null;
|
|
38
|
+
xsolla_product_tag: string | null;
|
|
39
|
+
experiment_id: string | null;
|
|
40
|
+
is_test_session: number | null;
|
|
41
|
+
extra_value: string | null;
|
|
42
|
+
babka_value: string | null;
|
|
43
|
+
is_subscription: number | null;
|
|
44
|
+
is_iframe: number | null;
|
|
45
|
+
web3wallet: string | null;
|
|
46
|
+
dimension_1: string | null;
|
|
47
|
+
dimension_2: string | null;
|
|
48
|
+
dimension_3: string | null;
|
|
49
|
+
dimension_4: string | null;
|
|
50
|
+
dimension_5: string | null;
|
|
51
|
+
client_version: 'Headless Checkout';
|
|
52
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const oneTimeAnalyticsEvents: Set<string>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { eventCategories } from './user-behaviour-event/user-behaviour-event-categories';
|
|
2
|
+
import { userBehaviourEventTypes } from './user-behaviour-event/user-behaviour-event-types';
|
|
3
|
+
import { Invoice } from './event-builder/invoice.interface';
|
|
4
|
+
import { EventParameterType } from './event-builder/event-parameter-types';
|
|
5
|
+
export interface SendEventMethodOptionsInterface {
|
|
6
|
+
value?: string | null | boolean | number | number[];
|
|
7
|
+
valueType?: EventParameterType;
|
|
8
|
+
eventCategory?: keyof typeof eventCategories;
|
|
9
|
+
extraValue?: string | null;
|
|
10
|
+
purchaseType?: string | null;
|
|
11
|
+
instanceId?: number | null;
|
|
12
|
+
dimension1?: string | null;
|
|
13
|
+
dimension2?: string | null;
|
|
14
|
+
dimension3?: string | null;
|
|
15
|
+
dimension4?: string | null;
|
|
16
|
+
dimension5?: string | null;
|
|
17
|
+
skipForExternalPage?: boolean;
|
|
18
|
+
syncRequest?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface CreateEventMethodOptionsInterface {
|
|
21
|
+
action: string;
|
|
22
|
+
type: keyof typeof userBehaviourEventTypes;
|
|
23
|
+
value: string | null | boolean | number | number[];
|
|
24
|
+
valueType: EventParameterType | null;
|
|
25
|
+
date: Date;
|
|
26
|
+
invoice: Invoice | null;
|
|
27
|
+
state: string;
|
|
28
|
+
extraValue: string | null;
|
|
29
|
+
purchase_type: string | null;
|
|
30
|
+
instanceId?: number | null;
|
|
31
|
+
dimension1: string | null;
|
|
32
|
+
dimension2: string | null;
|
|
33
|
+
dimension3: string | null;
|
|
34
|
+
dimension4: string | null;
|
|
35
|
+
dimension5: string | null;
|
|
36
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { userBehaviourEventTypes } from './user-behaviour-event/user-behaviour-event-types';
|
|
3
|
+
import { SendEventMethodOptionsInterface } from './user-behaviour-analytics.interface';
|
|
4
|
+
import { EventBuilderService } from './event-builder/event-builder.service';
|
|
5
|
+
import { Invoice } from './event-builder/invoice.interface';
|
|
6
|
+
import { SettingsService } from '../settings/settings.service';
|
|
7
|
+
import { Field } from '../payment/field.interface';
|
|
8
|
+
import { XpsResponse } from '../payment/xps-response.interface';
|
|
9
|
+
import { UserSessionOptions } from './user-session-options';
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
export declare class UserBehaviourAnalyticsService {
|
|
12
|
+
private readonly http;
|
|
13
|
+
private readonly eventBuilderService;
|
|
14
|
+
private readonly settingsService;
|
|
15
|
+
set isPayWithSavedMethod(value: boolean);
|
|
16
|
+
set subscriptionPackageId(value: number);
|
|
17
|
+
set couponCode(value: string);
|
|
18
|
+
set paymentStatus(value: string);
|
|
19
|
+
get sessionOptions(): UserSessionOptions;
|
|
20
|
+
private get purchaseType();
|
|
21
|
+
private readonly apiUrl;
|
|
22
|
+
private readonly _events$;
|
|
23
|
+
private readonly userSessionOptions;
|
|
24
|
+
private readonly sentEvents;
|
|
25
|
+
constructor(http: HttpClient, eventBuilderService: EventBuilderService, settingsService: SettingsService);
|
|
26
|
+
init(): undefined | void;
|
|
27
|
+
setPid(pid?: number | null): void;
|
|
28
|
+
fillUserSession(paymentForm: {
|
|
29
|
+
fields: Field[];
|
|
30
|
+
subscriptionRecurrentId?: number;
|
|
31
|
+
userSession?: Invoice;
|
|
32
|
+
pid: XpsResponse['pid'];
|
|
33
|
+
errors: XpsResponse['errors'];
|
|
34
|
+
summary: XpsResponse['summary'];
|
|
35
|
+
title: string;
|
|
36
|
+
}): void;
|
|
37
|
+
send(action: string, type: keyof typeof userBehaviourEventTypes, options?: SendEventMethodOptionsInterface): void;
|
|
38
|
+
private onOpenPayStation;
|
|
39
|
+
private resetInvoice;
|
|
40
|
+
private resetPid;
|
|
41
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UserBehaviourAnalyticsService, never>;
|
|
42
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<UserBehaviourAnalyticsService>;
|
|
43
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Invoice } from './event-builder/invoice.interface';
|
|
2
|
+
export interface UserSessionOptions {
|
|
3
|
+
invoice: Invoice | null;
|
|
4
|
+
instanceId: number | null;
|
|
5
|
+
subscriptionRecurrentId: number | null;
|
|
6
|
+
userMobileOperatorName: string | null;
|
|
7
|
+
isPayWithSavedMethod: boolean;
|
|
8
|
+
subscriptionPackageId: number | null;
|
|
9
|
+
subscriptionProductId: number | null;
|
|
10
|
+
couponCode: string | null;
|
|
11
|
+
totalSum: number | null;
|
|
12
|
+
totalCurrency: string | null;
|
|
13
|
+
paymentInstanceName: string | null;
|
|
14
|
+
paymentStatus: string | null;
|
|
15
|
+
}
|