@xsolla/payment-client-core 0.2.90 → 0.2.92

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 (70) hide show
  1. package/esm2022/lib/core/payment/actions/next-action.service.mjs +17 -8
  2. package/esm2022/lib/core/payment/actions/next-actions.mjs +3 -1
  3. package/esm2022/lib/core/payment/actions/redirect/google-three-ds-redirect.action.class.mjs +20 -0
  4. package/esm2022/lib/core/payment/actions/redirect/redirect.action.class.mjs +16 -8
  5. package/esm2022/lib/core/payment/actions/redirect/redirect.action.type.mjs +1 -1
  6. package/esm2022/lib/core/payment/external-change-fields.const.mjs +2 -1
  7. package/esm2022/lib/core/payment/field-names.enum.mjs +3 -1
  8. package/esm2022/lib/core/payment/finance-details/finance-details.service.mjs +17 -5
  9. package/esm2022/lib/core/payment/form/form.service.mjs +13 -5
  10. package/esm2022/lib/core/payment/form/validators/required/required.validator.mjs +1 -2
  11. package/esm2022/lib/core/payment/initialize-actions/initialize-next-action.service.mjs +11 -4
  12. package/esm2022/lib/core/payment/payment-behaviour/payment-behaviour.service.mjs +15 -5
  13. package/esm2022/lib/core/payment/payment-behaviour/strategies/apple-pay-with-shipping-address/apple-pay-with-shipping-address.strategy.mjs +2 -1
  14. package/esm2022/lib/core/payment/payment-behaviour/strategies/behaviour-strategy.abstract.mjs +1 -1
  15. package/esm2022/lib/core/payment/payment-behaviour/strategies/google-pay-instant-flow/google-pay-instant-flow.strategy.mjs +2 -1
  16. package/esm2022/lib/core/payment/payment-behaviour/strategies/google-pay-regular-flow/google-pay-regular-flow.strategy.mjs +2 -1
  17. package/esm2022/lib/core/payment/payment-configuration.interface.mjs +1 -1
  18. package/esm2022/lib/core/payment/payment-configurations/types/google-pay-form-configuration.interface.mjs +2 -0
  19. package/esm2022/lib/core/payment/payment-configurations/types/is-credit-card-settings.guard.mjs +5 -0
  20. package/esm2022/lib/core/payment/payment-configurations/types/is-google-pay-settings.guard.mjs +5 -0
  21. package/esm2022/lib/core/payment/payment-settings/payment-settings.service.mjs +8 -5
  22. package/esm2022/lib/core/payment/payment.service.mjs +43 -12
  23. package/esm2022/lib/core/payment/requests/initialize/initialize.service.mjs +2 -1
  24. package/esm2022/lib/core/payment/requests/submit/submit.service.mjs +2 -1
  25. package/esm2022/lib/core/payment/requests/sync/sync.service.mjs +2 -1
  26. package/esm2022/lib/core/payment/status/listen-status/listen-status.service.mjs +5 -2
  27. package/esm2022/lib/core/payment/three-ds/three-ds-20/three-ds20.service.mjs +11 -4
  28. package/esm2022/lib/core/sdk-payment-systems/apple-pay/apple-pay-cart/apple-pay-cart.service.mjs +13 -5
  29. package/esm2022/lib/core/sdk-payment-systems/apple-pay/apple-pay.service.mjs +9 -5
  30. package/esm2022/lib/core/sdk-payment-systems/apple-pay/external-window-communication/external-window-communication.service.mjs +9 -4
  31. package/esm2022/lib/core/sdk-payment-systems/apple-pay/session-handlers/braintree.handler.mjs +19 -4
  32. package/esm2022/lib/core/sdk-payment-systems/apple-pay/session-handlers/checkout.handler.mjs +17 -4
  33. package/esm2022/lib/core/sdk-payment-systems/google-pay/payment/google-pay-checkout-payment.service.mjs +9 -4
  34. package/esm2022/lib/core/sdk-payment-systems/sdk-payment-systems-initial-data.interface.mjs +1 -1
  35. package/esm2022/lib/core/user-behaviour-analytics/one-time-analytics-events.const.mjs +2 -5
  36. package/esm2022/lib/core/user-behaviour-analytics/user-behaviour-event-name.enum.mjs +42 -3
  37. package/esm2022/lib/core-library.service.mjs +1 -1
  38. package/fesm2022/xsolla-payment-client-core.mjs +705 -519
  39. package/fesm2022/xsolla-payment-client-core.mjs.map +1 -1
  40. package/lib/core/payment/actions/next-action.service.d.ts +5 -2
  41. package/lib/core/payment/actions/redirect/google-three-ds-redirect.action.class.d.ts +9 -0
  42. package/lib/core/payment/actions/redirect/redirect.action.class.d.ts +2 -1
  43. package/lib/core/payment/actions/redirect/redirect.action.type.d.ts +1 -0
  44. package/lib/core/payment/field-names.enum.d.ts +3 -1
  45. package/lib/core/payment/finance-details/finance-details.service.d.ts +5 -2
  46. package/lib/core/payment/form/form.service.d.ts +5 -2
  47. package/lib/core/payment/initialize-actions/initialize-next-action.service.d.ts +4 -1
  48. package/lib/core/payment/payment-behaviour/payment-behaviour.service.d.ts +4 -1
  49. package/lib/core/payment/payment-behaviour/strategies/apple-pay-with-shipping-address/apple-pay-with-shipping-address.strategy.d.ts +1 -0
  50. package/lib/core/payment/payment-behaviour/strategies/behaviour-strategy.abstract.d.ts +1 -0
  51. package/lib/core/payment/payment-behaviour/strategies/google-pay-instant-flow/google-pay-instant-flow.strategy.d.ts +1 -0
  52. package/lib/core/payment/payment-behaviour/strategies/google-pay-regular-flow/google-pay-regular-flow.strategy.d.ts +1 -0
  53. package/lib/core/payment/payment-configuration.interface.d.ts +4 -2
  54. package/lib/core/payment/payment-configurations/types/google-pay-form-configuration.interface.d.ts +8 -0
  55. package/lib/core/payment/payment-configurations/types/is-credit-card-settings.guard.d.ts +3 -0
  56. package/lib/core/payment/payment-configurations/types/is-google-pay-settings.guard.d.ts +3 -0
  57. package/lib/core/payment/payment.service.d.ts +10 -2
  58. package/lib/core/payment/three-ds/three-ds-20/three-ds20.service.d.ts +3 -1
  59. package/lib/core/sdk-payment-systems/apple-pay/apple-pay-cart/apple-pay-cart.service.d.ts +3 -1
  60. package/lib/core/sdk-payment-systems/apple-pay/apple-pay.service.d.ts +3 -1
  61. package/lib/core/sdk-payment-systems/apple-pay/external-window-communication/external-window-communication.service.d.ts +3 -1
  62. package/lib/core/sdk-payment-systems/apple-pay/session-handlers/braintree.handler.d.ts +3 -1
  63. package/lib/core/sdk-payment-systems/apple-pay/session-handlers/checkout.handler.d.ts +3 -1
  64. package/lib/core/sdk-payment-systems/google-pay/payment/google-pay-checkout-payment.service.d.ts +3 -1
  65. package/lib/core/sdk-payment-systems/sdk-payment-systems-initial-data.interface.d.ts +1 -0
  66. package/lib/core/user-behaviour-analytics/user-behaviour-event-name.enum.d.ts +40 -3
  67. package/lib/core-library.service.d.ts +4 -1
  68. package/package.json +1 -1
  69. package/xsolla-payment-client-core-0.2.92.tgz +0 -0
  70. package/xsolla-payment-client-core-0.2.90.tgz +0 -0
@@ -5,20 +5,23 @@ import { NextAction } from './next-action.interface';
5
5
  import { NextActionTokens } from './next-actions';
6
6
  import { ShowErrorsActionCreator } from './show-errors/show-errors.action.class';
7
7
  import { XpsError } from '../xps-error.interface';
8
+ import { UserBehaviourAnalyticsService } from '../../user-behaviour-analytics/user-behaviour-analytics.service';
8
9
  import * as i0 from "@angular/core";
9
10
  export declare class NextActionService {
10
11
  private readonly nextActionTokens;
11
12
  private readonly injector;
12
13
  private readonly showErrorsActionCreator;
14
+ private readonly userBehaviourAnalyticsService;
13
15
  private readonly flowUpdatesSubject;
14
16
  private readonly nextActionsList;
15
17
  get flowUpdates$(): Observable<NextAction>;
16
- constructor(nextActionTokens: NextActionTokens, injector: Injector, showErrorsActionCreator: ShowErrorsActionCreator);
18
+ constructor(nextActionTokens: NextActionTokens, injector: Injector, showErrorsActionCreator: ShowErrorsActionCreator, userBehaviourAnalyticsService: UserBehaviourAnalyticsService);
17
19
  getNextAction(submitResponse: SubmitResponse): NextAction | null;
18
20
  emitFlowUpdates(action: NextAction): void;
19
21
  emitFlowErrors(errors: XpsError[]): void;
20
22
  private fillNextActionsList;
21
- private findNextAction;
23
+ private findNextActionCreator;
24
+ private logNextAction;
22
25
  static ɵfac: i0.ɵɵFactoryDeclaration<NextActionService, never>;
23
26
  static ɵprov: i0.ɵɵInjectableDeclaration<NextActionService>;
24
27
  }
@@ -0,0 +1,9 @@
1
+ import { SubmitResponse } from '../../requests/submit/response/submit-response.class';
2
+ import { RedirectActionCreator } from './redirect.action.class';
3
+ import * as i0 from "@angular/core";
4
+ export declare class GoogleThreeDsRedirectActionCreator extends RedirectActionCreator {
5
+ isSuitable(response: SubmitResponse): boolean;
6
+ protected getRedirectUrl(submitResponse: SubmitResponse): string;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<GoogleThreeDsRedirectActionCreator, never>;
8
+ static ɵprov: i0.ɵɵInjectableDeclaration<GoogleThreeDsRedirectActionCreator>;
9
+ }
@@ -9,9 +9,10 @@ export declare class RedirectActionCreator implements ActionCreator {
9
9
  constructor(settingsService: SettingsService);
10
10
  getActionData(submitResponse: SubmitResponse): RedirectAction;
11
11
  isSuitable(response: SubmitResponse): boolean;
12
+ protected getRedirectUrl(submitResponse: SubmitResponse): string;
12
13
  private getRedirect;
13
- private getRedirectUrl;
14
14
  private getIsNewWindowRequired;
15
+ private getIsSameWindowRequired;
15
16
  private preparePagesUrl;
16
17
  static ɵfac: i0.ɵɵFactoryDeclaration<RedirectActionCreator, never>;
17
18
  static ɵprov: i0.ɵɵInjectableDeclaration<RedirectActionCreator>;
@@ -12,6 +12,7 @@ export interface RedirectActionData {
12
12
  redirect: {
13
13
  redirectUrl: string;
14
14
  isNewWindowRequired?: boolean;
15
+ isSameWindowRequired?: boolean;
15
16
  data: object;
16
17
  };
17
18
  }
@@ -79,5 +79,7 @@ export declare enum FieldNames {
79
79
  payViaCheckoutUrl = "payViaCheckoutUrl",
80
80
  googlePayInitData = "googlePayInitData",
81
81
  googlePayPaymentData = "googlePayPaymentData",
82
- externalCardIssuerCountry = "externalCardIssuerCountry"
82
+ googlePay3dsRedirect = "googlePay3DSRedirect",
83
+ externalCardIssuerCountry = "externalCardIssuerCountry",
84
+ pmId = "pm_id"
83
85
  }
@@ -5,16 +5,19 @@ import { FinanceDetails } from './finance-details.interface';
5
5
  import { StatusFinanceDetailsAdapterService } from './status/status-finance-details-adapter.service';
6
6
  import { SummaryFinanceDetailsAdapterService } from './summary/summary-finance-details-adapter.service';
7
7
  import { SessionService } from '../../session/session.service';
8
+ import { UserBehaviourAnalyticsService } from '../../user-behaviour-analytics/user-behaviour-analytics.service';
8
9
  import * as i0 from "@angular/core";
9
10
  export declare class FinanceDetailsService extends EmitDataService<FinanceDetails> {
10
11
  private readonly sessionService;
11
12
  private readonly summaryFinanceDetailsAdapterService;
12
13
  private readonly statusFinanceDetailsAdapterService;
14
+ private readonly userBehaviourAnalyticsService;
13
15
  private readonly purchaseSessionKey;
14
- constructor(sessionService: SessionService, summaryFinanceDetailsAdapterService: SummaryFinanceDetailsAdapterService, statusFinanceDetailsAdapterService: StatusFinanceDetailsAdapterService);
15
- emitWithSummary(summary?: XpsSummary): void;
16
+ constructor(sessionService: SessionService, summaryFinanceDetailsAdapterService: SummaryFinanceDetailsAdapterService, statusFinanceDetailsAdapterService: StatusFinanceDetailsAdapterService, userBehaviourAnalyticsService: UserBehaviourAnalyticsService);
17
+ emitWithSummary(summary?: XpsSummary, needLogCart?: boolean): void;
16
18
  emitWithStatus(status?: Status): void;
17
19
  getDetailsFromSummary(summary: XpsSummary): FinanceDetails;
20
+ private logCartEvent;
18
21
  static ɵfac: i0.ɵɵFactoryDeclaration<FinanceDetailsService, never>;
19
22
  static ɵprov: i0.ɵɵInjectableDeclaration<FinanceDetailsService>;
20
23
  }
@@ -4,15 +4,18 @@ 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
6
  import { FieldNames } from '../field-names.enum';
7
+ import { UserBehaviourAnalyticsService } from '../../user-behaviour-analytics/user-behaviour-analytics.service';
7
8
  import * as i0 from "@angular/core";
8
9
  export declare class FormService {
9
- protected readonly controlConfigService: ControlConfigService;
10
+ private readonly controlConfigService;
11
+ private readonly userBehaviourAnalyticsService;
10
12
  fieldFormStates: FieldFormStates;
11
- constructor(controlConfigService: ControlConfigService);
13
+ constructor(controlConfigService: ControlConfigService, userBehaviourAnalyticsService: UserBehaviourAnalyticsService);
12
14
  createForm(fields: Field[]): UntypedFormGroup;
13
15
  getFieldFormState(fieldName: FieldNames): FormState | null;
14
16
  updateFieldFormState(form: UntypedFormGroup, fields: Field[], fieldName: string, formState: FormState): void;
15
17
  private getVisibleFields;
18
+ private logCreateForm;
16
19
  static ɵfac: i0.ɵɵFactoryDeclaration<FormService, never>;
17
20
  static ɵprov: i0.ɵɵInjectableDeclaration<FormService>;
18
21
  }
@@ -2,15 +2,18 @@ import { Injector } from '@angular/core';
2
2
  import { InitializeResponse } from '../requests/initialize/response/initialize-response.class';
3
3
  import { InitializeNextActionTokens } from './initialize-next-actions';
4
4
  import { InitializeNextAction } from './next-action.interface';
5
+ import { UserBehaviourAnalyticsService } from '../../user-behaviour-analytics/user-behaviour-analytics.service';
5
6
  import * as i0 from "@angular/core";
6
7
  export declare class InitializeNextActionService {
7
8
  private readonly initializeNextActionTokens;
9
+ private readonly userBehaviourAnalyticsService;
8
10
  private readonly injector;
9
11
  private readonly initializeNextActionsList;
10
- constructor(initializeNextActionTokens: InitializeNextActionTokens, injector: Injector);
12
+ constructor(initializeNextActionTokens: InitializeNextActionTokens, userBehaviourAnalyticsService: UserBehaviourAnalyticsService, injector: Injector);
11
13
  getNextAction(response: InitializeResponse): InitializeNextAction | null;
12
14
  private fillNextActionsList;
13
15
  private findNextAction;
16
+ private logNextAction;
14
17
  static ɵfac: i0.ɵɵFactoryDeclaration<InitializeNextActionService, never>;
15
18
  static ɵprov: i0.ɵɵInjectableDeclaration<InitializeNextActionService>;
16
19
  }
@@ -4,13 +4,16 @@ import { BehaviourStrategyTokens } from './behaviour-strategies';
4
4
  import { InitializeResponse } from '../requests/initialize/response/initialize-response.class';
5
5
  import { SubmitResponse } from '../requests/submit/response/submit-response.class';
6
6
  import { PaymentConfiguration } from '../payment-configuration.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 PaymentBehaviourService {
9
10
  private readonly behaviourStrategyTokens;
11
+ private readonly userBehaviourAnalyticsService;
10
12
  private readonly injector;
11
- constructor(behaviourStrategyTokens: BehaviourStrategyTokens, injector: Injector);
13
+ constructor(behaviourStrategyTokens: BehaviourStrategyTokens, userBehaviourAnalyticsService: UserBehaviourAnalyticsService, injector: Injector);
12
14
  getApplicableBehaviourStrategies(paymentData: InitializeResponse | SubmitResponse | null, config: PaymentConfiguration): BehaviourStrategy[];
13
15
  private getBehaviourStrategies;
16
+ private logApplicableStrategies;
14
17
  static ɵfac: i0.ɵɵFactoryDeclaration<PaymentBehaviourService, never>;
15
18
  static ɵprov: i0.ɵɵInjectableDeclaration<PaymentBehaviourService>;
16
19
  }
@@ -1,6 +1,7 @@
1
1
  import { BehaviourStrategy } from '../behaviour-strategy.abstract';
2
2
  import * as i0 from "@angular/core";
3
3
  export declare class ApplePayWithShippingAddressStrategy extends BehaviourStrategy {
4
+ name: string;
4
5
  constructor();
5
6
  isSuitable(): boolean;
6
7
  onInit(): void;
@@ -3,6 +3,7 @@ import { SubmitResponse } from '../../requests/submit/response/submit-response.c
3
3
  import { PaymentConfiguration } from '../../payment-configuration.interface';
4
4
  import * as i0 from "@angular/core";
5
5
  export declare abstract class BehaviourStrategy {
6
+ abstract name: string;
6
7
  protected paymentData: InitializeResponse | SubmitResponse | null;
7
8
  protected paymentConfig: PaymentConfiguration;
8
9
  isSuitable(): boolean;
@@ -1,6 +1,7 @@
1
1
  import { BehaviourStrategy } from '../behaviour-strategy.abstract';
2
2
  import * as i0 from "@angular/core";
3
3
  export declare class GooglePayInstantFlowStrategy extends BehaviourStrategy {
4
+ name: string;
4
5
  constructor();
5
6
  isSuitable(): boolean;
6
7
  onInit(): void;
@@ -1,6 +1,7 @@
1
1
  import { BehaviourStrategy } from '../behaviour-strategy.abstract';
2
2
  import * as i0 from "@angular/core";
3
3
  export declare class GooglePayRegularFlowStrategy extends BehaviourStrategy {
4
+ name: string;
4
5
  constructor();
5
6
  isSuitable(): boolean;
6
7
  canAutoSubmit(): boolean;
@@ -1,6 +1,8 @@
1
1
  import { XpsBoolean } from '../xps-boolean.enum';
2
2
  import { creditCardPaymentMethodId } from './credit-card-payment-methods-id.variable';
3
3
  import { PaymentConfigurationCreditCardSettings } from './payment-configurations/types/credit-card-form-configuration.interface';
4
+ import { PaymentConfigurationGooglePaySettings } from './payment-configurations/types/google-pay-form-configuration.interface';
5
+ import { googlePayPid } from '../sdk-payment-systems/sdk-payment-methods.const';
4
6
  export interface OverridedField {
5
7
  initialValue: XpsBoolean | string;
6
8
  }
@@ -16,8 +18,8 @@ export interface BasePaymentConfiguration {
16
18
  };
17
19
  }
18
20
  interface PaymentConfigurationWithGeneralSettings extends BasePaymentConfiguration {
19
- paymentMethodId: Exclude<number, typeof creditCardPaymentMethodId>;
21
+ paymentMethodId: Exclude<number, typeof creditCardPaymentMethodId | typeof googlePayPid>;
20
22
  paymentMethodSettings?: never;
21
23
  }
22
- export type PaymentConfiguration = PaymentConfigurationCreditCardSettings | PaymentConfigurationWithGeneralSettings;
24
+ export type PaymentConfiguration = PaymentConfigurationCreditCardSettings | PaymentConfigurationGooglePaySettings | PaymentConfigurationWithGeneralSettings;
23
25
  export {};
@@ -0,0 +1,8 @@
1
+ import { BasePaymentConfiguration } from '../../payment-configuration.interface';
2
+ import { googlePayPid } from '../../../sdk-payment-systems/sdk-payment-methods.const';
3
+ export type PaymentConfigurationGooglePaySettings = BasePaymentConfiguration & {
4
+ paymentMethodId: typeof googlePayPid;
5
+ paymentMethodSettings: {
6
+ useSdkHandlerForUserBackRedirect?: boolean;
7
+ };
8
+ };
@@ -0,0 +1,3 @@
1
+ import { PaymentConfigurationCreditCardSettings } from './credit-card-form-configuration.interface';
2
+ import { PaymentConfiguration } from '../../payment-configuration.interface';
3
+ export declare const isCreditCardSettingsGuard: (settings: PaymentConfiguration) => settings is PaymentConfigurationCreditCardSettings;
@@ -0,0 +1,3 @@
1
+ import { PaymentConfiguration } from '../../payment-configuration.interface';
2
+ import { PaymentConfigurationGooglePaySettings } from './google-pay-form-configuration.interface';
3
+ export declare const isGooglePaySettingsGuard: (settings: PaymentConfiguration) => settings is PaymentConfigurationGooglePaySettings;
@@ -14,6 +14,7 @@ import { ControlConfigService } from './form/controls/control-config.service';
14
14
  import { FinanceDetails } from './finance-details/finance-details.interface';
15
15
  import { FinanceDetailsService } from './finance-details/finance-details.service';
16
16
  import { NextAction } from './actions/next-action.interface';
17
+ import { UserBehaviourAnalyticsService } from '../user-behaviour-analytics/user-behaviour-analytics.service';
17
18
  import { Field } from './field.interface';
18
19
  import { PaymentConfiguration } from './payment-configuration.interface';
19
20
  import { ValidationErrors } from './form/validators/validation-errors.interface';
@@ -58,6 +59,7 @@ export declare class PaymentService {
58
59
  private readonly printInstructionService;
59
60
  private readonly paymentBehaviourService;
60
61
  private readonly translateService;
62
+ private readonly userBehaviourAnalyticsService;
61
63
  form: UntypedFormGroup | null;
62
64
  get formFieldsStatus$(): Observable<FormFieldsStatus>;
63
65
  get paymentForm$(): Observable<FormControlStatus | null>;
@@ -67,6 +69,7 @@ export declare class PaymentService {
67
69
  private financeDetails;
68
70
  private focusFieldName;
69
71
  private fields;
72
+ private isSubmitAttempted;
70
73
  private config;
71
74
  private destroy$;
72
75
  private formDestroy$;
@@ -74,10 +77,13 @@ export declare class PaymentService {
74
77
  private readonly formFieldsStatusSubject;
75
78
  private readonly _formResponse$;
76
79
  private isSavingMethodMode;
77
- constructor(loggerService: LoggerService, initializeService: InitializeService, submitService: SubmitService, syncService: SyncService, formService: FormService, statusService: StatusService, financeDetailsService: FinanceDetailsService, creditCardStateService: CreditCardStateService, nextActionService: NextActionService, initializeNextActionService: InitializeNextActionService, controlConfigService: ControlConfigService, threeDsService: ThreeDsService, formMessagesService: FormMessagesService, settingsService: SettingsService, countryService: CountryService, checkStatusActionCreator: CheckStatusActionCreator, printInstructionService: PrintInstructionService, paymentBehaviourService: PaymentBehaviourService, translateService: TranslateService);
80
+ constructor(loggerService: LoggerService, initializeService: InitializeService, submitService: SubmitService, syncService: SyncService, formService: FormService, statusService: StatusService, financeDetailsService: FinanceDetailsService, creditCardStateService: CreditCardStateService, nextActionService: NextActionService, initializeNextActionService: InitializeNextActionService, controlConfigService: ControlConfigService, threeDsService: ThreeDsService, formMessagesService: FormMessagesService, settingsService: SettingsService, countryService: CountryService, checkStatusActionCreator: CheckStatusActionCreator, printInstructionService: PrintInstructionService, paymentBehaviourService: PaymentBehaviourService, translateService: TranslateService, userBehaviourAnalyticsService: UserBehaviourAnalyticsService);
78
81
  initialize(config: PaymentConfiguration): Promise<InitializedForm>;
79
82
  submit(): Promise<NextAction | null | void>;
80
- submitWithFields(fields?: Field[]): Promise<SubmitResponse>;
83
+ submitWithFields(fields?: Field[]): Promise<{
84
+ response: SubmitResponse;
85
+ nextAction: NextAction | null | void;
86
+ }>;
81
87
  setupInitialFieldValues(): void;
82
88
  getFields(): Field[];
83
89
  getControlStatus(name: FieldNames): ControlStatus | null;
@@ -116,6 +122,8 @@ export declare class PaymentService {
116
122
  private destroyBehaviourStrategies;
117
123
  private autoSubmitBehaviourStrategies;
118
124
  private handleSubmitWithErrors;
125
+ private logSubmitAttempt;
126
+ private logSubmit;
119
127
  static ɵfac: i0.ɵɵFactoryDeclaration<PaymentService, never>;
120
128
  static ɵprov: i0.ɵɵInjectableDeclaration<PaymentService>;
121
129
  }
@@ -6,6 +6,7 @@ import { ThreeDsForm } from '../three-ds-form.interface';
6
6
  import { DfpCollectService } from '../dfp-collect/dfp-collect.service';
7
7
  import { ReinsuranceCheckService } from '../reinsurance-check/reinsurance-check.service';
8
8
  import { StatusUpdate } from './status-update.interface';
9
+ import { UserBehaviourAnalyticsService } from '../../../user-behaviour-analytics/user-behaviour-analytics.service';
9
10
  import * as i0 from "@angular/core";
10
11
  export declare class ThreeDs20Service {
11
12
  private readonly statusThreeDsService;
@@ -13,6 +14,7 @@ export declare class ThreeDs20Service {
13
14
  private readonly webSocketFactory;
14
15
  private readonly dfpCollectService;
15
16
  private readonly reinsuranceCheckService;
17
+ private readonly userBehaviourAnalyticsService;
16
18
  get statusUpdates$(): Observable<StatusUpdate>;
17
19
  private webSocketSubscription;
18
20
  private webSocketReconnectionSubscription;
@@ -23,7 +25,7 @@ export declare class ThreeDs20Service {
23
25
  private readonly notifyDfpTimeoutMs;
24
26
  private readonly statusThreeDsTimerId;
25
27
  private readonly statusThreeDsTimeoutMs;
26
- constructor(statusThreeDsService: StatusThreeDsService, notifyDfpStatusService: NotifyDfpStatusService, webSocketFactory: WebSocketFactory, dfpCollectService: DfpCollectService, reinsuranceCheckService: ReinsuranceCheckService);
28
+ constructor(statusThreeDsService: StatusThreeDsService, notifyDfpStatusService: NotifyDfpStatusService, webSocketFactory: WebSocketFactory, dfpCollectService: DfpCollectService, reinsuranceCheckService: ReinsuranceCheckService, userBehaviourAnalyticsService: UserBehaviourAnalyticsService);
27
29
  checkThreeDs20(threeDsForm: ThreeDsForm | null): Promise<void>;
28
30
  private handleThreeDsUpdates;
29
31
  private stopReinsuranceMethods;
@@ -5,8 +5,10 @@ import { UpdatedPrice } from '../updated-price.interface';
5
5
  import { ShippingAddress } from '../shipping-address.interface';
6
6
  import { XpsResponse } from '../../../payment/xps-response.interface';
7
7
  import { SummaryFinanceDetailsAdapterService } from '../../../payment/finance-details/summary/summary-finance-details-adapter.service';
8
+ import { UserBehaviourAnalyticsService } from '../../../user-behaviour-analytics/user-behaviour-analytics.service';
8
9
  import * as i0 from "@angular/core";
9
10
  export declare class ApplePayCartService {
11
+ private readonly userBehaviourAnalyticsService;
10
12
  private readonly summaryFinanceDetailsAdapterService;
11
13
  private readonly cartSuccessfulRecalculated;
12
14
  private readonly cartErrorRecalculated;
@@ -14,7 +16,7 @@ export declare class ApplePayCartService {
14
16
  get cartSuccessfulRecalculated$(): Observable<UpdatedPrice>;
15
17
  get cartErrorRecalculated$(): Observable<ApplePayError>;
16
18
  get cartRecalculationRequest$(): Observable<ShippingAddress>;
17
- constructor(summaryFinanceDetailsAdapterService: SummaryFinanceDetailsAdapterService);
19
+ constructor(userBehaviourAnalyticsService: UserBehaviourAnalyticsService, summaryFinanceDetailsAdapterService: SummaryFinanceDetailsAdapterService);
18
20
  recalculateCartTaxes(shippingContact: ApplePayShippingContact): void;
19
21
  buildShippingContactUpdate(paymentParams: ApplePayParams, updatedPrice: UpdatedPrice): ApplePayShippingContactUpdate;
20
22
  sendSuccessfulRecalculatedCart(xpsResponse: XpsResponse): void;
@@ -20,6 +20,7 @@ import { ShippingAddress } from './shipping-address.interface';
20
20
  import { ApplePayShippingContact } from './session-handlers/apple-pay-session.interface';
21
21
  import { UpdatedPrice } from './updated-price.interface';
22
22
  import { LoggerService } from '../../exceptions-handling/logger/logger.service';
23
+ import { UserBehaviourAnalyticsService } from '../../user-behaviour-analytics/user-behaviour-analytics.service';
23
24
  import * as i0 from "@angular/core";
24
25
  export declare class ApplePayService {
25
26
  private readonly window;
@@ -30,6 +31,7 @@ export declare class ApplePayService {
30
31
  private readonly loggerService;
31
32
  private readonly applePaySdkService;
32
33
  private readonly externalWindowCommunicationService;
34
+ private readonly userBehaviourAnalyticsService;
33
35
  private readonly settingsService;
34
36
  private readonly payment;
35
37
  private readonly error;
@@ -50,7 +52,7 @@ export declare class ApplePayService {
50
52
  get getWindowSendTokenMessage$(): Observable<ApplePaySendTokenMessage>;
51
53
  get getWindowClose$(): Observable<WindowCloseMessage>;
52
54
  get getWindowReturnMessage$(): Observable<ReturnMessage>;
53
- constructor(window: ExtendedWindow, summaryFinanceDetailsAdapterService: SummaryFinanceDetailsAdapterService, braintreeHandler: BraintreeHandler, checkoutHandler: CheckoutHandler, appleParamsBuilder: ApplePayParamsBuilderService, loggerService: LoggerService, applePaySdkService: ApplePaySdkService, externalWindowCommunicationService: ApplePayExternalWindowCommunicationService, settingsService: SettingsService);
55
+ constructor(window: ExtendedWindow, summaryFinanceDetailsAdapterService: SummaryFinanceDetailsAdapterService, braintreeHandler: BraintreeHandler, checkoutHandler: CheckoutHandler, appleParamsBuilder: ApplePayParamsBuilderService, loggerService: LoggerService, applePaySdkService: ApplePaySdkService, externalWindowCommunicationService: ApplePayExternalWindowCommunicationService, userBehaviourAnalyticsService: UserBehaviourAnalyticsService, settingsService: SettingsService);
54
56
  addApplePaySdkJs(): void;
55
57
  removeListeners(): void;
56
58
  setApplePayParams(data: {
@@ -7,13 +7,15 @@ import { CommandsForPages } from '../commands-for-pages.enum';
7
7
  import { RecalculateCartMessage } from '../socket-messages/recalculate-cart-message.interface';
8
8
  import { ApplePaySendTokenMessage } from '../socket-messages/send-token-message.interface';
9
9
  import { ReturnMessage } from '../socket-messages/return-message.interface';
10
+ import { UserBehaviourAnalyticsService } from '../../../user-behaviour-analytics/user-behaviour-analytics.service';
10
11
  import * as i0 from "@angular/core";
11
12
  export declare class ApplePayExternalWindowCommunicationService {
12
13
  private readonly window;
13
14
  private readonly webSocketFactory;
14
15
  private readonly socketBridgeService;
16
+ private readonly userBehaviourAnalyticsService;
15
17
  private websocketClient;
16
- constructor(window: ExtendedWindow, webSocketFactory: WebSocketFactory, socketBridgeService: SocketBridgeService);
18
+ constructor(window: ExtendedWindow, webSocketFactory: WebSocketFactory, socketBridgeService: SocketBridgeService, userBehaviourAnalyticsService: UserBehaviourAnalyticsService);
17
19
  getWindowClose$(): Observable<WindowCloseMessage>;
18
20
  getWindowReturnMessage$(): Observable<ReturnMessage>;
19
21
  getWindowSendTokenMessage$(): Observable<ApplePaySendTokenMessage>;
@@ -5,13 +5,15 @@ import { ApplePaySessionHandlerAbstract } from './session-handler.abstract';
5
5
  import { StartSessionParams } from './start-session-params.interface';
6
6
  import { ApplePayCartService } from '../apple-pay-cart/apple-pay-cart.service';
7
7
  import { LoggerService } from '../../../exceptions-handling/logger/logger.service';
8
+ import { UserBehaviourAnalyticsService } from '../../../user-behaviour-analytics/user-behaviour-analytics.service';
8
9
  import * as i0 from "@angular/core";
9
10
  export declare class BraintreeHandler extends ApplePaySessionHandlerAbstract {
10
11
  private readonly window;
11
12
  private readonly loggerService;
12
13
  private readonly applePayCartService;
14
+ private readonly userBehaviourAnalyticsService;
13
15
  private paymentClient;
14
- constructor(window: ExtendedWindow, loggerService: LoggerService, applePayCartService: ApplePayCartService);
16
+ constructor(window: ExtendedWindow, loggerService: LoggerService, applePayCartService: ApplePayCartService, userBehaviourAnalyticsService: UserBehaviourAnalyticsService);
15
17
  setClient(client: ApplePay): void;
16
18
  startSession(params: ApplePayParams, additionalParams: StartSessionParams, applePayFinallyCallback: () => void): void;
17
19
  static ɵfac: i0.ɵɵFactoryDeclaration<BraintreeHandler, never>;
@@ -4,12 +4,14 @@ import { ApplePayParams } from '../apple-pay-params.interface';
4
4
  import { ApplePaySessionHandlerAbstract } from './session-handler.abstract';
5
5
  import { StartSessionParams } from './start-session-params.interface';
6
6
  import { ApplePayCartService } from '../apple-pay-cart/apple-pay-cart.service';
7
+ import { UserBehaviourAnalyticsService } from '../../../user-behaviour-analytics/user-behaviour-analytics.service';
7
8
  import * as i0 from "@angular/core";
8
9
  export declare class CheckoutHandler extends ApplePaySessionHandlerAbstract {
9
10
  private readonly window;
10
11
  private readonly http;
11
12
  private readonly applePayCartService;
12
- constructor(window: ExtendedWindow, http: HttpClient, applePayCartService: ApplePayCartService);
13
+ private readonly userBehaviourAnalyticsService;
14
+ constructor(window: ExtendedWindow, http: HttpClient, applePayCartService: ApplePayCartService, userBehaviourAnalyticsService: UserBehaviourAnalyticsService);
13
15
  startSession(params: ApplePayParams, additionalParams: StartSessionParams, applePayFinallyCallback: () => void): void;
14
16
  static ɵfac: i0.ɵɵFactoryDeclaration<CheckoutHandler, never>;
15
17
  static ɵprov: i0.ɵɵInjectableDeclaration<CheckoutHandler>;
@@ -1,12 +1,14 @@
1
1
  import { PaymentSystemProcessingService } from '../../payment-systems/payment-system-processing.service';
2
2
  import { AllowedPaymentMethod, GoogleInitData, GooglePayPaymentRequest, PaymentDataResponse } from '../google-pay-library.interface';
3
3
  import { GooglePayPaymentService, PreparePaymentParams } from './google-pay-payment-service.interface';
4
+ import { UserBehaviourAnalyticsService } from '../../../user-behaviour-analytics/user-behaviour-analytics.service';
4
5
  import * as i0 from "@angular/core";
5
6
  export declare class GooglePayCheckoutPaymentService implements GooglePayPaymentService {
6
7
  readonly paymentSystemProcessingService: PaymentSystemProcessingService;
8
+ private readonly userBehaviourAnalyticsService;
7
9
  private initParams;
8
10
  private checkout;
9
- constructor(paymentSystemProcessingService: PaymentSystemProcessingService);
11
+ constructor(paymentSystemProcessingService: PaymentSystemProcessingService, userBehaviourAnalyticsService: UserBehaviourAnalyticsService);
10
12
  preparePayment({ initParams, checkDeviceData, }: PreparePaymentParams): GoogleInitData | null;
11
13
  getPaymentRequest(): GooglePayPaymentRequest | null;
12
14
  getAllowedPaymentMethods(): AllowedPaymentMethod[];
@@ -10,4 +10,5 @@ export interface SdkPaymentSystemsInitialData {
10
10
  submitResponse: SubmitResponse | null;
11
11
  data: string | null;
12
12
  locale: string;
13
+ shouldHandleUserBackRedirectOnSdkSide: boolean;
13
14
  }
@@ -1,8 +1,45 @@
1
1
  export declare enum UserBehaviourEventName {
2
2
  openPaystation = "open-paystation",
3
- showMethodHeader = "show-method-header",
4
3
  showErrorMessage = "show-error-message",
5
4
  openStatusError = "open-status-error",
6
- statusUpdated = "status-updated",
7
- sysTrackedScripts = "sys-tracked_scripts"
5
+ changeStatus = "change-status",
6
+ checkStatusUpdate = "check-status-update",
7
+ sysTrackedScripts = "sys-tracked_scripts",
8
+ showShoppingCart = "show-shopping_cart",
9
+ attemptBuyNow = "attempt-buy_now",
10
+ attemptContinue = "attempt-continue",
11
+ clickBtnPay = "click-btn-pay",
12
+ initializeNextAction = "initialize-next-action",
13
+ nextAction = "next-action",
14
+ createForm = "create-form",
15
+ applicablePaymentStrategies = "applicable-payment-strategies",
16
+ initializeRequest = "initialize-request",
17
+ submitRequest = "submit-request",
18
+ syncRequest = "sync-request",
19
+ threeDs2complete = "3DS-2.0-complete",
20
+ threeDs2challenge = "3DS-2.0-challenge",
21
+ threeDs2collectDfp = "3DS-2.0-collect-dfp",
22
+ applePayRecalculateCartTaxes = "apple-pay-recalculate-cart-taxes",
23
+ applePayRecalculateCartError = "apple-pay-recalculate-cart-error",
24
+ applePayOpenWebSocketConnection = "apple-pay-open-web-socket-connection",
25
+ applePaySendMessageToAnotherWindow = "apple-pay-send-message-to-another-window",
26
+ applePayBraintreeStartSession = "apple-pay-braintree-start-session",
27
+ applePayBraintreeSelectShipping = "apple-pay-braintree-select-shipping",
28
+ applePayBraintreeCartSuccessfulRecalculated = "apple-pay-braintree-cart-successful-recalculated",
29
+ applePayBraintreeCartErrorRecalculated = "apple-pay-braintree-cart-error-recalculated",
30
+ applePayBraintreeValidateMerchant = "apple-pay-braintree-validate-merchant",
31
+ applePayBraintreeValidateMerchantError = "apple-pay-braintree-validate-merchant-error",
32
+ applePayBraintreePaymentAuthorized = "apple-pay-braintree-payment-authorized",
33
+ applePayBraintreePaymentTokenizationError = "apple-pay-braintree-payment-tokenization-error",
34
+ applePayBraintreePaymentCancel = "apple-pay-braintree-payment-cancel",
35
+ applePayCheckoutSelectShipping = "apple-pay-checkout-select-shipping",
36
+ applePayCheckoutCartSuccessfulRecalculated = "apple-pay-checkout-cart-successful-recalculated",
37
+ applePayCheckoutCartErrorRecalculated = "apple-pay-checkout-cart-error-recalculated",
38
+ applePayCheckoutValidateMerchant = "apple-pay-checkout-validate-merchant",
39
+ applePayCheckoutValidateMerchantError = "apple-pay-checkout-validate-merchant-error",
40
+ applePayCheckoutPaymentAuthorized = "apple-pay-checkout-payment-authorized",
41
+ applePayCheckoutPaymentCancel = "apple-pay-checkout-payment-cancel",
42
+ applePayAcquirer = "apple-pay-acquirer",
43
+ googlePayHandleFailedPayment = "google-pay-handle-failed-payment",
44
+ googlePayHandleSuccessfulPayment = "google-pay-handle-successful-payment"
8
45
  }
@@ -97,7 +97,10 @@ export declare class CoreLibraryService {
97
97
  init(configuration: InitConfiguration): Promise<void>;
98
98
  getStatus(url?: string): Promise<Status>;
99
99
  calculateField(changedField: Field, fields: Field[]): Promise<SyncResponse>;
100
- submit(fields: Field[]): Promise<SubmitResponse>;
100
+ submit(fields: Field[]): Promise<{
101
+ response: SubmitResponse;
102
+ nextAction: NextAction | null | void;
103
+ }>;
101
104
  sendAnalytics(action: string, type: keyof typeof userBehaviourEventTypes, options?: SendEventMethodOptionsInterface): void;
102
105
  getQrCodeInitialData(): {
103
106
  qrCode: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xsolla/payment-client-core",
3
- "version": "0.2.90",
3
+ "version": "0.2.92",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^17.3.3",
6
6
  "@angular/core": "^17.3.3",