@xsolla/payment-client-core 0.2.8 → 0.2.10

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 +5 -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 +25 -0
  6. package/esm2020/lib/core/payment/actions/show-qr-code/show-qr-code.action.type.mjs +2 -0
  7. package/esm2020/lib/core/payment/initialize/initialize-request-params.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 -6
  10. package/esm2020/lib/core/payment/status/status.service.mjs +4 -1
  11. package/esm2020/lib/core/payment/xps-api/xps-api.service.mjs +4 -1
  12. package/esm2020/lib/core/settings/configuration.interface.mjs +1 -1
  13. package/esm2020/lib/core/settings/settings.service.mjs +6 -1
  14. package/esm2020/lib/core-library.service.mjs +8 -1
  15. package/fesm2015/xsolla-payment-client-core.mjs +90 -4
  16. package/fesm2015/xsolla-payment-client-core.mjs.map +1 -1
  17. package/fesm2020/xsolla-payment-client-core.mjs +87 -4
  18. package/fesm2020/xsolla-payment-client-core.mjs.map +1 -1
  19. package/lib/core/payment/actions/next-action.interface.d.ts +3 -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 +11 -0
  23. package/lib/core/payment/actions/show-qr-code/show-qr-code.action.type.d.ts +6 -0
  24. package/lib/core/payment/initialize/initialize-request-params.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 +5 -1
  27. package/lib/core/payment/status/status.service.d.ts +3 -0
  28. package/lib/core/settings/configuration.interface.d.ts +1 -0
  29. package/lib/core/settings/settings.service.d.ts +2 -0
  30. package/lib/core-library.service.d.ts +4 -0
  31. package/package.json +1 -1
  32. package/xsolla-payment-client-core-0.2.10.tgz +0 -0
  33. package/xsolla-payment-client-core-0.2.8.tgz +0 -0
@@ -5,4 +5,6 @@ import { RedirectAction } from './redirect/redirect.action.type';
5
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
- export type NextAction = CheckStatusAction | ShowFieldsAction | StatusUpdatedAction | ShowErrorsAction | RedirectAction | ThreeDsAction | SpecialButtonAction;
8
+ import { ShowQrCodeAction } from './show-qr-code/show-qr-code.action.type';
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>;
@@ -0,0 +1,11 @@
1
+ import { SubmitResponse } from '../../submit/response/submit-response.class';
2
+ import { ActionCreator } from '../action.interface';
3
+ import { ShowQrCodeAction, ShowQrCodeActionType } from './show-qr-code.action.type';
4
+ import * as i0 from "@angular/core";
5
+ export declare class ShowQrCodeActionCreator implements ActionCreator {
6
+ readonly type: ShowQrCodeActionType;
7
+ getActionData(response: SubmitResponse): ShowQrCodeAction;
8
+ isSuitable(response: SubmitResponse): boolean;
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<ShowQrCodeActionCreator, never>;
10
+ static ɵprov: i0.ɵɵInjectableDeclaration<ShowQrCodeActionCreator>;
11
+ }
@@ -0,0 +1,6 @@
1
+ import { Action } from '../action.interface';
2
+ export type ShowQrCodeActionType = 'show_qr_code';
3
+ export interface ShowQrCodeActionData {
4
+ submitButtonText: string;
5
+ }
6
+ export type ShowQrCodeAction = Action<ShowQrCodeActionType, ShowQrCodeActionData>;
@@ -9,4 +9,5 @@ export interface InitializeRequestParams {
9
9
  paymentWithSavedMethod: XpsBoolean;
10
10
  saved_method_id?: number;
11
11
  save_payment_account_only: XpsBoolean;
12
+ mobile?: XpsBoolean;
12
13
  }
@@ -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,17 +58,19 @@ 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[];
63
65
  getInitialDataForSdkPaymentSystems(): SdkPaymentSystemsInitialData;
66
+ getQrCode(): string;
64
67
  getPid(): number | null;
65
68
  validate(field: Field): Promise<ValidationErrors | null>;
66
69
  runThreeDs(): void;
67
70
  getFinanceDetails(): FinanceDetails | null;
68
71
  updateFieldFormState(fieldName: string, formState: FormState): void;
69
72
  getStatus(): Promise<Status>;
73
+ listenFinalStatus(): Promise<void>;
70
74
  getFieldConfig(field: Field): ControlConfig | null;
71
75
  changeFieldValue(name: string, value: string): void;
72
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,5 +1,6 @@
1
1
  export interface InitConfiguration {
2
2
  token: string;
3
+ isMobile: boolean;
3
4
  isWebview?: boolean;
4
5
  sandbox?: boolean;
5
6
  }
@@ -16,11 +16,13 @@ export declare class SettingsService {
16
16
  get utilsResponse(): DeepReadonly<UtilsResponse>;
17
17
  get isEmpty(): boolean;
18
18
  get token(): string;
19
+ get isMobile(): boolean;
19
20
  get hasResponse(): boolean;
20
21
  isInitialized: boolean;
21
22
  private response;
22
23
  private _token;
23
24
  private sandboxMode;
25
+ private _isMobile;
24
26
  constructor(secureApi: SecureApiClient);
25
27
  init(configuration: InitConfiguration): Promise<void>;
26
28
  isSandboxMode(): boolean;
@@ -65,6 +65,10 @@ export declare class CoreLibraryService {
65
65
  constructor(settingsService: SettingsService, countryService: CountryService, paymentMethodsService: PaymentMethodsService, savedMethodsService: SavedMethodsService, userBalanceService: UserBalanceService, paymentConfigService: PaymentConfigService, paymentService: PaymentService, deviceFingerPrintService: DeviceFingerPrintService, financeDetailsService: FinanceDetailsService, legalService: LegalService, statusService: StatusService, nextActionService: NextActionService, creditCardService: CreditCardService, creditCardStateService: CreditCardStateService, formMessagesService: FormMessagesService, editSavedMethodsService: EditSavedMethodsService, googlePayService: GooglePayService, commonPayProcessingService: PaymentSystemProcessingService);
66
66
  init(configuration: InitConfiguration): Promise<void>;
67
67
  getStatus(url?: string): Promise<Status>;
68
+ getQrCodeInitialData(): {
69
+ qrCode: string;
70
+ pid: number | null;
71
+ };
68
72
  setCountry(country: string): void;
69
73
  getCountry(): string;
70
74
  createPayment(config: PaymentConfig): Payment;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xsolla/payment-client-core",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^15.2.0",
6
6
  "@angular/core": "^15.2.0",