@xsolla/payment-client-core 0.2.9 → 0.2.11

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 (33) hide show
  1. package/esm2020/lib/core/payment/actions/next-action.interface.mjs +1 -1
  2. package/esm2020/lib/core/payment/actions/next-actions.mjs +3 -1
  3. package/esm2020/lib/core/payment/actions/show-mobile-payment-screen/show-mobile-payment-screen.action.class.mjs +26 -0
  4. package/esm2020/lib/core/payment/actions/show-mobile-payment-screen/show-mobile-payment-screen.action.type.mjs +2 -0
  5. package/esm2020/lib/core/payment/actions/show-qr-code/show-qr-code.action.class.mjs +6 -3
  6. package/esm2020/lib/core/payment/actions/show-qr-code/show-qr-code.action.type.mjs +1 -1
  7. package/esm2020/lib/core/payment/form-response.interface.mjs +1 -1
  8. package/esm2020/lib/core/payment/payment.interface.mjs +1 -1
  9. package/esm2020/lib/core/payment/payment.service.mjs +24 -7
  10. package/esm2020/lib/core/payment/status/status.service.mjs +4 -1
  11. package/esm2020/lib/core/sdk-payment-systems/apple-pay/apple-pay.const.mjs +2 -1
  12. package/esm2020/lib/core/sdk-payment-systems/apple-pay/apple-pay.service.mjs +13 -6
  13. package/esm2020/lib/core/user-agent/user-agent.service.mjs +12 -1
  14. package/esm2020/lib/core-library.service.mjs +2 -1
  15. package/fesm2015/xsolla-payment-client-core.mjs +78 -11
  16. package/fesm2015/xsolla-payment-client-core.mjs.map +1 -1
  17. package/fesm2020/xsolla-payment-client-core.mjs +76 -11
  18. package/fesm2020/xsolla-payment-client-core.mjs.map +1 -1
  19. package/lib/core/payment/actions/next-action.interface.d.ts +2 -1
  20. package/lib/core/payment/actions/show-mobile-payment-screen/show-mobile-payment-screen.action.class.d.ts +11 -0
  21. package/lib/core/payment/actions/show-mobile-payment-screen/show-mobile-payment-screen.action.type.d.ts +6 -0
  22. package/lib/core/payment/actions/show-qr-code/show-qr-code.action.class.d.ts +1 -1
  23. package/lib/core/payment/actions/show-qr-code/show-qr-code.action.type.d.ts +4 -1
  24. package/lib/core/payment/form-response.interface.d.ts +1 -0
  25. package/lib/core/payment/payment.interface.d.ts +1 -0
  26. package/lib/core/payment/payment.service.d.ts +4 -1
  27. package/lib/core/payment/status/status.service.d.ts +3 -0
  28. package/lib/core/sdk-payment-systems/apple-pay/apple-pay.const.d.ts +1 -0
  29. package/lib/core/sdk-payment-systems/apple-pay/apple-pay.service.d.ts +2 -1
  30. package/lib/core/user-agent/user-agent.service.d.ts +1 -0
  31. package/package.json +1 -1
  32. package/xsolla-payment-client-core-0.2.11.tgz +0 -0
  33. package/xsolla-payment-client-core-0.2.9.tgz +0 -0
@@ -6,4 +6,5 @@ import { ShowErrorsAction } from './show-errors/show-errors.action.type';
6
6
  import { ThreeDsAction } from './three-ds/three-ds.action.type';
7
7
  import { SpecialButtonAction } from './special-button/special-button.action.type';
8
8
  import { ShowQrCodeAction } from './show-qr-code/show-qr-code.action.type';
9
- export type NextAction = CheckStatusAction | ShowFieldsAction | StatusUpdatedAction | ShowErrorsAction | RedirectAction | ThreeDsAction | SpecialButtonAction | ShowQrCodeAction;
9
+ import { ShowMobilePaymentScreenAction } from './show-mobile-payment-screen/show-mobile-payment-screen.action.type';
10
+ export type NextAction = CheckStatusAction | ShowFieldsAction | StatusUpdatedAction | ShowErrorsAction | RedirectAction | ThreeDsAction | SpecialButtonAction | ShowQrCodeAction | ShowMobilePaymentScreenAction;
@@ -0,0 +1,11 @@
1
+ import { SubmitResponse } from '../../submit/response/submit-response.class';
2
+ import { ActionCreator } from '../action.interface';
3
+ import { ShowMobilePaymentScreenAction, ShowMobilePaymentScreenActionType } from './show-mobile-payment-screen.action.type';
4
+ import * as i0 from "@angular/core";
5
+ export declare class ShowMobilePaymentScreenActionCreator implements ActionCreator {
6
+ type: ShowMobilePaymentScreenActionType;
7
+ getActionData(response: SubmitResponse): ShowMobilePaymentScreenAction;
8
+ isSuitable(response: SubmitResponse): boolean;
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<ShowMobilePaymentScreenActionCreator, never>;
10
+ static ɵprov: i0.ɵɵInjectableDeclaration<ShowMobilePaymentScreenActionCreator>;
11
+ }
@@ -0,0 +1,6 @@
1
+ import { Action } from '../action.interface';
2
+ export type ShowMobilePaymentScreenActionType = 'show_mobile_payment_screen';
3
+ export interface ShowMobilePaymentScreenActionData {
4
+ submitButtonText: string;
5
+ }
6
+ export type ShowMobilePaymentScreenAction = Action<ShowMobilePaymentScreenActionType, ShowMobilePaymentScreenActionData>;
@@ -4,7 +4,7 @@ import { ShowQrCodeAction, ShowQrCodeActionType } from './show-qr-code.action.ty
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class ShowQrCodeActionCreator implements ActionCreator {
6
6
  readonly type: ShowQrCodeActionType;
7
- getActionData(): ShowQrCodeAction;
7
+ getActionData(response: SubmitResponse): ShowQrCodeAction;
8
8
  isSuitable(response: SubmitResponse): boolean;
9
9
  static ɵfac: i0.ɵɵFactoryDeclaration<ShowQrCodeActionCreator, never>;
10
10
  static ɵprov: i0.ɵɵInjectableDeclaration<ShowQrCodeActionCreator>;
@@ -1,3 +1,6 @@
1
1
  import { Action } from '../action.interface';
2
2
  export type ShowQrCodeActionType = 'show_qr_code';
3
- export type ShowQrCodeAction = Action<ShowQrCodeActionType, null>;
3
+ export interface ShowQrCodeActionData {
4
+ submitButtonText: string;
5
+ }
6
+ export type ShowQrCodeAction = Action<ShowQrCodeActionType, ShowQrCodeActionData>;
@@ -5,4 +5,5 @@ export interface FormResponse {
5
5
  type: 'sync' | 'initialize' | 'submit';
6
6
  data: InitializeResponse | SubmitResponse | XpsResponse;
7
7
  token: string;
8
+ isSandbox: boolean;
8
9
  }
@@ -17,6 +17,7 @@ export interface Payment {
17
17
  getFinanceDetails(): FinanceDetails | null;
18
18
  runThreeDs(): void;
19
19
  getStatus(): Promise<Status>;
20
+ listenFinalStatus(): Promise<void>;
20
21
  form: {
21
22
  fieldsStatus$: Observable<FormFieldsStatus>;
22
23
  changeFieldValue(name: string, value: string): void;
@@ -25,6 +25,7 @@ import { SettingsService } from '../settings/settings.service';
25
25
  import { CountryService } from '../country/country.service';
26
26
  import { SdkPaymentSystemsInitialData } from '../sdk-payment-systems/sdk-payment-systems-initial-data.interface';
27
27
  import { FormResponse } from './form-response.interface';
28
+ import { CheckStatusActionCreator } from './actions/check-status/check-status.action.class';
28
29
  import * as i0 from "@angular/core";
29
30
  export declare class PaymentService {
30
31
  private readonly initializeService;
@@ -40,6 +41,7 @@ export declare class PaymentService {
40
41
  private readonly formMessagesService;
41
42
  private readonly settingsService;
42
43
  private readonly countryService;
44
+ private readonly checkStatusActionCreator;
43
45
  form: UntypedFormGroup | null;
44
46
  get formFieldsStatus$(): Observable<FormFieldsStatus>;
45
47
  get paymentForm$(): Observable<FormControlStatus | null>;
@@ -56,7 +58,7 @@ export declare class PaymentService {
56
58
  private readonly formFieldsStatusSubject;
57
59
  private readonly _formResponse$;
58
60
  private isSavingMethodMode;
59
- constructor(initializeService: InitializeService, submitService: SubmitService, syncService: SyncService, formService: FormService, statusService: StatusService, financeDetailsService: FinanceDetailsService, creditCardStateService: CreditCardStateService, nextActionService: NextActionService, controlConfigService: ControlConfigService, threeDsService: ThreeDsService, formMessagesService: FormMessagesService, settingsService: SettingsService, countryService: CountryService);
61
+ constructor(initializeService: InitializeService, submitService: SubmitService, syncService: SyncService, formService: FormService, statusService: StatusService, financeDetailsService: FinanceDetailsService, creditCardStateService: CreditCardStateService, nextActionService: NextActionService, controlConfigService: ControlConfigService, threeDsService: ThreeDsService, formMessagesService: FormMessagesService, settingsService: SettingsService, countryService: CountryService, checkStatusActionCreator: CheckStatusActionCreator);
60
62
  initialize(config: PaymentConfig): Promise<Field[]>;
61
63
  submit(): Promise<NextAction | null | void>;
62
64
  getFields(): Field[];
@@ -68,6 +70,7 @@ export declare class PaymentService {
68
70
  getFinanceDetails(): FinanceDetails | null;
69
71
  updateFieldFormState(fieldName: string, formState: FormState): void;
70
72
  getStatus(): Promise<Status>;
73
+ listenFinalStatus(): Promise<void>;
71
74
  getFieldConfig(field: Field): ControlConfig | null;
72
75
  changeFieldValue(name: string, value: string): void;
73
76
  changeFieldState(name: string, state: InputEventName): void;
@@ -1,3 +1,4 @@
1
+ import { Observable } from 'rxjs';
1
2
  import { StatusRequestService } from './status-request/status-request.service';
2
3
  import { StatusRequestParams } from './status-request/status-request-params.interface';
3
4
  import { ListenStatusService } from './listen-status/listen-status.service';
@@ -7,6 +8,7 @@ import { StatusUpdatedActionCreator } from '../actions/status-updated/status-upd
7
8
  import { UrlService } from '../../url/url.service';
8
9
  import { FinanceDetailsService } from '../finance-details/finance-details.service';
9
10
  import { SavePaymentMethodStatusService } from './save-payment-method-status/save-payment-method-status.service';
11
+ import { StatusSettings } from './status-settings.interface';
10
12
  import * as i0 from "@angular/core";
11
13
  export declare class StatusService {
12
14
  private readonly urlService;
@@ -19,6 +21,7 @@ export declare class StatusService {
19
21
  constructor(urlService: UrlService, statusRequestService: StatusRequestService, financeDetailsService: FinanceDetailsService, listenStatusService: ListenStatusService, nextActionService: NextActionService, savePaymentMethodStatusService: SavePaymentMethodStatusService, statusUpdatedActionCreator: StatusUpdatedActionCreator);
20
22
  getStatus(params: StatusRequestParams): Promise<Status>;
21
23
  getStatusWithUrlSearchParams(url?: string): Promise<Status>;
24
+ listenFinalStatus(invoice: number): Observable<StatusSettings>;
22
25
  private getRequestParamsFromUrl;
23
26
  private startWaitingStatusUpdates;
24
27
  static ɵfac: i0.ɵɵFactoryDeclaration<StatusService, never>;
@@ -1 +1,2 @@
1
1
  export declare const applePayVersion = 3;
2
+ export declare const safariVersionForIframeIntegration = 17;
@@ -25,7 +25,7 @@ export declare class ApplePayService {
25
25
  constructor(window: ExtendedWindow, userAgentService: UserAgentService, summaryFinanceDetailsAdapterService: SummaryFinanceDetailsAdapterService);
26
26
  setApplePayParams(data: unknown): void;
27
27
  initLibrary(tokenKey: string): Promise<void>;
28
- redirectToPaymentPage(parameters: ApplePayParams, token: string): string | undefined;
28
+ redirectToPaymentPage(parameters: ApplePayParams, token: string, isSandbox?: boolean): string | undefined;
29
29
  setOrder(data: unknown): void;
30
30
  proceedCheckout(parameters?: ApplePayParams): void;
31
31
  isDeviceCapable(): boolean;
@@ -41,6 +41,7 @@ export declare class ApplePayService {
41
41
  private getJsonValueFromField;
42
42
  private emitError;
43
43
  private emitIntegrationType;
44
+ private canUseSdk;
44
45
  static ɵfac: i0.ɵɵFactoryDeclaration<ApplePayService, never>;
45
46
  static ɵprov: i0.ɵɵInjectableDeclaration<ApplePayService>;
46
47
  }
@@ -16,6 +16,7 @@ export declare class UserAgentService {
16
16
  get userAgent(): string;
17
17
  get browserDescription(): typeof browsers[number]['sentName'] | string;
18
18
  get isSafari(): boolean;
19
+ get safariVersion(): null | number;
19
20
  get iOsVersion(): string | null;
20
21
  get browserInfo(): BrowserInfo;
21
22
  get isMobileDevice(): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xsolla/payment-client-core",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^15.2.0",
6
6
  "@angular/core": "^15.2.0",