@xsolla/payment-client-core 0.2.91 → 0.2.93

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 (32) hide show
  1. package/esm2022/lib/core/payment/actions/next-actions.mjs +3 -1
  2. package/esm2022/lib/core/payment/actions/redirect/google-three-ds-redirect.action.class.mjs +20 -0
  3. package/esm2022/lib/core/payment/actions/redirect/redirect.action.class.mjs +16 -8
  4. package/esm2022/lib/core/payment/actions/redirect/redirect.action.type.mjs +1 -1
  5. package/esm2022/lib/core/payment/field-names.enum.mjs +2 -1
  6. package/esm2022/lib/core/payment/form/validators/required/required.validator.mjs +1 -2
  7. package/esm2022/lib/core/payment/payment-configuration.interface.mjs +1 -1
  8. package/esm2022/lib/core/payment/payment-configurations/types/google-pay-form-configuration.interface.mjs +2 -0
  9. package/esm2022/lib/core/payment/payment-configurations/types/is-credit-card-settings.guard.mjs +5 -0
  10. package/esm2022/lib/core/payment/payment-configurations/types/is-google-pay-settings.guard.mjs +5 -0
  11. package/esm2022/lib/core/payment/payment-settings/payment-settings.service.mjs +8 -5
  12. package/esm2022/lib/core/payment/payment.service.mjs +13 -5
  13. package/esm2022/lib/core/sdk-payment-systems/google-pay/google-pay.service.mjs +18 -2
  14. package/esm2022/lib/core/sdk-payment-systems/sdk-payment-systems-initial-data.interface.mjs +1 -1
  15. package/esm2022/lib/core-library.service.mjs +1 -1
  16. package/fesm2022/xsolla-payment-client-core.mjs +75 -17
  17. package/fesm2022/xsolla-payment-client-core.mjs.map +1 -1
  18. package/lib/core/payment/actions/redirect/google-three-ds-redirect.action.class.d.ts +9 -0
  19. package/lib/core/payment/actions/redirect/redirect.action.class.d.ts +2 -1
  20. package/lib/core/payment/actions/redirect/redirect.action.type.d.ts +1 -0
  21. package/lib/core/payment/field-names.enum.d.ts +1 -0
  22. package/lib/core/payment/payment-configuration.interface.d.ts +4 -2
  23. package/lib/core/payment/payment-configurations/types/google-pay-form-configuration.interface.d.ts +8 -0
  24. package/lib/core/payment/payment-configurations/types/is-credit-card-settings.guard.d.ts +3 -0
  25. package/lib/core/payment/payment-configurations/types/is-google-pay-settings.guard.d.ts +3 -0
  26. package/lib/core/payment/payment.service.d.ts +4 -1
  27. package/lib/core/sdk-payment-systems/google-pay/google-pay.service.d.ts +6 -0
  28. package/lib/core/sdk-payment-systems/sdk-payment-systems-initial-data.interface.d.ts +1 -0
  29. package/lib/core-library.service.d.ts +4 -1
  30. package/package.json +1 -1
  31. package/xsolla-payment-client-core-0.2.93.tgz +0 -0
  32. package/xsolla-payment-client-core-0.2.91.tgz +0 -0
@@ -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,6 +79,7 @@ export declare enum FieldNames {
79
79
  payViaCheckoutUrl = "payViaCheckoutUrl",
80
80
  googlePayInitData = "googlePayInitData",
81
81
  googlePayPaymentData = "googlePayPaymentData",
82
+ googlePay3dsRedirect = "googlePay3DSRedirect",
82
83
  externalCardIssuerCountry = "externalCardIssuerCountry",
83
84
  pmId = "pm_id"
84
85
  }
@@ -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;
@@ -80,7 +80,10 @@ export declare class PaymentService {
80
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);
81
81
  initialize(config: PaymentConfiguration): Promise<InitializedForm>;
82
82
  submit(): Promise<NextAction | null | void>;
83
- submitWithFields(fields?: Field[]): Promise<SubmitResponse>;
83
+ submitWithFields(fields?: Field[]): Promise<{
84
+ response: SubmitResponse;
85
+ nextAction: NextAction | null | void;
86
+ }>;
84
87
  setupInitialFieldValues(): void;
85
88
  getFields(): Field[];
86
89
  getControlStatus(name: FieldNames): ControlStatus | null;
@@ -19,6 +19,9 @@ export declare class GooglePayService {
19
19
  private readonly injector;
20
20
  private readonly googlePayScriptUrl;
21
21
  private readonly readyToPay;
22
+ private readonly paymentWindowIsReady;
23
+ private readonly paymentWindowIsClose;
24
+ private readonly error;
22
25
  private googlePaymentClient;
23
26
  private initParams;
24
27
  private paymentService;
@@ -28,6 +31,9 @@ export declare class GooglePayService {
28
31
  private get googlePaymentClientWasInitialized();
29
32
  constructor(window: ExtendedWindow, loggerService: LoggerService, paymentSystemProcessingService: PaymentSystemProcessingService, googlePayCheckoutPaymentService: GooglePayCheckoutPaymentService, googlePayInstantPaymentService: GooglePayInstantPaymentService, injector: Injector);
30
33
  get readyToPay$(): Observable<boolean | null>;
34
+ get paymentWindowIsReady$(): Observable<void>;
35
+ get paymentWindowIsClose$(): Observable<void>;
36
+ get error$(): Observable<unknown>;
31
37
  isReadyToPay(): boolean | null;
32
38
  initGooglePayLibrary(data: GooglePayInitParams): void;
33
39
  checkPaymentDevice(data: CheckPaymentDeviceData): void;
@@ -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
  }
@@ -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.91",
3
+ "version": "0.2.93",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^17.3.3",
6
6
  "@angular/core": "^17.3.3",