@xsolla/payment-client-core 0.0.3 → 0.0.5

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 (177) hide show
  1. package/esm2020/lib/core/device-finger-print/device-finger-print-components.interface.mjs +2 -0
  2. package/esm2020/lib/core/device-finger-print/device-finger-print.service.mjs +167 -0
  3. package/esm2020/lib/core/device-finger-print/fingerprint-js.interface.mjs +2 -0
  4. package/esm2020/lib/core/device-finger-print/hash.type.mjs +2 -0
  5. package/esm2020/lib/core/exceptions-handling/errors/default-terminal-error.class.mjs +8 -0
  6. package/esm2020/lib/core/exceptions-handling/errors/terminal-error.class.mjs +8 -0
  7. package/esm2020/lib/core/exceptions-handling/errors/token-error.class.mjs +7 -0
  8. package/esm2020/lib/core/legal/disclaimer.service.mjs +16 -0
  9. package/esm2020/lib/core/legal/legal.component.config.mjs +2 -0
  10. package/esm2020/lib/core/legal/legal.service.mjs +39 -0
  11. package/esm2020/lib/core/legal/refund-policy.service.mjs +30 -0
  12. package/esm2020/lib/core/legal/secure-connection.service.mjs +31 -0
  13. package/esm2020/lib/core/payment/actions/action-factory-value.interface.mjs +2 -0
  14. package/esm2020/lib/core/payment/actions/action-type-command.map.mjs +5 -0
  15. package/esm2020/lib/core/payment/actions/action.interface.mjs +2 -0
  16. package/esm2020/lib/core/payment/actions/check-status/check-status.action.type.mjs +2 -0
  17. package/esm2020/lib/core/payment/actions/next-action.interface.mjs +2 -0
  18. package/esm2020/lib/core/payment/actions/next-action.service.mjs +47 -0
  19. package/esm2020/lib/core/payment/actions/next-actions.mjs +5 -0
  20. package/esm2020/lib/core/payment/actions/show-fields/show-fields.action.class.mjs +16 -0
  21. package/esm2020/lib/core/payment/actions/show-fields/show-fields.action.token.mjs +11 -0
  22. package/esm2020/lib/core/payment/actions/show-fields/show-fields.action.type.mjs +2 -0
  23. package/esm2020/lib/core/payment/checkout-item.interface.mjs +2 -0
  24. package/esm2020/lib/core/payment/field-names.enum.mjs +64 -0
  25. package/esm2020/lib/core/payment/field.interface.mjs +2 -0
  26. package/esm2020/lib/core/payment/finance-details.interface.mjs +2 -0
  27. package/esm2020/lib/core/payment/form/common-control-config.interface.mjs +2 -0
  28. package/esm2020/lib/core/payment/form/controls/control-config.mjs +6 -0
  29. package/esm2020/lib/core/payment/form/controls/control-config.service.mjs +39 -0
  30. package/esm2020/lib/core/payment/form/controls/control-type.type.mjs +2 -0
  31. package/esm2020/lib/core/payment/form/controls/text-control.config.mjs +8 -0
  32. package/esm2020/lib/core/payment/form/converters/converter.abstract.mjs +75 -0
  33. package/esm2020/lib/core/payment/form/converters/converters-map.interface.mjs +2 -0
  34. package/esm2020/lib/core/payment/form/converters/converters-map.mjs +9 -0
  35. package/esm2020/lib/core/payment/form/converters/email.converter.mjs +29 -0
  36. package/esm2020/lib/core/payment/form/converters/zip.converter.mjs +64 -0
  37. package/esm2020/lib/core/payment/form/form-state.interface.mjs +2 -0
  38. package/esm2020/lib/core/payment/form/form.module.mjs +33 -0
  39. package/esm2020/lib/core/payment/form/form.service.mjs +28 -0
  40. package/esm2020/lib/core/payment/form/validators/convert.function.mjs +22 -0
  41. package/esm2020/lib/core/payment/form/validators/email-validator.mjs +7 -0
  42. package/esm2020/lib/core/payment/form/validators/required-validator.mjs +6 -0
  43. package/esm2020/lib/core/payment/form/validators/restricted-value.validator.mjs +6 -0
  44. package/esm2020/lib/core/payment/form/validators/validation-error.interface.mjs +2 -0
  45. package/esm2020/lib/core/payment/form/validators/validation-errors.interface.mjs +2 -0
  46. package/esm2020/lib/core/payment/form/validators/validator-fn.type.mjs +2 -0
  47. package/esm2020/lib/core/payment/initialize/initialize-request-params.interface.mjs +2 -0
  48. package/esm2020/lib/core/payment/initialize/initialize-response.class.mjs +43 -0
  49. package/esm2020/lib/core/payment/initialize/initialize-response.token.mjs +8 -0
  50. package/esm2020/lib/core/payment/initialize/initialize.service.mjs +46 -0
  51. package/esm2020/lib/core/payment/invoice.interface.mjs +2 -0
  52. package/esm2020/lib/core/payment/payment-config.interface.mjs +2 -0
  53. package/esm2020/lib/core/payment/payment-form.interface.mjs +2 -0
  54. package/esm2020/lib/core/payment/payment.interface.mjs +2 -0
  55. package/esm2020/lib/core/payment/payment.service.mjs +58 -0
  56. package/esm2020/lib/core/payment/status/finance-info-field.interface.mjs +2 -0
  57. package/esm2020/lib/core/payment/status/line-item.interface.mjs +2 -0
  58. package/esm2020/lib/core/payment/status/status.enum.mjs +12 -0
  59. package/esm2020/lib/core/payment/status/status.interface.mjs +2 -0
  60. package/esm2020/lib/core/payment/status/title-class.enum.mjs +7 -0
  61. package/esm2020/lib/core/payment/status/web-socket-client-type.enum.mjs +6 -0
  62. package/esm2020/lib/core/payment/submit/request/submit-request.class.mjs +16 -0
  63. package/esm2020/lib/core/payment/submit/request/submit-request.token.mjs +8 -0
  64. package/esm2020/lib/core/payment/submit/response/submit-response.class.mjs +31 -0
  65. package/esm2020/lib/core/payment/submit/response/submit-response.token.mjs +8 -0
  66. package/esm2020/lib/core/payment/submit/submit.service.mjs +59 -0
  67. package/esm2020/lib/core/payment/sync/field-sync-state.interface.mjs +2 -0
  68. package/esm2020/lib/core/payment/sync/sync-request.class.mjs +31 -0
  69. package/esm2020/lib/core/payment/sync/sync-request.token.mjs +8 -0
  70. package/esm2020/lib/core/payment/sync/sync-response.class.mjs +14 -0
  71. package/esm2020/lib/core/payment/sync/sync-response.token.mjs +8 -0
  72. package/esm2020/lib/core/payment/sync/sync.service.mjs +91 -0
  73. package/esm2020/lib/core/payment/virtual-currency.interface.mjs +2 -0
  74. package/esm2020/lib/core/payment/xps-api-part-request.abstract.mjs +8 -0
  75. package/esm2020/lib/core/payment/xps-comand.enum.mjs +10 -0
  76. package/esm2020/lib/core/payment/xps-error.interface.mjs +2 -0
  77. package/esm2020/lib/core/payment/xps-message.interface.mjs +2 -0
  78. package/esm2020/lib/core/payment/xps-request.abstract.mjs +8 -0
  79. package/esm2020/lib/core/payment/xps-response.interface.mjs +2 -0
  80. package/esm2020/lib/core/payment/xps-subscription-item.interface.mjs +2 -0
  81. package/esm2020/lib/core/saved-methods/saved-methods.service.mjs +5 -7
  82. package/esm2020/lib/core/xps-boolean.enum.mjs +2 -0
  83. package/esm2020/lib/core-library.module.mjs +31 -4
  84. package/esm2020/lib/core-library.service.mjs +27 -5
  85. package/esm2020/public-api.mjs +2 -1
  86. package/fesm2015/xsolla-payment-client-core.mjs +1214 -11
  87. package/fesm2015/xsolla-payment-client-core.mjs.map +1 -1
  88. package/fesm2020/xsolla-payment-client-core.mjs +1165 -11
  89. package/fesm2020/xsolla-payment-client-core.mjs.map +1 -1
  90. package/lib/core/device-finger-print/device-finger-print-components.interface.d.ts +4 -0
  91. package/lib/core/device-finger-print/device-finger-print.service.d.ts +44 -0
  92. package/lib/core/device-finger-print/fingerprint-js.interface.d.ts +6 -0
  93. package/lib/core/device-finger-print/hash.type.d.ts +3 -0
  94. package/lib/core/exceptions-handling/errors/default-terminal-error.class.d.ts +4 -0
  95. package/lib/core/exceptions-handling/errors/terminal-error.class.d.ts +5 -0
  96. package/lib/core/exceptions-handling/errors/token-error.class.d.ts +4 -0
  97. package/lib/core/legal/disclaimer.service.d.ts +6 -0
  98. package/lib/core/legal/legal.component.config.d.ts +10 -0
  99. package/lib/core/legal/legal.service.d.ts +18 -0
  100. package/lib/core/legal/refund-policy.service.d.ts +11 -0
  101. package/lib/core/legal/secure-connection.service.d.ts +13 -0
  102. package/lib/core/payment/actions/action-factory-value.interface.d.ts +5 -0
  103. package/lib/core/payment/actions/action-type-command.map.d.ts +4 -0
  104. package/lib/core/payment/actions/action.interface.d.ts +4 -0
  105. package/lib/core/payment/actions/check-status/check-status.action.type.d.ts +12 -0
  106. package/lib/core/payment/actions/next-action.interface.d.ts +3 -0
  107. package/lib/core/payment/actions/next-action.service.d.ts +16 -0
  108. package/lib/core/payment/actions/next-actions.d.ts +5 -0
  109. package/lib/core/payment/actions/show-fields/show-fields.action.class.d.ts +8 -0
  110. package/lib/core/payment/actions/show-fields/show-fields.action.token.d.ts +4 -0
  111. package/lib/core/payment/actions/show-fields/show-fields.action.type.d.ts +12 -0
  112. package/lib/core/payment/checkout-item.interface.d.ts +11 -0
  113. package/lib/core/payment/field-names.enum.d.ts +62 -0
  114. package/lib/core/payment/field.interface.d.ts +26 -0
  115. package/lib/core/payment/finance-details.interface.d.ts +2 -0
  116. package/lib/core/payment/form/common-control-config.interface.d.ts +9 -0
  117. package/lib/core/payment/form/controls/control-config.d.ts +9 -0
  118. package/lib/core/payment/form/controls/control-config.service.d.ts +15 -0
  119. package/lib/core/payment/form/controls/control-type.type.d.ts +1 -0
  120. package/lib/core/payment/form/controls/text-control.config.d.ts +11 -0
  121. package/lib/core/payment/form/converters/converter.abstract.d.ts +23 -0
  122. package/lib/core/payment/form/converters/converters-map.d.ts +4 -0
  123. package/lib/core/payment/form/converters/converters-map.interface.d.ts +5 -0
  124. package/lib/core/payment/form/converters/email.converter.d.ts +14 -0
  125. package/lib/core/payment/form/converters/zip.converter.d.ts +21 -0
  126. package/lib/core/payment/form/form-state.interface.d.ts +3 -0
  127. package/lib/core/payment/form/form.module.d.ts +7 -0
  128. package/lib/core/payment/form/form.service.d.ts +12 -0
  129. package/lib/core/payment/form/validators/convert.function.d.ts +3 -0
  130. package/lib/core/payment/form/validators/email-validator.d.ts +2 -0
  131. package/lib/core/payment/form/validators/required-validator.d.ts +2 -0
  132. package/lib/core/payment/form/validators/restricted-value.validator.d.ts +2 -0
  133. package/lib/core/payment/form/validators/validation-error.interface.d.ts +4 -0
  134. package/lib/core/payment/form/validators/validation-errors.interface.d.ts +4 -0
  135. package/lib/core/payment/form/validators/validator-fn.type.d.ts +3 -0
  136. package/lib/core/payment/initialize/initialize-request-params.interface.d.ts +6 -0
  137. package/lib/core/payment/initialize/initialize-response.class.d.ts +7 -0
  138. package/lib/core/payment/initialize/initialize-response.token.d.ts +6 -0
  139. package/lib/core/payment/initialize/initialize.service.d.ts +18 -0
  140. package/lib/core/payment/invoice.interface.d.ts +14 -0
  141. package/lib/core/payment/payment-config.interface.d.ts +5 -0
  142. package/lib/core/payment/payment-form.interface.d.ts +39 -0
  143. package/lib/core/payment/payment.interface.d.ts +15 -0
  144. package/lib/core/payment/payment.service.d.ts +33 -0
  145. package/lib/core/payment/status/finance-info-field.interface.d.ts +5 -0
  146. package/lib/core/payment/status/line-item.interface.d.ts +8 -0
  147. package/lib/core/payment/status/status.enum.d.ts +10 -0
  148. package/lib/core/payment/status/status.interface.d.ts +63 -0
  149. package/lib/core/payment/status/title-class.enum.d.ts +5 -0
  150. package/lib/core/payment/status/web-socket-client-type.enum.d.ts +4 -0
  151. package/lib/core/payment/submit/request/submit-request.class.d.ts +13 -0
  152. package/lib/core/payment/submit/request/submit-request.token.d.ts +6 -0
  153. package/lib/core/payment/submit/response/submit-response.class.d.ts +26 -0
  154. package/lib/core/payment/submit/response/submit-response.token.d.ts +6 -0
  155. package/lib/core/payment/submit/submit.service.d.ts +21 -0
  156. package/lib/core/payment/sync/field-sync-state.interface.d.ts +5 -0
  157. package/lib/core/payment/sync/sync-request.class.d.ts +15 -0
  158. package/lib/core/payment/sync/sync-request.token.d.ts +6 -0
  159. package/lib/core/payment/sync/sync-response.class.d.ts +11 -0
  160. package/lib/core/payment/sync/sync-response.token.d.ts +6 -0
  161. package/lib/core/payment/sync/sync.service.d.ts +27 -0
  162. package/lib/core/payment/virtual-currency.interface.d.ts +10 -0
  163. package/lib/core/payment/xps-api-part-request.abstract.d.ts +6 -0
  164. package/lib/core/payment/xps-comand.enum.d.ts +8 -0
  165. package/lib/core/payment/xps-error.interface.d.ts +7 -0
  166. package/lib/core/payment/xps-message.interface.d.ts +4 -0
  167. package/lib/core/payment/xps-request.abstract.d.ts +6 -0
  168. package/lib/core/payment/xps-response.interface.d.ts +261 -0
  169. package/lib/core/payment/xps-subscription-item.interface.d.ts +20 -0
  170. package/lib/core/saved-methods/saved-methods.service.d.ts +1 -3
  171. package/lib/core/xps-boolean.enum.d.ts +4 -0
  172. package/lib/core-library.module.d.ts +2 -1
  173. package/lib/core-library.service.d.ts +12 -1
  174. package/package.json +1 -1
  175. package/public-api.d.ts +1 -0
  176. package/xsolla-payment-client-core-0.0.5.tgz +0 -0
  177. package/xsolla-payment-client-core-0.0.3.tgz +0 -0
@@ -0,0 +1,63 @@
1
+ import { FinanceInfoField } from './finance-info-field.interface';
2
+ import { LineItem } from './line-item.interface';
3
+ import { StatusEnum } from './status.enum';
4
+ import { TitleClass } from './title-class.enum';
5
+ import { WebSocketClientType } from './web-socket-client-type.enum';
6
+ export interface Status {
7
+ postMessageStatus: string;
8
+ virtualCurrencyAmount: number;
9
+ statusState: StatusEnum;
10
+ email: string;
11
+ webSocketUrl: string;
12
+ webSocketChannelName: string;
13
+ webSocketClientType: WebSocketClientType;
14
+ financeInfo: {
15
+ [key: string]: FinanceInfoField;
16
+ };
17
+ isCancelUser: boolean;
18
+ backUrlSettings: {
19
+ backUrl: string;
20
+ backUrlAction?: string;
21
+ backUrlCaption: string;
22
+ returnRegion: string;
23
+ showBackButton?: boolean;
24
+ };
25
+ additionalBackButton: {
26
+ link: string;
27
+ action: string;
28
+ label: string;
29
+ region: string;
30
+ isEnabled: boolean;
31
+ };
32
+ group: string;
33
+ needToCheck: boolean;
34
+ autoRedirect?: {
35
+ time: number;
36
+ };
37
+ userReturnStatus?: string;
38
+ statusMessage: string;
39
+ discount: number | null;
40
+ userId?: string;
41
+ invoice?: number;
42
+ pid?: number;
43
+ projectAmount?: {
44
+ amount: string;
45
+ currency: string;
46
+ };
47
+ titleClass: TitleClass;
48
+ isSuccess?: boolean;
49
+ isCanceled?: boolean;
50
+ babkaLink: string;
51
+ paymentCountryIso: string;
52
+ order?: {
53
+ lineitems?: LineItem[];
54
+ shipping?: {
55
+ currency: string;
56
+ amount: number;
57
+ };
58
+ contained_taxes?: {
59
+ sales_tax?: boolean;
60
+ user_vat?: boolean;
61
+ };
62
+ };
63
+ }
@@ -0,0 +1,5 @@
1
+ export declare enum TitleClass {
2
+ done = "done",
3
+ cancel = "cancel",
4
+ cancelUser = "canceluser"
5
+ }
@@ -0,0 +1,4 @@
1
+ export declare enum WebSocketClientType {
2
+ nchan = "nchan",
3
+ centrifugo = "centrifugo"
4
+ }
@@ -0,0 +1,13 @@
1
+ import { Field } from '../../field.interface';
2
+ import { UntypedFormGroup } from '@angular/forms';
3
+ import { XpsApiPartRequest } from '../../xps-api-part-request.abstract';
4
+ export declare class SubmitRequest extends XpsApiPartRequest {
5
+ readonly access_token: string;
6
+ readonly xps_dfp_hash?: string;
7
+ constructor(parameters: {
8
+ token: string | null;
9
+ fields: Field[];
10
+ form: UntypedFormGroup;
11
+ dfpHash: string | null;
12
+ });
13
+ }
@@ -0,0 +1,6 @@
1
+ import { InjectionToken, ValueProvider } from '@angular/core';
2
+ import { SubmitRequest } from './submit-request.class';
3
+ export type SubmitRequestParameters = ConstructorParameters<typeof SubmitRequest>;
4
+ export type SubmitRequestFactory = (...args: SubmitRequestParameters) => SubmitRequest;
5
+ export declare const submitRequestFactoryToken: InjectionToken<SubmitRequestFactory>;
6
+ export declare const submitRequestFactoryProvider: ValueProvider;
@@ -0,0 +1,26 @@
1
+ import { XpsResponse } from '../../xps-response.interface';
2
+ import { Field } from '../../field.interface';
3
+ import { Invoice } from '../../invoice.interface';
4
+ import { XpsCommand } from '../../xps-comand.enum';
5
+ export declare class SubmitResponse {
6
+ readonly responseNumber: number;
7
+ readonly parameters: XpsResponse;
8
+ readonly fields: Field[];
9
+ onlineBanking?: {
10
+ url: string;
11
+ };
12
+ readonly data?: unknown;
13
+ isNeedRedirect: boolean;
14
+ buyData: XpsResponse['buyData'];
15
+ signature?: string;
16
+ fixInvoice?: string;
17
+ hasFatalErrors?: boolean;
18
+ userSession?: Invoice;
19
+ pid: XpsResponse['pid'];
20
+ errors: XpsResponse['errors'];
21
+ summary: XpsResponse['summary'];
22
+ title: string;
23
+ currentCommand: XpsCommand | null;
24
+ messages: XpsResponse['messages'];
25
+ constructor(parameters: XpsResponse, responseNumber?: number);
26
+ }
@@ -0,0 +1,6 @@
1
+ import { InjectionToken, ValueProvider } from '@angular/core';
2
+ import { SubmitResponse } from './submit-response.class';
3
+ export type SubmitResponseParameters = ConstructorParameters<typeof SubmitResponse>;
4
+ export type SubmitResponseFactory = (...args: SubmitResponseParameters) => SubmitResponse;
5
+ export declare const submitResponseFactoryToken: InjectionToken<SubmitResponseFactory>;
6
+ export declare const submitResponseFactoryProvider: ValueProvider;
@@ -0,0 +1,21 @@
1
+ import { Field } from '../field.interface';
2
+ import { SubmitRequestFactory } from './request/submit-request.token';
3
+ import { SubmitResponseFactory } from './response/submit-response.token';
4
+ import { SettingsService } from '../../settings/settings.service';
5
+ import { SubmitResponse } from './response/submit-response.class';
6
+ import { UntypedFormGroup } from '@angular/forms';
7
+ import { DeviceFingerPrintService } from '../../device-finger-print/device-finger-print.service';
8
+ import { SecureApiClient } from '../../http/secure-api/secure-api.service';
9
+ import * as i0 from "@angular/core";
10
+ export declare class SubmitService {
11
+ private readonly requestFactory;
12
+ private readonly responseFactory;
13
+ private readonly settingsService;
14
+ private readonly deviceFingerPrintService;
15
+ private readonly secureApi;
16
+ private readonly directPaymentApiRoute;
17
+ constructor(requestFactory: SubmitRequestFactory, responseFactory: SubmitResponseFactory, settingsService: SettingsService, deviceFingerPrintService: DeviceFingerPrintService, secureApi: SecureApiClient);
18
+ request(fields: Field[], form: UntypedFormGroup): Promise<SubmitResponse>;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<SubmitService, never>;
20
+ static ɵprov: i0.ɵɵInjectableDeclaration<SubmitService>;
21
+ }
@@ -0,0 +1,5 @@
1
+ import { ValidationErrors } from '@angular/forms';
2
+ export interface FieldSyncState {
3
+ value: unknown;
4
+ result: Promise<ValidationErrors | null>;
5
+ }
@@ -0,0 +1,15 @@
1
+ import { UntypedFormGroup } from '@angular/forms';
2
+ import { Field } from '../field.interface';
3
+ import { XpsRequest } from '../xps-request.abstract';
4
+ export declare class SyncRequest extends XpsRequest {
5
+ readonly access_token: string;
6
+ readonly xps_fix_command = "calculate";
7
+ constructor(parameters: {
8
+ token: string;
9
+ changedField: Field;
10
+ fields: Field[];
11
+ form: UntypedFormGroup;
12
+ });
13
+ private getFieldsValues;
14
+ private getFieldsMap;
15
+ }
@@ -0,0 +1,6 @@
1
+ import { InjectionToken, ValueProvider } from '@angular/core';
2
+ import { SyncRequest } from './sync-request.class';
3
+ export type SyncRequestParameters = ConstructorParameters<typeof SyncRequest>;
4
+ export type SyncRequestFactory = (...args: SyncRequestParameters) => SyncRequest;
5
+ export declare const syncRequestFactoryToken: InjectionToken<SyncRequestFactory>;
6
+ export declare const syncRequestFactoryProvider: ValueProvider;
@@ -0,0 +1,11 @@
1
+ import { Field } from '../field.interface';
2
+ import { XpsResponse } from '../xps-response.interface';
3
+ export declare class SyncResponse {
4
+ readonly rewritableError?: {
5
+ code: number;
6
+ message: string;
7
+ };
8
+ readonly fields: Field[];
9
+ readonly parameters: XpsResponse;
10
+ constructor(changedField: Field, response: XpsResponse);
11
+ }
@@ -0,0 +1,6 @@
1
+ import { InjectionToken, ValueProvider } from '@angular/core';
2
+ import { SyncResponse } from './sync-response.class';
3
+ export type SyncResponseParameters = ConstructorParameters<typeof SyncResponse>;
4
+ export type SyncResponseFactory = (...args: SyncResponseParameters) => SyncResponse;
5
+ export declare const syncResponseFactoryToken: InjectionToken<SyncResponseFactory>;
6
+ export declare const syncResponseFactoryProvider: ValueProvider;
@@ -0,0 +1,27 @@
1
+ import { UntypedFormGroup, ValidationErrors } from '@angular/forms';
2
+ import { SecureApiClient } from '../../http/secure-api/secure-api.service';
3
+ import { SettingsService } from '../../settings/settings.service';
4
+ import { Field } from '../field.interface';
5
+ import { SyncRequestFactory } from './sync-request.token';
6
+ import { SyncResponseFactory } from './sync-response.token';
7
+ import * as i0 from "@angular/core";
8
+ export declare class SyncService {
9
+ private readonly requestFactory;
10
+ private readonly responseFactory;
11
+ private readonly secureApi;
12
+ private readonly settingsService;
13
+ private readonly apiRoute;
14
+ private prevFieldSyncStates;
15
+ private form;
16
+ private fields;
17
+ constructor(requestFactory: SyncRequestFactory, responseFactory: SyncResponseFactory, secureApi: SecureApiClient, settingsService: SettingsService);
18
+ setup(form: UntypedFormGroup, fields: Field[]): void;
19
+ reset(): void;
20
+ validate(field: Field): Promise<ValidationErrors | null>;
21
+ private request;
22
+ private isReadyField;
23
+ private getPrevFieldSyncState;
24
+ private setPrevFieldSyncState;
25
+ static ɵfac: i0.ɵɵFactoryDeclaration<SyncService, never>;
26
+ static ɵprov: i0.ɵɵInjectableDeclaration<SyncService>;
27
+ }
@@ -0,0 +1,10 @@
1
+ export interface VirtualCurrency {
2
+ quantity: number;
3
+ amount: number | null;
4
+ name: string;
5
+ image_url: string;
6
+ description: string;
7
+ longDescription: string | null;
8
+ is_bonus: boolean;
9
+ currency: string;
10
+ }
@@ -0,0 +1,6 @@
1
+ export declare abstract class XpsApiPartRequest {
2
+ [fieldName: `xps_${string}`]: unknown;
3
+ protected addXpsParameters(parameters: {
4
+ [key: string]: unknown;
5
+ }): void;
6
+ }
@@ -0,0 +1,8 @@
1
+ export declare enum XpsCommand {
2
+ form = "form",
3
+ check = "check",
4
+ status = "status",
5
+ checkout = "checkout",
6
+ account = "account",
7
+ create = "create"
8
+ }
@@ -0,0 +1,7 @@
1
+ import { PaymentMethodApi } from '../payment-methods/payment-method-api.interface';
2
+ export interface XpsError {
3
+ code: number;
4
+ message: string;
5
+ element_name?: string;
6
+ alternative_instances?: PaymentMethodApi[];
7
+ }
@@ -0,0 +1,4 @@
1
+ export interface XpsMessage {
2
+ code: string;
3
+ message: string;
4
+ }
@@ -0,0 +1,6 @@
1
+ export declare abstract class XpsRequest {
2
+ [fieldName: `xps_${string}`]: unknown;
3
+ protected addXpsParameters(parameters: {
4
+ [key: string]: unknown;
5
+ }): void;
6
+ }
@@ -0,0 +1,261 @@
1
+ import { XpsBoolean } from '../xps-boolean.enum';
2
+ import { CheckoutItem } from './checkout-item.interface';
3
+ import { Field } from './field.interface';
4
+ import { Invoice } from './invoice.interface';
5
+ import { LineItem } from './status/line-item.interface';
6
+ import { StatusEnum } from './status/status.enum';
7
+ import { TitleClass } from './status/title-class.enum';
8
+ import { WebSocketClientType } from './status/web-socket-client-type.enum';
9
+ import { VirtualCurrency } from './virtual-currency.interface';
10
+ import { XpsCommand } from './xps-comand.enum';
11
+ import { XpsError } from './xps-error.interface';
12
+ import { XpsMessage } from './xps-message.interface';
13
+ import { XpsSubscriptionItem } from './xps-subscription-item.interface';
14
+ export interface XpsResponse {
15
+ checkout: {
16
+ action: string;
17
+ method: string;
18
+ data: {
19
+ [key: string]: string;
20
+ };
21
+ };
22
+ summary: {
23
+ purchase: {
24
+ virtual_currency?: VirtualCurrency[];
25
+ checkout_items?: CheckoutItem[];
26
+ virtual_items?: VirtualCurrency[];
27
+ subscriptions?: XpsSubscriptionItem[];
28
+ checkout?: {
29
+ amount: number;
30
+ currency: string;
31
+ description: string;
32
+ is_bonus?: boolean;
33
+ };
34
+ };
35
+ finance: {
36
+ payment_country: {
37
+ iso: string;
38
+ };
39
+ sub_total: {
40
+ amount: number;
41
+ currency: string;
42
+ payment_amount: number;
43
+ payment_currency: string;
44
+ };
45
+ discount: {
46
+ amount: number;
47
+ currency: string;
48
+ };
49
+ vat_user?: {
50
+ amount: number;
51
+ percent: number;
52
+ currency: string;
53
+ visible: boolean;
54
+ };
55
+ sales_tax: {
56
+ amount: number;
57
+ percent: number;
58
+ currency: string;
59
+ };
60
+ sales_tax_user?: {
61
+ amount: number;
62
+ percent: number;
63
+ currency: string;
64
+ };
65
+ fee: {
66
+ amount: number;
67
+ currency: string;
68
+ };
69
+ total: {
70
+ amount: number;
71
+ currency: string;
72
+ };
73
+ xsolla_credits?: {
74
+ payment_amount: number;
75
+ payment_currency: string;
76
+ };
77
+ vat: {
78
+ amount: number;
79
+ percent: number;
80
+ currency: string;
81
+ visible: boolean;
82
+ };
83
+ user_balance?: {
84
+ amount: number;
85
+ currency: string;
86
+ };
87
+ grand_total?: {
88
+ amount: number;
89
+ currency: string;
90
+ };
91
+ };
92
+ };
93
+ buyData: {
94
+ currency: string;
95
+ enabled: boolean;
96
+ example: null | unknown;
97
+ isMandatory: null | boolean;
98
+ isPakets: null | boolean;
99
+ isReadonly: null | boolean;
100
+ isVisible: XpsBoolean;
101
+ label_hint: null | string;
102
+ name: string;
103
+ options: null | unknown[];
104
+ regex: null | unknown;
105
+ sum: string;
106
+ title: null | string;
107
+ tooltip: null | string;
108
+ type: 'submit' | string;
109
+ validation_error_msg: null | string;
110
+ value: string;
111
+ };
112
+ accountXsolla: string;
113
+ public_id: string;
114
+ form: {
115
+ [key: string]: Field;
116
+ };
117
+ taxDisclaimer: string | null;
118
+ number: number;
119
+ barcode: unknown;
120
+ offers: unknown;
121
+ instruction: string;
122
+ errors: XpsError[] | null;
123
+ restrictions: unknown;
124
+ info: string;
125
+ pid: number;
126
+ project: {
127
+ id: number;
128
+ isMerchant: boolean;
129
+ isUnknownPrice: number;
130
+ name: string;
131
+ };
132
+ error?: {
133
+ fields: {
134
+ [key: string]: string;
135
+ };
136
+ };
137
+ invoiceCreated: XpsBoolean;
138
+ messages?: XpsMessage[];
139
+ status?: StatusEnum | XpsStatus | null;
140
+ final?: boolean;
141
+ elapsedTime?: number;
142
+ group?: string;
143
+ is_payment_account_attached?: boolean;
144
+ is_partial_pay?: boolean;
145
+ country?: {
146
+ iso: string;
147
+ };
148
+ userSession?: Invoice;
149
+ currentCommand: XpsCommand;
150
+ title: string;
151
+ onlineBanking?: {
152
+ value: string;
153
+ };
154
+ threeDSForm: {
155
+ threeDSTrXid: string;
156
+ threeDSMethod: string;
157
+ threeDSMethodData: string;
158
+ webSocketChannelUrl: string;
159
+ webSocketChannelName: string;
160
+ webSocketClientType: WebSocketClientType;
161
+ statusUrl: string;
162
+ waitCallback: boolean;
163
+ } | null;
164
+ skipForm: boolean;
165
+ skipCheckout: boolean;
166
+ isMap: boolean;
167
+ isCheckout: boolean;
168
+ categories: number[];
169
+ textAll?: {
170
+ fatal: boolean;
171
+ };
172
+ }
173
+ export interface XpsStatus {
174
+ is_partial_pay: boolean;
175
+ marketplace: string;
176
+ autoredirect?: {
177
+ time: number;
178
+ };
179
+ statusData: {
180
+ project: number;
181
+ pid: number;
182
+ out: number;
183
+ payment_country_iso: string;
184
+ v1: string;
185
+ v2: string;
186
+ v3: string;
187
+ invoice: number;
188
+ email: string;
189
+ state: number;
190
+ stateText: StatusEnum;
191
+ statusPs: number;
192
+ key: string;
193
+ webSocketChannelUrl: string;
194
+ webSocketChannelName: string;
195
+ webSocketClientType: WebSocketClientType;
196
+ projectAmount: string;
197
+ recurrentId?: number;
198
+ };
199
+ gshare_banner_enabled: boolean;
200
+ invoice: number;
201
+ repayment?: null[] | null;
202
+ email?: null[] | null;
203
+ group: string;
204
+ sharing?: unknown;
205
+ pre_orders: unknown;
206
+ text: {
207
+ info: {
208
+ [key: string]: {
209
+ key?: string;
210
+ pref?: string;
211
+ value?: string;
212
+ };
213
+ };
214
+ state: string;
215
+ stateFailed: string;
216
+ is_additional_back_url_enabled?: boolean;
217
+ additional_back_url_link?: string;
218
+ additional_back_url_label?: string;
219
+ additional_back_url_action?: string;
220
+ backurl: string;
221
+ backurl_caption: string;
222
+ backurl_action: string;
223
+ redeem_instruction_link?: null;
224
+ order?: {
225
+ lineitems?: LineItem[];
226
+ shipping?: {
227
+ currency: string;
228
+ amount: number;
229
+ };
230
+ contained_taxes?: {
231
+ sales_tax?: boolean;
232
+ user_vat?: boolean;
233
+ };
234
+ };
235
+ };
236
+ country: string;
237
+ return_region: string;
238
+ additional_button_return_region?: string;
239
+ isUserLegal: boolean;
240
+ isCancelUser: boolean;
241
+ isPreloader: boolean;
242
+ alternative?: unknown;
243
+ showEmailRequest: boolean;
244
+ autoRecharge: {
245
+ params?: unknown;
246
+ packages: unknown;
247
+ label_error: string;
248
+ label_continue: string;
249
+ };
250
+ title_class: TitleClass;
251
+ needToCheck: boolean;
252
+ custom_message: string;
253
+ custom_header: string;
254
+ babkaLink: string;
255
+ discount?: {
256
+ [key: string]: {
257
+ key?: string;
258
+ value?: string;
259
+ };
260
+ };
261
+ }
@@ -0,0 +1,20 @@
1
+ export interface XpsSubscriptionItem {
2
+ amount: number;
3
+ is_trial: boolean;
4
+ trial_period: number;
5
+ period: number;
6
+ currency: string;
7
+ description: string;
8
+ package_info: string;
9
+ period_type: string;
10
+ expiration_period_type: string;
11
+ recurrent_type: string;
12
+ date_next_charge: string;
13
+ amount_next_charge: string;
14
+ setup_fee: number;
15
+ currency_next_charge: string;
16
+ promotion_details: unknown;
17
+ is_allow_user_select_recurrent_type: string;
18
+ date_start: string;
19
+ date_end: string;
20
+ }
@@ -1,4 +1,3 @@
1
- import { CountryService } from '../country/country.service';
2
1
  import { SecureApiClient } from '../http/secure-api/secure-api.service';
3
2
  import { SettingsService } from '../settings/settings.service';
4
3
  import { SavedMethodsResponseFactory } from './saved-methods-response.token';
@@ -7,11 +6,10 @@ import * as i0 from "@angular/core";
7
6
  export declare class SavedMethodsService {
8
7
  private readonly responseFactory;
9
8
  private readonly settingsService;
10
- private readonly countryService;
11
9
  private readonly secureApi;
12
10
  private readonly apiRoute;
13
11
  private readonly cache;
14
- constructor(responseFactory: SavedMethodsResponseFactory, settingsService: SettingsService, countryService: CountryService, secureApi: SecureApiClient);
12
+ constructor(responseFactory: SavedMethodsResponseFactory, settingsService: SettingsService, secureApi: SecureApiClient);
15
13
  getList(): Promise<SavedMethod[]>;
16
14
  private request;
17
15
  static ɵfac: i0.ɵɵFactoryDeclaration<SavedMethodsService, never>;
@@ -0,0 +1,4 @@
1
+ export declare const enum XpsBoolean {
2
+ true = "1",
3
+ false = "0"
4
+ }
@@ -1,7 +1,8 @@
1
1
  import * as i0 from "@angular/core";
2
2
  import * as i1 from "@angular/common/http";
3
+ import * as i2 from "./core/payment/form/form.module";
3
4
  export declare class CoreLibraryModule {
4
5
  static ɵfac: i0.ɵɵFactoryDeclaration<CoreLibraryModule, never>;
5
- static ɵmod: i0.ɵɵNgModuleDeclaration<CoreLibraryModule, never, [typeof i1.HttpClientModule], never>;
6
+ static ɵmod: i0.ɵɵNgModuleDeclaration<CoreLibraryModule, never, [typeof i1.HttpClientModule, typeof i2.FormModule], never>;
6
7
  static ɵinj: i0.ɵɵInjectorDeclaration<CoreLibraryModule>;
7
8
  }
@@ -7,6 +7,12 @@ import { SavedMethodsService } from './core/saved-methods/saved-methods.service'
7
7
  import { SavedMethod } from './core/saved-methods/saved-method.interface';
8
8
  import { UserBalanceResponse } from './core/user-balance/user-balance-response.class';
9
9
  import { UserBalanceService } from './core/user-balance/user-balance.service';
10
+ import { PaymentConfig } from './core/payment/payment-config.interface';
11
+ import { PaymentService } from './core/payment/payment.service';
12
+ import { Payment } from './core/payment/payment.interface';
13
+ import { DeviceFingerPrintService } from './core/device-finger-print/device-finger-print.service';
14
+ import { LegalService } from './core/legal/legal.service';
15
+ import { LegalComponentConfig } from './core/legal/legal.component.config';
10
16
  import * as i0 from "@angular/core";
11
17
  export declare class CoreLibraryService {
12
18
  private readonly settingsService;
@@ -14,15 +20,20 @@ export declare class CoreLibraryService {
14
20
  private readonly paymentMethodsService;
15
21
  private readonly savedMethodsService;
16
22
  private readonly userBalanceService;
23
+ private readonly paymentService;
24
+ private readonly deviceFingerPrintService;
25
+ private readonly legalService;
17
26
  paymentMethods: {
18
27
  getList: () => Promise<PaymentMethod[]>;
19
28
  getQuickMethods: () => Promise<PaymentMethod[]>;
20
29
  getSavedMethods: () => Promise<SavedMethod[]>;
21
30
  getUserBalance: () => Promise<UserBalanceResponse>;
22
31
  };
23
- constructor(settingsService: SettingsService, countryService: CountryService, paymentMethodsService: PaymentMethodsService, savedMethodsService: SavedMethodsService, userBalanceService: UserBalanceService);
32
+ constructor(settingsService: SettingsService, countryService: CountryService, paymentMethodsService: PaymentMethodsService, savedMethodsService: SavedMethodsService, userBalanceService: UserBalanceService, paymentService: PaymentService, deviceFingerPrintService: DeviceFingerPrintService, legalService: LegalService);
24
33
  init(configuration: InitConfiguration): Promise<void>;
25
34
  setCountry(country: string): void;
35
+ createPayment(config: PaymentConfig): Payment;
36
+ getLegalComponentConfig(): LegalComponentConfig;
26
37
  static ɵfac: i0.ɵɵFactoryDeclaration<CoreLibraryService, never>;
27
38
  static ɵprov: i0.ɵɵInjectableDeclaration<CoreLibraryService>;
28
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xsolla/payment-client-core",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^15.2.6",
6
6
  "@angular/core": "^15.2.6",
package/public-api.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './lib/core-library.service';
2
2
  export * from './lib/core-library.module';
3
+ export * from './lib/core/legal/legal.component.config';