@xsolla/payment-client-core 0.0.1 → 0.0.2

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 (96) hide show
  1. package/README.md +8 -11
  2. package/esm2020/lib/core/boolean-number.enum.mjs +6 -0
  3. package/esm2020/lib/core/country/country.service.mjs +27 -0
  4. package/esm2020/lib/core/deep-readonly.type.mjs +2 -0
  5. package/esm2020/lib/core/exceptions-handling/errors/api-error.interface.mjs +2 -0
  6. package/esm2020/lib/core/exceptions-handling/errors/app-error.class.mjs +6 -0
  7. package/esm2020/lib/core/exceptions-handling/errors/http-error.class.mjs +40 -0
  8. package/esm2020/lib/core/exceptions-handling/errors/response-error.class.mjs +7 -0
  9. package/esm2020/lib/core/exceptions-handling/http-interceptor/http-error-data.interface.mjs +2 -0
  10. package/esm2020/lib/core/exceptions-handling/http-interceptor/http-error-response-data.interface.mjs +2 -0
  11. package/esm2020/lib/core/exceptions-handling/http-interceptor/http-exceptions.interceptor.mjs +22 -0
  12. package/esm2020/lib/core/extended-window.interface.mjs +2 -0
  13. package/esm2020/lib/core/http/secure-api/api-url.const.mjs +3 -0
  14. package/esm2020/lib/core/http/secure-api/options.interface.mjs +2 -0
  15. package/esm2020/lib/core/http/secure-api/secure-api.service.mjs +55 -0
  16. package/esm2020/lib/core/payment-methods/payment-method-api.interface.mjs +2 -0
  17. package/esm2020/lib/core/payment-methods/payment-method.interface.mjs +2 -0
  18. package/esm2020/lib/core/payment-methods/payment-methods-api.interface.mjs +2 -0
  19. package/esm2020/lib/core/payment-methods/payment-methods-request-params.interface.mjs +2 -0
  20. package/esm2020/lib/core/payment-methods/payment-methods-response.class.mjs +26 -0
  21. package/esm2020/lib/core/payment-methods/payment-methods-response.interface.mjs +2 -0
  22. package/esm2020/lib/core/payment-methods/payment-methods-response.token.mjs +8 -0
  23. package/esm2020/lib/core/payment-methods/payment-methods.service.mjs +58 -0
  24. package/esm2020/lib/core/settings/auto-redirect-on-status.mjs +14 -0
  25. package/esm2020/lib/core/settings/balance.interface.mjs +2 -0
  26. package/esm2020/lib/core/settings/bonus.interface.mjs +2 -0
  27. package/esm2020/lib/core/settings/configuration.interface.mjs +2 -0
  28. package/esm2020/lib/core/settings/empty-utils-response.error.mjs +7 -0
  29. package/esm2020/lib/core/settings/header-type.enum.mjs +6 -0
  30. package/esm2020/lib/core/settings/offer.interface.mjs +2 -0
  31. package/esm2020/lib/core/settings/project.interface.mjs +2 -0
  32. package/esm2020/lib/core/settings/purchase.interface.mjs +2 -0
  33. package/esm2020/lib/core/settings/settings-mode.enum.mjs +5 -0
  34. package/esm2020/lib/core/settings/settings.interface.mjs +2 -0
  35. package/esm2020/lib/core/settings/settings.service.mjs +85 -0
  36. package/esm2020/lib/core/settings/status-back-show.mjs +16 -0
  37. package/esm2020/lib/core/settings/tracking-info.interface.mjs +2 -0
  38. package/esm2020/lib/core/settings/user.interface.mjs +2 -0
  39. package/esm2020/lib/core/settings/utils-response.interface.mjs +2 -0
  40. package/esm2020/lib/core/window.token.mjs +3 -0
  41. package/esm2020/lib/core-library.module.mjs +35 -17
  42. package/esm2020/lib/core-library.service.mjs +31 -13
  43. package/esm2020/public-api.mjs +6 -7
  44. package/esm2020/xsolla-payment-client-core.mjs +4 -4
  45. package/fesm2015/xsolla-payment-client-core.mjs +390 -33
  46. package/fesm2015/xsolla-payment-client-core.mjs.map +1 -1
  47. package/fesm2020/xsolla-payment-client-core.mjs +376 -33
  48. package/fesm2020/xsolla-payment-client-core.mjs.map +1 -1
  49. package/index.d.ts +5 -5
  50. package/lib/core/boolean-number.enum.d.ts +4 -0
  51. package/lib/core/country/country.service.d.ts +12 -0
  52. package/lib/core/deep-readonly.type.d.ts +3 -0
  53. package/lib/core/exceptions-handling/errors/api-error.interface.d.ts +4 -0
  54. package/lib/core/exceptions-handling/errors/app-error.class.d.ts +3 -0
  55. package/lib/core/exceptions-handling/errors/http-error.class.d.ts +10 -0
  56. package/lib/core/exceptions-handling/errors/response-error.class.d.ts +4 -0
  57. package/lib/core/exceptions-handling/http-interceptor/http-error-data.interface.d.ts +20 -0
  58. package/lib/core/exceptions-handling/http-interceptor/http-error-response-data.interface.d.ts +7 -0
  59. package/lib/core/exceptions-handling/http-interceptor/http-exceptions.interceptor.d.ts +11 -0
  60. package/lib/core/extended-window.interface.d.ts +1 -0
  61. package/lib/core/http/secure-api/api-url.const.d.ts +2 -0
  62. package/lib/core/http/secure-api/options.interface.d.ts +14 -0
  63. package/lib/core/http/secure-api/secure-api.service.d.ts +20 -0
  64. package/lib/core/payment-methods/payment-method-api.interface.d.ts +11 -0
  65. package/lib/core/payment-methods/payment-method.interface.d.ts +11 -0
  66. package/lib/core/payment-methods/payment-methods-api.interface.d.ts +10 -0
  67. package/lib/core/payment-methods/payment-methods-request-params.interface.d.ts +4 -0
  68. package/lib/core/payment-methods/payment-methods-response.class.d.ts +13 -0
  69. package/lib/core/payment-methods/payment-methods-response.interface.d.ts +4 -0
  70. package/lib/core/payment-methods/payment-methods-response.token.d.ts +7 -0
  71. package/lib/core/payment-methods/payment-methods.service.d.ts +20 -0
  72. package/lib/core/settings/auto-redirect-on-status.d.ts +12 -0
  73. package/lib/core/settings/balance.interface.d.ts +4 -0
  74. package/lib/core/settings/bonus.interface.d.ts +10 -0
  75. package/lib/core/settings/configuration.interface.d.ts +5 -0
  76. package/lib/core/settings/empty-utils-response.error.d.ts +4 -0
  77. package/lib/core/settings/header-type.enum.d.ts +4 -0
  78. package/lib/core/settings/offer.interface.d.ts +6 -0
  79. package/lib/core/settings/project.interface.d.ts +32 -0
  80. package/lib/core/settings/purchase.interface.d.ts +47 -0
  81. package/lib/core/settings/settings-mode.enum.d.ts +3 -0
  82. package/lib/core/settings/settings.interface.d.ts +45 -0
  83. package/lib/core/settings/settings.service.d.ts +30 -0
  84. package/lib/core/settings/status-back-show.d.ts +14 -0
  85. package/lib/core/settings/tracking-info.interface.d.ts +5 -0
  86. package/lib/core/settings/user.interface.d.ts +23 -0
  87. package/lib/core/settings/utils-response.interface.d.ts +16 -0
  88. package/lib/core/window.token.d.ts +3 -0
  89. package/lib/core-library.module.d.ts +7 -7
  90. package/lib/core-library.service.d.ts +20 -5
  91. package/package.json +4 -3
  92. package/public-api.d.ts +2 -3
  93. package/xsolla-payment-client-core-0.0.2.tgz +0 -0
  94. package/esm2020/lib/core-library.component.mjs +0 -11
  95. package/lib/core-library.component.d.ts +0 -5
  96. package/xsolla-payment-client-core-0.0.1.tgz +0 -0
@@ -0,0 +1,10 @@
1
+ import { HttpErrorResponse, HttpRequest } from '@angular/common/http';
2
+ import { AppError } from './app-error.class';
3
+ import { HttpErrorData } from '../http-interceptor/http-error-data.interface';
4
+ export declare class HttpError extends AppError {
5
+ private readonly RESTRICTED_KEYS_REGEXP;
6
+ private readonly httpErrorData;
7
+ constructor(error: HttpErrorResponse, req: HttpRequest<unknown>);
8
+ getHttpErrorData(): HttpErrorData;
9
+ private cleanPersonalData;
10
+ }
@@ -0,0 +1,4 @@
1
+ import { AppError } from './app-error.class';
2
+ export declare class ResponseError extends AppError {
3
+ constructor(message?: string);
4
+ }
@@ -0,0 +1,20 @@
1
+ import { HttpHeaders, HttpStatusCode } from '@angular/common/http';
2
+ import { ApiError } from '../errors/api-error.interface';
3
+ export interface HttpErrorData {
4
+ request: {
5
+ url: string;
6
+ method: string;
7
+ headers: HttpHeaders;
8
+ data?: {
9
+ [key: string]: unknown;
10
+ };
11
+ };
12
+ response: {
13
+ status: HttpStatusCode;
14
+ headers: HttpHeaders;
15
+ data?: {
16
+ statusText: string;
17
+ errors: ApiError[];
18
+ };
19
+ };
20
+ }
@@ -0,0 +1,7 @@
1
+ import { ApiError } from '../errors/api-error.interface';
2
+ export interface HttpErrorResponseData {
3
+ errors: ApiError[];
4
+ api: {
5
+ ver: string;
6
+ };
7
+ }
@@ -0,0 +1,11 @@
1
+ import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
2
+ import { Router } from '@angular/router';
3
+ import { Observable } from 'rxjs';
4
+ import * as i0 from "@angular/core";
5
+ export declare class HttpExceptionsInterceptor implements HttpInterceptor {
6
+ router: Router;
7
+ constructor(router: Router);
8
+ intercept(req: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>>;
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<HttpExceptionsInterceptor, never>;
10
+ static ɵprov: i0.ɵɵInjectableDeclaration<HttpExceptionsInterceptor>;
11
+ }
@@ -0,0 +1 @@
1
+ export type ExtendedWindow = Window;
@@ -0,0 +1,2 @@
1
+ export declare const defaultApiUrl = "https://secure.xsolla.com/paystation2/api/";
2
+ export declare const sandboxApiUrl = "https://sandbox-secure.xsolla.com/paystation2/api/";
@@ -0,0 +1,14 @@
1
+ import { HttpContext, HttpHeaders, HttpParams } from '@angular/common/http';
2
+ export interface RequestOptions {
3
+ headers?: HttpHeaders | {
4
+ [header: string]: string | string[];
5
+ };
6
+ context?: HttpContext;
7
+ observe?: 'body';
8
+ params?: HttpParams | {
9
+ [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
10
+ };
11
+ reportProgress?: boolean;
12
+ responseType?: 'json';
13
+ withCredentials?: boolean;
14
+ }
@@ -0,0 +1,20 @@
1
+ import { Observable } from 'rxjs';
2
+ import { HttpClient } from '@angular/common/http';
3
+ import { ExtendedWindow } from '../../extended-window.interface';
4
+ import { RequestOptions } from './options.interface';
5
+ import * as i0 from "@angular/core";
6
+ export declare class SecureApiClient {
7
+ private readonly httpClient;
8
+ private readonly window;
9
+ private isSandboxMode;
10
+ constructor(httpClient: HttpClient, window: ExtendedWindow);
11
+ setSandboxMode(isSandboxMode: boolean): void;
12
+ get<T>(url: string, options?: RequestOptions): Observable<T>;
13
+ post<T>(url: string, body: unknown | null, options?: RequestOptions): Observable<T>;
14
+ patch<T>(url: string, body: unknown | null, options?: RequestOptions): Observable<T>;
15
+ put<T>(url: string, body: unknown | null, options?: RequestOptions): Observable<T>;
16
+ delete<T>(url: string, options?: RequestOptions): Observable<T>;
17
+ get baseUrl(): string;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<SecureApiClient, never>;
19
+ static ɵprov: i0.ɵɵInjectableDeclaration<SecureApiClient>;
20
+ }
@@ -0,0 +1,11 @@
1
+ export interface PaymentMethodApi {
2
+ id: number;
3
+ rank: number;
4
+ name: string;
5
+ aliases: string;
6
+ cat: number[];
7
+ is_visible: boolean;
8
+ recommended: 0 | 1;
9
+ enabled_save_account: null | unknown[];
10
+ switch_icon_name: string | null;
11
+ }
@@ -0,0 +1,11 @@
1
+ export interface PaymentMethod {
2
+ id: number;
3
+ rank: number;
4
+ name: string;
5
+ aliases: string;
6
+ categories: number[];
7
+ isVisible: boolean;
8
+ recommended: boolean;
9
+ enabledSaveAccount: null | unknown[];
10
+ iconName: string | null;
11
+ }
@@ -0,0 +1,10 @@
1
+ import { PaymentMethodApi } from './payment-method-api.interface';
2
+ export interface PaymentMethodsApi {
3
+ top: PaymentMethodApi[];
4
+ especial: PaymentMethodApi[];
5
+ remained: PaymentMethodApi[];
6
+ remained_count: {
7
+ total: number;
8
+ visible: number;
9
+ };
10
+ }
@@ -0,0 +1,4 @@
1
+ export interface PaymentMethodsRequestParams {
2
+ access_token: string;
3
+ country: string;
4
+ }
@@ -0,0 +1,13 @@
1
+ import { PaymentMethod } from './payment-method.interface';
2
+ import { PaymentMethodsApi } from './payment-methods-api.interface';
3
+ export declare class PaymentMethodsResponse {
4
+ readonly top: PaymentMethod[];
5
+ readonly especial: PaymentMethod[];
6
+ readonly remained: PaymentMethod[];
7
+ readonly remainedCount: {
8
+ total: number;
9
+ visible: number;
10
+ };
11
+ constructor(paymentMethods: PaymentMethodsApi);
12
+ private mapPaymentMethod;
13
+ }
@@ -0,0 +1,4 @@
1
+ import { PaymentMethodsApi } from './payment-methods-api.interface';
2
+ export interface PaymentMethodsResponseApi {
3
+ payment_methods: PaymentMethodsApi;
4
+ }
@@ -0,0 +1,7 @@
1
+ import { InjectionToken, ValueProvider } from '@angular/core';
2
+ import { PaymentMethodsResponse } from './payment-methods-response.class';
3
+ type ResponseParameters = ConstructorParameters<typeof PaymentMethodsResponse>;
4
+ export type PaymentMethodsResponseFactory = (...args: ResponseParameters) => PaymentMethodsResponse;
5
+ export declare const paymentMethodsResponseFactoryToken: InjectionToken<PaymentMethodsResponseFactory>;
6
+ export declare const paymentMethodsResponseFactoryProvider: ValueProvider;
7
+ export {};
@@ -0,0 +1,20 @@
1
+ import { CountryService } from '../country/country.service';
2
+ import { SecureApiClient } from '../http/secure-api/secure-api.service';
3
+ import { SettingsService } from '../settings/settings.service';
4
+ import { PaymentMethod } from './payment-method.interface';
5
+ import { PaymentMethodsResponseFactory } from './payment-methods-response.token';
6
+ import * as i0 from "@angular/core";
7
+ export declare class PaymentMethodsService {
8
+ private readonly responseFactory;
9
+ private readonly settingsService;
10
+ private readonly countryService;
11
+ private readonly secureApi;
12
+ private readonly apiRoute;
13
+ private readonly cache;
14
+ constructor(responseFactory: PaymentMethodsResponseFactory, settingsService: SettingsService, countryService: CountryService, secureApi: SecureApiClient);
15
+ getList(): Promise<PaymentMethod[]>;
16
+ getQuickMethods(): Promise<PaymentMethod[]>;
17
+ private request;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<PaymentMethodsService, never>;
19
+ static ɵprov: i0.ɵɵInjectableDeclaration<PaymentMethodsService>;
20
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * none (ни один из статусов),
3
+ * done (статус done),
4
+ * final (статусы done, cancel),
5
+ * all (все статусы)
6
+ */
7
+ export declare enum AutoRedirectOnStatus {
8
+ none = "none",
9
+ done = "done",
10
+ final = "final",
11
+ all = "all"
12
+ }
@@ -0,0 +1,4 @@
1
+ export interface Balance {
2
+ amount: number;
3
+ currency: string;
4
+ }
@@ -0,0 +1,10 @@
1
+ import { Offer } from './offer.interface';
2
+ export interface Bonus {
3
+ enabled: boolean;
4
+ name?: string;
5
+ description?: string;
6
+ offers?: readonly Offer[];
7
+ seconds?: number | null;
8
+ has_sales?: boolean;
9
+ label?: string;
10
+ }
@@ -0,0 +1,5 @@
1
+ export interface InitConfiguration {
2
+ token: string;
3
+ isWebview?: boolean;
4
+ sandbox?: boolean;
5
+ }
@@ -0,0 +1,4 @@
1
+ import { AppError } from '../exceptions-handling/errors/app-error.class';
2
+ export declare class EmptyUtilsResponseError extends AppError {
3
+ constructor();
4
+ }
@@ -0,0 +1,4 @@
1
+ export declare enum HeaderType {
2
+ normal = "normal",
3
+ compact = "compact"
4
+ }
@@ -0,0 +1,6 @@
1
+ export interface Offer {
2
+ caption: string;
3
+ offerType: string;
4
+ percent: string;
5
+ pid: number;
6
+ }
@@ -0,0 +1,32 @@
1
+ import { TrackingInfo } from './tracking-info.interface';
2
+ export interface Project {
3
+ id: number;
4
+ returnUrl: string;
5
+ merchantId: number;
6
+ canRepeatPayment: boolean;
7
+ projectUrl: string;
8
+ components: {
9
+ [key: string]: {
10
+ enabled: boolean;
11
+ };
12
+ };
13
+ refundPolicySettings?: {
14
+ policy_type: string;
15
+ policy_version_id: number;
16
+ is_policy_visible: boolean;
17
+ };
18
+ virtualCurrencyName?: string;
19
+ name: string;
20
+ logo: string | null;
21
+ isBabkaChatEnabled?: boolean;
22
+ isBabkaWalletEnabled: boolean;
23
+ isBabkaPayCheckboxEnabled: boolean;
24
+ isBabkaPayBlackListCheckEnabled: boolean;
25
+ payouts: {
26
+ serviceTermsUrl: string;
27
+ isPayoutsMerchant: boolean;
28
+ };
29
+ isMerchantManageSavedMethods?: boolean;
30
+ trackingInfo: TrackingInfo[] | [];
31
+ isSubtotalVisibleByDefault?: boolean;
32
+ }
@@ -0,0 +1,47 @@
1
+ export interface Purchase {
2
+ purchase_type: 'virtual_currency' | 'pay2play' | 'subscription';
3
+ checkout?: {
4
+ amount: number;
5
+ currency: string;
6
+ };
7
+ virtual_items?: {
8
+ currency: string;
9
+ items: Array<{
10
+ amount: number;
11
+ sku: string;
12
+ }>;
13
+ };
14
+ virtual_currency?: {
15
+ quantity: number;
16
+ currency: string;
17
+ };
18
+ subscription?: {
19
+ allow_modify: boolean;
20
+ currency: string;
21
+ description: string;
22
+ external_id: string;
23
+ name: string;
24
+ plan_id: string;
25
+ trial_days: null;
26
+ };
27
+ payment_system?: {
28
+ id: number;
29
+ allow_modify: boolean;
30
+ allow_recurrent: boolean;
31
+ allow_repayment: boolean;
32
+ };
33
+ order?: {
34
+ id: number;
35
+ currency: string;
36
+ lineitems: Array<{
37
+ id: number;
38
+ amount: string;
39
+ price: {
40
+ amount: string;
41
+ };
42
+ quantity: number;
43
+ sku: string;
44
+ tax_category: string;
45
+ }>;
46
+ };
47
+ }
@@ -0,0 +1,3 @@
1
+ export declare enum SettingsMode {
2
+ userAccount = "user_account"
3
+ }
@@ -0,0 +1,45 @@
1
+ import { AutoRedirectOnStatus } from './auto-redirect-on-status';
2
+ import { StatusBackShow } from './status-back-show';
3
+ import { HeaderType } from './header-type.enum';
4
+ import { SettingsMode } from './settings-mode.enum';
5
+ export interface Settings {
6
+ cdnUrl: string;
7
+ apiURL: string;
8
+ currency?: string;
9
+ theme?: string;
10
+ white_label?: boolean;
11
+ payment_system?: number | null;
12
+ version?: string;
13
+ desktop?: {
14
+ header?: {
15
+ is_visible?: boolean;
16
+ visible_logo?: boolean;
17
+ visible_name?: boolean;
18
+ type?: HeaderType;
19
+ close_button?: boolean;
20
+ };
21
+ };
22
+ mobile?: {
23
+ header?: {
24
+ close_button?: boolean;
25
+ };
26
+ };
27
+ mode?: SettingsMode;
28
+ user_account?: {
29
+ payment_accounts?: {
30
+ enable?: boolean;
31
+ };
32
+ };
33
+ disable_saved_methods?: boolean;
34
+ is_independent_windows?: boolean;
35
+ purchase_external_id?: string;
36
+ paystation2: {
37
+ autoredirect_on_status?: AutoRedirectOnStatus;
38
+ autoredirect_on_time?: string;
39
+ status_back_show?: StatusBackShow;
40
+ status_back_link?: string;
41
+ manual_redirection_action?: string;
42
+ };
43
+ is_prevent_external_link_open?: boolean;
44
+ is_payment_methods_list_mode?: boolean;
45
+ }
@@ -0,0 +1,30 @@
1
+ import { SecureApiClient } from '../http/secure-api/secure-api.service';
2
+ import { DeepReadonly } from '../deep-readonly.type';
3
+ import { InitConfiguration } from './configuration.interface';
4
+ import { User } from './user.interface';
5
+ import { Settings } from './settings.interface';
6
+ import { Purchase } from './purchase.interface';
7
+ import { Project } from './project.interface';
8
+ import { UtilsResponse } from './utils-response.interface';
9
+ import * as i0 from "@angular/core";
10
+ export declare class SettingsService {
11
+ private readonly secureApi;
12
+ get project(): DeepReadonly<Project>;
13
+ get purchase(): DeepReadonly<Purchase>;
14
+ get settings(): DeepReadonly<Settings>;
15
+ get user(): DeepReadonly<User>;
16
+ get utilsResponse(): DeepReadonly<UtilsResponse>;
17
+ get isEmpty(): boolean;
18
+ get token(): string;
19
+ get hasResponse(): boolean;
20
+ isInitialized: boolean;
21
+ private response;
22
+ private _token;
23
+ private sandboxMode;
24
+ constructor(secureApi: SecureApiClient);
25
+ init(configuration: InitConfiguration): Promise<void>;
26
+ isSandboxMode(): boolean;
27
+ private sendRequest;
28
+ static ɵfac: i0.ɵɵFactoryDeclaration<SettingsService, never>;
29
+ static ɵprov: i0.ɵɵInjectableDeclaration<SettingsService>;
30
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * none (ни один из статусов),
3
+ * done (статус done),
4
+ * final (статусы done, cancel),
5
+ * virtual_operation (статус оплаты виртуальной валютой)
6
+ * all (все статусы)
7
+ */
8
+ export declare enum StatusBackShow {
9
+ none = "none",
10
+ done = "done",
11
+ final = "final",
12
+ virtual_operation = "virtual_operation",
13
+ all = "all"
14
+ }
@@ -0,0 +1,5 @@
1
+ export interface TrackingInfo {
2
+ projectId: number;
3
+ analyticsSystemName: string;
4
+ trackingId: string;
5
+ }
@@ -0,0 +1,23 @@
1
+ import { Balance } from './balance.interface';
2
+ export interface User {
3
+ requisites: {
4
+ id: string;
5
+ value: string;
6
+ v2: string | null;
7
+ };
8
+ session_id: string;
9
+ country: {
10
+ allow_modify: boolean;
11
+ localized_name: string;
12
+ value: string;
13
+ };
14
+ local: string;
15
+ age: number | null;
16
+ email: {
17
+ value: string;
18
+ } | null;
19
+ uuid: string | null;
20
+ ip: string | null;
21
+ utm_parameters: string | null;
22
+ user_balance: Balance | null;
23
+ }
@@ -0,0 +1,16 @@
1
+ import { Bonus } from './bonus.interface';
2
+ import { Project } from './project.interface';
3
+ import { Purchase } from './purchase.interface';
4
+ import { Settings } from './settings.interface';
5
+ import { User } from './user.interface';
6
+ export interface UtilsResponse {
7
+ project: Project;
8
+ purchase: Purchase;
9
+ settings: Settings;
10
+ user: User;
11
+ purchase_external_id: string | null;
12
+ xsolla_product_tag: string | null;
13
+ experimentGroup: string | null;
14
+ save_payment_account: boolean | null;
15
+ bonus: Bonus | null;
16
+ }
@@ -0,0 +1,3 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import { ExtendedWindow } from './extended-window.interface';
3
+ export declare const windowToken: InjectionToken<ExtendedWindow>;
@@ -1,7 +1,7 @@
1
- import * as i0 from "@angular/core";
2
- import * as i1 from "./core-library.component";
3
- export declare class CoreLibraryModule {
4
- static ɵfac: i0.ɵɵFactoryDeclaration<CoreLibraryModule, never>;
5
- static ɵmod: i0.ɵɵNgModuleDeclaration<CoreLibraryModule, [typeof i1.CoreLibraryComponent], never, [typeof i1.CoreLibraryComponent]>;
6
- static ɵinj: i0.ɵɵInjectorDeclaration<CoreLibraryModule>;
7
- }
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "@angular/common/http";
3
+ export declare class CoreLibraryModule {
4
+ static ɵfac: i0.ɵɵFactoryDeclaration<CoreLibraryModule, never>;
5
+ static ɵmod: i0.ɵɵNgModuleDeclaration<CoreLibraryModule, never, [typeof i1.HttpClientModule], never>;
6
+ static ɵinj: i0.ɵɵInjectorDeclaration<CoreLibraryModule>;
7
+ }
@@ -1,5 +1,20 @@
1
- import * as i0 from "@angular/core";
2
- export declare class CoreLibraryService {
3
- static ɵfac: i0.ɵɵFactoryDeclaration<CoreLibraryService, never>;
4
- static ɵprov: i0.ɵɵInjectableDeclaration<CoreLibraryService>;
5
- }
1
+ import { InitConfiguration } from './core/settings/configuration.interface';
2
+ import { SettingsService } from './core/settings/settings.service';
3
+ import { CountryService } from './core/country/country.service';
4
+ import { PaymentMethodsService } from './core/payment-methods/payment-methods.service';
5
+ import { PaymentMethod } from './core/payment-methods/payment-method.interface';
6
+ import * as i0 from "@angular/core";
7
+ export declare class CoreLibraryService {
8
+ private readonly settingsService;
9
+ private readonly countryService;
10
+ private readonly paymentMethodsService;
11
+ paymentMethods: {
12
+ getList: () => Promise<PaymentMethod[]>;
13
+ getQuickMethods: () => Promise<PaymentMethod[]>;
14
+ };
15
+ constructor(settingsService: SettingsService, countryService: CountryService, paymentMethodsService: PaymentMethodsService);
16
+ init(configuration: InitConfiguration): Promise<void>;
17
+ setCountry(country: string): void;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<CoreLibraryService, never>;
19
+ static ɵprov: i0.ɵɵInjectableDeclaration<CoreLibraryService>;
20
+ }
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@xsolla/payment-client-core",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "peerDependencies": {
5
- "@angular/common": "^15.2.7",
6
- "@angular/core": "^15.2.7"
5
+ "@angular/common": "^15.2.6",
6
+ "@angular/core": "^15.2.6",
7
+ "@angular/platform-browser-dynamic": "^15.2.6"
7
8
  },
8
9
  "dependencies": {
9
10
  "tslib": "^2.3.0"
package/public-api.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- export * from './lib/core-library.service';
2
- export * from './lib/core-library.component';
3
- export * from './lib/core-library.module';
1
+ export * from './lib/core-library.service';
2
+ export * from './lib/core-library.module';
@@ -1,11 +0,0 @@
1
- import { Component } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- export class CoreLibraryComponent {
4
- }
5
- CoreLibraryComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CoreLibraryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
6
- CoreLibraryComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: CoreLibraryComponent, selector: "x-payment-client-core", ngImport: i0, template: ` <p>core-library works!</p> `, isInline: true });
7
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CoreLibraryComponent, decorators: [{
8
- type: Component,
9
- args: [{ selector: 'x-payment-client-core', template: ` <p>core-library works!</p> ` }]
10
- }] });
11
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29yZS1saWJyYXJ5LmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3BhY2thZ2VzL3BheW1lbnQtY2xpZW50LWNvcmUvc3JjL2xpYi9jb3JlLWxpYnJhcnkuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxlQUFlLENBQUM7O0FBTzFDLE1BQU0sT0FBTyxvQkFBb0I7O2lIQUFwQixvQkFBb0I7cUdBQXBCLG9CQUFvQiw2REFIckIsOEJBQThCOzJGQUc3QixvQkFBb0I7a0JBTGhDLFNBQVM7K0JBQ0UsdUJBQXVCLFlBQ3ZCLDhCQUE4QiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IENvbXBvbmVudCB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuXG5AQ29tcG9uZW50KHtcbiAgc2VsZWN0b3I6ICd4LXBheW1lbnQtY2xpZW50LWNvcmUnLFxuICB0ZW1wbGF0ZTogYCA8cD5jb3JlLWxpYnJhcnkgd29ya3MhPC9wPiBgLFxuICBzdHlsZXM6IFtdLFxufSlcbmV4cG9ydCBjbGFzcyBDb3JlTGlicmFyeUNvbXBvbmVudCB7fVxuIl19
@@ -1,5 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- export declare class CoreLibraryComponent {
3
- static ɵfac: i0.ɵɵFactoryDeclaration<CoreLibraryComponent, never>;
4
- static ɵcmp: i0.ɵɵComponentDeclaration<CoreLibraryComponent, "x-payment-client-core", never, {}, {}, never, never, false, never>;
5
- }