@xsolla/payment-client-core 0.0.4 → 0.0.6

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 (223) 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/elk/additional-info.interface.mjs +2 -0
  6. package/esm2020/lib/core/exceptions-handling/elk/elk-logger.service.mjs +120 -0
  7. package/esm2020/lib/core/exceptions-handling/elk/error-without-meta-fields.interface.mjs +2 -0
  8. package/esm2020/lib/core/exceptions-handling/elk/log-message.interface.mjs +2 -0
  9. package/esm2020/lib/core/exceptions-handling/errors/default-terminal-error.class.mjs +8 -0
  10. package/esm2020/lib/core/exceptions-handling/errors/elk-error-types.enum.mjs +13 -0
  11. package/esm2020/lib/core/exceptions-handling/errors/tagged-error.class.mjs +16 -0
  12. package/esm2020/lib/core/exceptions-handling/errors/terminal-error.class.mjs +8 -0
  13. package/esm2020/lib/core/exceptions-handling/errors/token-error.class.mjs +7 -0
  14. package/esm2020/lib/core/exceptions-handling/errors/ws-error.class.mjs +10 -0
  15. package/esm2020/lib/core/payment/actions/action-factory-value.interface.mjs +2 -0
  16. package/esm2020/lib/core/payment/actions/action-type-command.map.mjs +6 -0
  17. package/esm2020/lib/core/payment/actions/action.interface.mjs +2 -0
  18. package/esm2020/lib/core/payment/actions/check-status/check-status.action.class.mjs +16 -0
  19. package/esm2020/lib/core/payment/actions/check-status/check-status.action.token.mjs +11 -0
  20. package/esm2020/lib/core/payment/actions/check-status/check-status.action.type.mjs +2 -0
  21. package/esm2020/lib/core/payment/actions/next-action.interface.mjs +2 -0
  22. package/esm2020/lib/core/payment/actions/next-action.service.mjs +55 -0
  23. package/esm2020/lib/core/payment/actions/next-actions.mjs +11 -0
  24. package/esm2020/lib/core/payment/actions/show-fields/show-fields.action.class.mjs +16 -0
  25. package/esm2020/lib/core/payment/actions/show-fields/show-fields.action.token.mjs +11 -0
  26. package/esm2020/lib/core/payment/actions/show-fields/show-fields.action.type.mjs +2 -0
  27. package/esm2020/lib/core/payment/actions/status-updated/status-updated.action.class.mjs +13 -0
  28. package/esm2020/lib/core/payment/actions/status-updated/status-updated.action.token.mjs +11 -0
  29. package/esm2020/lib/core/payment/actions/status-updated/status-updated.action.type.mjs +2 -0
  30. package/esm2020/lib/core/payment/field-names.enum.mjs +64 -0
  31. package/esm2020/lib/core/payment/field.interface.mjs +1 -1
  32. package/esm2020/lib/core/payment/form/common-control-config.interface.mjs +2 -0
  33. package/esm2020/lib/core/payment/form/controls/control-config.mjs +6 -0
  34. package/esm2020/lib/core/payment/form/controls/control-config.service.mjs +39 -0
  35. package/esm2020/lib/core/payment/form/controls/control-type.type.mjs +2 -0
  36. package/esm2020/lib/core/payment/form/controls/text-control.config.mjs +8 -0
  37. package/esm2020/lib/core/payment/form/converters/converter.abstract.mjs +75 -0
  38. package/esm2020/lib/core/payment/form/converters/converters-map.interface.mjs +2 -0
  39. package/esm2020/lib/core/payment/form/converters/converters-map.mjs +9 -0
  40. package/esm2020/lib/core/payment/form/converters/email.converter.mjs +29 -0
  41. package/esm2020/lib/core/payment/form/converters/zip.converter.mjs +64 -0
  42. package/esm2020/lib/core/payment/form/form-state.interface.mjs +2 -0
  43. package/esm2020/lib/core/payment/form/form.module.mjs +33 -0
  44. package/esm2020/lib/core/payment/form/form.service.mjs +28 -0
  45. package/esm2020/lib/core/payment/form/validators/convert.function.mjs +22 -0
  46. package/esm2020/lib/core/payment/form/validators/email-validator.mjs +7 -0
  47. package/esm2020/lib/core/payment/form/validators/required-validator.mjs +6 -0
  48. package/esm2020/lib/core/payment/form/validators/restricted-value.validator.mjs +6 -0
  49. package/esm2020/lib/core/payment/form/validators/validation-error.interface.mjs +2 -0
  50. package/esm2020/lib/core/payment/form/validators/validation-errors.interface.mjs +2 -0
  51. package/esm2020/lib/core/payment/form/validators/validator-fn.type.mjs +2 -0
  52. package/esm2020/lib/core/payment/initialize/initialize-request-params.interface.mjs +2 -0
  53. package/esm2020/lib/core/payment/initialize/initialize-response.class.mjs +43 -0
  54. package/esm2020/lib/core/payment/initialize/initialize-response.token.mjs +8 -0
  55. package/esm2020/lib/core/payment/initialize/initialize.service.mjs +46 -0
  56. package/esm2020/lib/core/payment/payment-form.interface.mjs +2 -0
  57. package/esm2020/lib/core/payment/payment.interface.mjs +1 -1
  58. package/esm2020/lib/core/payment/payment.service.mjs +37 -14
  59. package/esm2020/lib/core/payment/status/check-status/check-status.service.mjs +56 -0
  60. package/esm2020/lib/core/payment/status/check-status/request/check-status-request.class.mjs +16 -0
  61. package/esm2020/lib/core/payment/status/check-status/request/check-status-request.token.mjs +8 -0
  62. package/esm2020/lib/core/payment/status/check-status/response/check-status-response.class.mjs +9 -0
  63. package/esm2020/lib/core/payment/status/check-status/response/check-status-response.token.mjs +8 -0
  64. package/esm2020/lib/core/payment/status/listen-status/listen-status.service.mjs +112 -0
  65. package/esm2020/lib/core/payment/status/status-groups.mjs +7 -0
  66. package/esm2020/lib/core/payment/status/status-params.interface.mjs +2 -0
  67. package/esm2020/lib/core/payment/status/status-request/request/status-request.class.mjs +22 -0
  68. package/esm2020/lib/core/payment/status/status-request/request/status-request.token.mjs +8 -0
  69. package/esm2020/lib/core/payment/status/status-request/response/status-response.class.mjs +96 -0
  70. package/esm2020/lib/core/payment/status/status-request/response/status-response.token.mjs +8 -0
  71. package/esm2020/lib/core/payment/status/status-request/status-request-params.interface.mjs +2 -0
  72. package/esm2020/lib/core/payment/status/status-request/status-request.service.mjs +68 -0
  73. package/esm2020/lib/core/payment/status/status-settings.interface.mjs +2 -0
  74. package/esm2020/lib/core/payment/status/status-updated.interface.mjs +2 -0
  75. package/esm2020/lib/core/payment/status/status.interface.mjs +1 -1
  76. package/esm2020/lib/core/payment/status/status.service.mjs +38 -0
  77. package/esm2020/lib/core/payment/status/websocket-status/websocket-status.enum.mjs +6 -0
  78. package/esm2020/lib/core/payment/status/websocket-status/websocket-status.service.mjs +76 -0
  79. package/esm2020/lib/core/payment/submit/request/submit-request.class.mjs +16 -0
  80. package/esm2020/lib/core/payment/submit/request/submit-request.token.mjs +8 -0
  81. package/esm2020/lib/core/payment/submit/response/submit-response.class.mjs +31 -0
  82. package/esm2020/lib/core/payment/submit/response/submit-response.token.mjs +8 -0
  83. package/esm2020/lib/core/payment/submit/submit.service.mjs +59 -0
  84. package/esm2020/lib/core/payment/sync/field-sync-state.interface.mjs +2 -0
  85. package/esm2020/lib/core/payment/sync/sync-request.class.mjs +31 -0
  86. package/esm2020/lib/core/payment/sync/sync-request.token.mjs +8 -0
  87. package/esm2020/lib/core/payment/sync/sync-response.class.mjs +14 -0
  88. package/esm2020/lib/core/payment/sync/sync-response.token.mjs +8 -0
  89. package/esm2020/lib/core/payment/sync/sync.service.mjs +91 -0
  90. package/esm2020/lib/core/payment/xps-api-part-request.abstract.mjs +8 -0
  91. package/esm2020/lib/core/payment/xps-api-part.abstract.mjs +19 -0
  92. package/esm2020/lib/core/payment/xps-error.interface.mjs +1 -1
  93. package/esm2020/lib/core/payment/xps-request.abstract.mjs +8 -0
  94. package/esm2020/lib/core/payment/xps-response.interface.mjs +1 -1
  95. package/esm2020/lib/core/properties.type.mjs +2 -0
  96. package/esm2020/lib/core/web-socket/centrifugo-web-socket.service.mjs +200 -0
  97. package/esm2020/lib/core/web-socket/nchan-web-socket.service.mjs +116 -0
  98. package/esm2020/lib/core/web-socket/web-socket-client-type.enum.mjs +6 -0
  99. package/esm2020/lib/core/web-socket/web-socket.factory.mjs +28 -0
  100. package/esm2020/lib/core/web-socket/web-socket.interface.mjs +2 -0
  101. package/esm2020/lib/core/xps-boolean.enum.mjs +2 -0
  102. package/esm2020/lib/core-library.module.mjs +43 -4
  103. package/esm2020/lib/core-library.service.mjs +18 -11
  104. package/fesm2015/xsolla-payment-client-core.mjs +2201 -87
  105. package/fesm2015/xsolla-payment-client-core.mjs.map +1 -1
  106. package/fesm2020/xsolla-payment-client-core.mjs +2117 -83
  107. package/fesm2020/xsolla-payment-client-core.mjs.map +1 -1
  108. package/lib/core/device-finger-print/device-finger-print-components.interface.d.ts +4 -0
  109. package/lib/core/device-finger-print/device-finger-print.service.d.ts +44 -0
  110. package/lib/core/device-finger-print/fingerprint-js.interface.d.ts +6 -0
  111. package/lib/core/device-finger-print/hash.type.d.ts +3 -0
  112. package/lib/core/exceptions-handling/elk/additional-info.interface.d.ts +19 -0
  113. package/lib/core/exceptions-handling/elk/elk-logger.service.d.ts +27 -0
  114. package/lib/core/exceptions-handling/elk/error-without-meta-fields.interface.d.ts +8 -0
  115. package/lib/core/exceptions-handling/elk/log-message.interface.d.ts +8 -0
  116. package/lib/core/exceptions-handling/errors/default-terminal-error.class.d.ts +4 -0
  117. package/lib/core/exceptions-handling/errors/elk-error-types.enum.d.ts +11 -0
  118. package/lib/core/exceptions-handling/errors/tagged-error.class.d.ts +10 -0
  119. package/lib/core/exceptions-handling/errors/terminal-error.class.d.ts +5 -0
  120. package/lib/core/exceptions-handling/errors/token-error.class.d.ts +4 -0
  121. package/lib/core/exceptions-handling/errors/ws-error.class.d.ts +5 -0
  122. package/lib/core/payment/actions/action-factory-value.interface.d.ts +5 -0
  123. package/lib/core/payment/actions/action-type-command.map.d.ts +4 -0
  124. package/lib/core/payment/actions/check-status/check-status.action.class.d.ts +8 -0
  125. package/lib/core/payment/actions/check-status/check-status.action.token.d.ts +4 -0
  126. package/lib/core/payment/actions/check-status/check-status.action.type.d.ts +12 -0
  127. package/lib/core/payment/actions/next-action.interface.d.ts +4 -0
  128. package/lib/core/payment/actions/next-action.service.d.ts +20 -0
  129. package/lib/core/payment/actions/next-actions.d.ts +5 -0
  130. package/lib/core/payment/actions/show-fields/show-fields.action.class.d.ts +8 -0
  131. package/lib/core/payment/actions/show-fields/show-fields.action.token.d.ts +4 -0
  132. package/lib/core/payment/actions/show-fields/show-fields.action.type.d.ts +12 -0
  133. package/lib/core/payment/actions/status-updated/status-updated.action.class.d.ts +8 -0
  134. package/lib/core/payment/actions/status-updated/status-updated.action.token.d.ts +4 -0
  135. package/lib/core/payment/actions/status-updated/status-updated.action.type.d.ts +11 -0
  136. package/lib/core/payment/field-names.enum.d.ts +62 -0
  137. package/lib/core/payment/field.interface.d.ts +5 -5
  138. package/lib/core/payment/form/common-control-config.interface.d.ts +9 -0
  139. package/lib/core/payment/form/controls/control-config.d.ts +9 -0
  140. package/lib/core/payment/form/controls/control-config.service.d.ts +15 -0
  141. package/lib/core/payment/form/controls/control-type.type.d.ts +1 -0
  142. package/lib/core/payment/form/controls/text-control.config.d.ts +11 -0
  143. package/lib/core/payment/form/converters/converter.abstract.d.ts +23 -0
  144. package/lib/core/payment/form/converters/converters-map.d.ts +4 -0
  145. package/lib/core/payment/form/converters/converters-map.interface.d.ts +5 -0
  146. package/lib/core/payment/form/converters/email.converter.d.ts +14 -0
  147. package/lib/core/payment/form/converters/zip.converter.d.ts +21 -0
  148. package/lib/core/payment/form/form-state.interface.d.ts +3 -0
  149. package/lib/core/payment/form/form.module.d.ts +7 -0
  150. package/lib/core/payment/form/form.service.d.ts +12 -0
  151. package/lib/core/payment/form/validators/convert.function.d.ts +3 -0
  152. package/lib/core/payment/form/validators/email-validator.d.ts +2 -0
  153. package/lib/core/payment/form/validators/required-validator.d.ts +2 -0
  154. package/lib/core/payment/form/validators/restricted-value.validator.d.ts +2 -0
  155. package/lib/core/payment/form/validators/validation-error.interface.d.ts +4 -0
  156. package/lib/core/payment/form/validators/validation-errors.interface.d.ts +4 -0
  157. package/lib/core/payment/form/validators/validator-fn.type.d.ts +3 -0
  158. package/lib/core/payment/initialize/initialize-response.class.d.ts +7 -0
  159. package/lib/core/payment/initialize/initialize-response.token.d.ts +6 -0
  160. package/lib/core/payment/initialize/initialize.service.d.ts +18 -0
  161. package/lib/core/payment/payment-form.interface.d.ts +39 -0
  162. package/lib/core/payment/payment.interface.d.ts +12 -8
  163. package/lib/core/payment/payment.service.d.ts +23 -8
  164. package/lib/core/payment/status/check-status/check-status.service.d.ts +20 -0
  165. package/lib/core/payment/status/check-status/request/check-status-request.class.d.ts +8 -0
  166. package/lib/core/payment/status/check-status/request/check-status-request.token.d.ts +6 -0
  167. package/lib/core/payment/status/check-status/response/check-status-response.class.d.ts +8 -0
  168. package/lib/core/payment/status/check-status/response/check-status-response.token.d.ts +7 -0
  169. package/lib/core/payment/status/listen-status/listen-status.service.d.ts +28 -0
  170. package/lib/core/payment/status/status-groups.d.ts +5 -0
  171. package/lib/core/payment/status/status-params.interface.d.ts +9 -0
  172. package/lib/core/payment/status/status-request/request/status-request.class.d.ts +17 -0
  173. package/lib/core/payment/status/status-request/request/status-request.token.d.ts +6 -0
  174. package/lib/core/payment/status/status-request/response/status-response.class.d.ts +14 -0
  175. package/lib/core/payment/status/status-request/response/status-response.token.d.ts +7 -0
  176. package/lib/core/payment/status/status-request/status-request-params.interface.d.ts +10 -0
  177. package/lib/core/payment/status/status-request/status-request.service.d.ts +21 -0
  178. package/lib/core/payment/status/status-settings.interface.d.ts +13 -0
  179. package/lib/core/payment/status/status-updated.interface.d.ts +6 -0
  180. package/lib/core/payment/status/status.interface.d.ts +0 -1
  181. package/lib/core/payment/status/status.service.d.ts +16 -0
  182. package/lib/core/payment/status/websocket-status/websocket-status.enum.d.ts +4 -0
  183. package/lib/core/payment/status/websocket-status/websocket-status.service.d.ts +24 -0
  184. package/lib/core/payment/submit/request/submit-request.class.d.ts +13 -0
  185. package/lib/core/payment/submit/request/submit-request.token.d.ts +6 -0
  186. package/lib/core/payment/submit/response/submit-response.class.d.ts +26 -0
  187. package/lib/core/payment/submit/response/submit-response.token.d.ts +6 -0
  188. package/lib/core/payment/submit/submit.service.d.ts +21 -0
  189. package/lib/core/payment/sync/field-sync-state.interface.d.ts +5 -0
  190. package/lib/core/payment/sync/sync-request.class.d.ts +15 -0
  191. package/lib/core/payment/sync/sync-request.token.d.ts +6 -0
  192. package/lib/core/payment/sync/sync-response.class.d.ts +11 -0
  193. package/lib/core/payment/sync/sync-response.token.d.ts +6 -0
  194. package/lib/core/payment/sync/sync.service.d.ts +27 -0
  195. package/lib/core/payment/xps-api-part-request.abstract.d.ts +6 -0
  196. package/lib/core/payment/xps-api-part.abstract.d.ts +8 -0
  197. package/lib/core/payment/xps-error.interface.d.ts +1 -0
  198. package/lib/core/payment/xps-request.abstract.d.ts +6 -0
  199. package/lib/core/payment/xps-response.interface.d.ts +3 -6
  200. package/lib/core/properties.type.d.ts +3 -0
  201. package/lib/core/web-socket/centrifugo-web-socket.service.d.ts +41 -0
  202. package/lib/core/web-socket/nchan-web-socket.service.d.ts +30 -0
  203. package/lib/core/web-socket/web-socket-client-type.enum.d.ts +4 -0
  204. package/lib/core/web-socket/web-socket.factory.d.ts +13 -0
  205. package/lib/core/web-socket/web-socket.interface.d.ts +9 -0
  206. package/lib/core/xps-boolean.enum.d.ts +4 -0
  207. package/lib/core-library.module.d.ts +2 -1
  208. package/lib/core-library.service.d.ts +6 -2
  209. package/package.json +19 -4
  210. package/xsolla-payment-client-core-0.0.6.tgz +0 -0
  211. package/esm2020/lib/core/boolean-string.enum.mjs +0 -6
  212. package/esm2020/lib/core/payment/actions/action.type.mjs +0 -2
  213. package/esm2020/lib/core/payment/actions/check-status.action.type.mjs +0 -2
  214. package/esm2020/lib/core/payment/actions/next-action.type.mjs +0 -2
  215. package/esm2020/lib/core/payment/initialize-request-params.interface.mjs +0 -2
  216. package/esm2020/lib/core/payment/initialize.service.mjs +0 -39
  217. package/lib/core/boolean-string.enum.d.ts +0 -4
  218. package/lib/core/payment/actions/check-status.action.type.d.ts +0 -12
  219. package/lib/core/payment/actions/next-action.type.d.ts +0 -2
  220. package/lib/core/payment/initialize.service.d.ts +0 -16
  221. package/xsolla-payment-client-core-0.0.4.tgz +0 -0
  222. /package/lib/core/payment/actions/{action.type.d.ts → action.interface.d.ts} +0 -0
  223. /package/lib/core/payment/{initialize-request-params.interface.d.ts → initialize/initialize-request-params.interface.d.ts} +0 -0
@@ -0,0 +1,4 @@
1
+ export interface DeviceFingerPrintComponents {
2
+ hash?: string;
3
+ [key: string]: unknown;
4
+ }
@@ -0,0 +1,44 @@
1
+ import { SecureApiClient } from '../http/secure-api/secure-api.service';
2
+ import { SettingsService } from '../settings/settings.service';
3
+ import { ExtendedWindow } from '../extended-window.interface';
4
+ import * as i0 from "@angular/core";
5
+ export declare class DeviceFingerPrintService {
6
+ private readonly secureApi;
7
+ private readonly settingsService;
8
+ private readonly window;
9
+ private hash;
10
+ private readonly apiRoute;
11
+ private fingerprintJs;
12
+ private antifraudFingerprintLibrary;
13
+ private readonly fingerprintApiUrl;
14
+ constructor(secureApi: SecureApiClient, settingsService: SettingsService, window: ExtendedWindow);
15
+ init(): Promise<void>;
16
+ getHash(): Promise<string>;
17
+ private loadFingerprintJs;
18
+ private loadAntifraudFingerprintLibrary;
19
+ private makeAntifraudFingerprint;
20
+ /**
21
+ *Загружаем библиотеку, генерируем данные,
22
+ *хешируем с помощью BASE64 и отправляем на бэкенд,
23
+ *в ответ получаем dfp_hash.
24
+ **/
25
+ private buildHash;
26
+ /**
27
+ *Новая версия библиотеки содержит не все компоненты, некоторые приходится имплементировать самостоятельно
28
+ **/
29
+ private getHasLiedResolution;
30
+ /**
31
+ *Бэкенд заточен под конкретные поля, которые необходимо смапить.
32
+ **/
33
+ private getComponents;
34
+ /**
35
+ * Получаем данные dfp с помощью FingerprintJS, мапим необходимые поля, добавляем хэш
36
+ **/
37
+ private generate;
38
+ /**
39
+ * Отправка dfp на сервер, в ответ получаем dfp_hash
40
+ **/
41
+ private send;
42
+ static ɵfac: i0.ɵɵFactoryDeclaration<DeviceFingerPrintService, never>;
43
+ static ɵprov: i0.ɵɵInjectableDeclaration<DeviceFingerPrintService>;
44
+ }
@@ -0,0 +1,6 @@
1
+ import type FingerprintJS from '@fingerprintjs/fingerprintjs';
2
+ import type { murmurX64Hash128 } from '@fingerprintjs/fingerprintjs';
3
+ export interface FingerprintJs {
4
+ library: typeof FingerprintJS;
5
+ getHash: typeof murmurX64Hash128;
6
+ }
@@ -0,0 +1,3 @@
1
+ export type Hash = {
2
+ '200': string;
3
+ } | null;
@@ -0,0 +1,19 @@
1
+ export interface AdditionalInfo {
2
+ location: {
3
+ url: string;
4
+ };
5
+ user_agent?: string;
6
+ project: {
7
+ id: number;
8
+ };
9
+ referrer: {
10
+ url: string;
11
+ };
12
+ viewport: {
13
+ width: number;
14
+ height: number;
15
+ };
16
+ cdn_address: string;
17
+ country: string;
18
+ local: string;
19
+ }
@@ -0,0 +1,27 @@
1
+ import { ErrorHandler, NgZone } from '@angular/core';
2
+ import { HttpClient } from '@angular/common/http';
3
+ import { SettingsService } from '../../settings/settings.service';
4
+ import { ExtendedWindow } from '../../extended-window.interface';
5
+ import { ErrorTags } from '../errors/elk-error-types.enum';
6
+ import * as i0 from "@angular/core";
7
+ export declare class ElkLoggerService implements ErrorHandler {
8
+ private readonly window;
9
+ private readonly settingsService;
10
+ private readonly http;
11
+ private readonly ngZone;
12
+ private readonly stackTrace;
13
+ private readonly vendors;
14
+ constructor(window: ExtendedWindow, settingsService: SettingsService, http: HttpClient, ngZone: NgZone);
15
+ handleError(error: Error): void;
16
+ log(message: string, tags: ErrorTags[], extra?: {
17
+ [key: string]: unknown;
18
+ }): void;
19
+ private parseError;
20
+ private loadStackTrace;
21
+ private getErrorTrace;
22
+ private getAdditionalInfo;
23
+ private removeErrorMetaFields;
24
+ private sendLog;
25
+ static ɵfac: i0.ɵɵFactoryDeclaration<ElkLoggerService, never>;
26
+ static ɵprov: i0.ɵɵInjectableDeclaration<ElkLoggerService>;
27
+ }
@@ -0,0 +1,8 @@
1
+ import { AdditionalInfo } from './additional-info.interface';
2
+ import { HttpErrorData } from '../http-interceptor/http-error-data.interface';
3
+ export interface ErrorWithoutMetaFields {
4
+ message: string;
5
+ trace: string;
6
+ additionalInfo: AdditionalInfo;
7
+ httpErrorData?: HttpErrorData;
8
+ }
@@ -0,0 +1,8 @@
1
+ import { AdditionalInfo } from './additional-info.interface';
2
+ export interface LogMessage {
3
+ additionalInfo: AdditionalInfo;
4
+ message: string;
5
+ extra?: {
6
+ [key: string]: unknown;
7
+ };
8
+ }
@@ -0,0 +1,4 @@
1
+ import { TerminalError } from './terminal-error.class';
2
+ export declare class DefaultTerminalError extends TerminalError {
3
+ constructor();
4
+ }
@@ -0,0 +1,11 @@
1
+ export declare enum ErrorTags {
2
+ APP = "appError",
3
+ HTTP = "httpError",
4
+ JS = "jsError",
5
+ WS = "webSocket",
6
+ ENCRYPT = "encrypt",
7
+ APPLEPAY = "applepay",
8
+ HEADLESS_UI = "headlessUi",
9
+ GOOGLEPAY = "googlepay",
10
+ PAYTM = "paytm"
11
+ }
@@ -0,0 +1,10 @@
1
+ import { ErrorTags } from './elk-error-types.enum';
2
+ import { AdditionalInfo } from '../elk/additional-info.interface';
3
+ export declare class TaggedError extends Error {
4
+ childTag: ErrorTags;
5
+ trace: string;
6
+ tags: ErrorTags[];
7
+ additionalInfo: AdditionalInfo;
8
+ private readonly parentTag;
9
+ constructor(message: string, tags?: ErrorTags[]);
10
+ }
@@ -0,0 +1,5 @@
1
+ import { AppError } from './app-error.class';
2
+ export declare class TerminalError extends AppError {
3
+ code: string;
4
+ constructor(message: string, code: string);
5
+ }
@@ -0,0 +1,4 @@
1
+ import { AppError } from './app-error.class';
2
+ export declare class TokenError extends AppError {
3
+ constructor();
4
+ }
@@ -0,0 +1,5 @@
1
+ import { ErrorTags } from './elk-error-types.enum';
2
+ import { TaggedError } from './tagged-error.class';
3
+ export declare class WsError extends TaggedError {
4
+ constructor(message: string, channelName: string, tags?: ErrorTags[]);
5
+ }
@@ -0,0 +1,5 @@
1
+ import { Action } from './action.interface';
2
+ export interface ActionFactoryValue {
3
+ factory(...args: unknown[]): Action;
4
+ type: string;
5
+ }
@@ -0,0 +1,4 @@
1
+ import { XpsCommand } from '../xps-comand.enum';
2
+ export declare const actionTypeCommandMap: {
3
+ [key in XpsCommand]?: string;
4
+ };
@@ -0,0 +1,8 @@
1
+ import { SubmitResponse } from '../../submit/response/submit-response.class';
2
+ import { Action } from '../action.interface';
3
+ import { CheckStatusActionData, CheckStatusActionType } from './check-status.action.type';
4
+ export declare class CheckStatusAction implements Action {
5
+ type: CheckStatusActionType;
6
+ data: CheckStatusActionData;
7
+ constructor(submitResponse: SubmitResponse);
8
+ }
@@ -0,0 +1,4 @@
1
+ import { InjectionToken, ValueProvider } from '@angular/core';
2
+ import { ActionFactoryValue } from '../action-factory-value.interface';
3
+ export declare const checkStatusActionFactoryToken: InjectionToken<ActionFactoryValue>;
4
+ export declare const checkStatusActionFactoryProvider: ValueProvider;
@@ -0,0 +1,12 @@
1
+ import { Action } from '../action.interface';
2
+ export type CheckStatusActionType = 'check_status';
3
+ export interface CheckStatusActionData {
4
+ invoice: number;
5
+ signature: string;
6
+ locale: string;
7
+ testProject?: string;
8
+ testPs?: string;
9
+ testXsolla?: string;
10
+ userReturnStatus?: string;
11
+ }
12
+ export type CheckStatusAction = Action<CheckStatusActionType, CheckStatusActionData>;
@@ -0,0 +1,4 @@
1
+ import { CheckStatusAction } from './check-status/check-status.action.type';
2
+ import { ShowFieldsAction } from './show-fields/show-fields.action.type';
3
+ import { StatusUpdatedAction } from './status-updated/status-updated.action.type';
4
+ export type NextAction = CheckStatusAction | ShowFieldsAction | StatusUpdatedAction;
@@ -0,0 +1,20 @@
1
+ import { Injector } from '@angular/core';
2
+ import { NextAction } from './next-action.interface';
3
+ import { SubmitResponse } from '../submit/response/submit-response.class';
4
+ import { NextActionTokens } from './next-actions';
5
+ import { Observable } from 'rxjs';
6
+ import * as i0 from "@angular/core";
7
+ export declare class NextActionService {
8
+ private readonly nextActionTokens;
9
+ private readonly injector;
10
+ private readonly flowUpdatesSubject;
11
+ private readonly nextActionsMap;
12
+ get flowUpdates$(): Observable<NextAction>;
13
+ constructor(nextActionTokens: NextActionTokens, injector: Injector);
14
+ getNextAction(submitResponse: SubmitResponse): NextAction | null;
15
+ emitFlowUpdates(action: NextAction): void;
16
+ private fillNextActionsMap;
17
+ private findNextAction;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<NextActionService, never>;
19
+ static ɵprov: i0.ɵɵInjectableDeclaration<NextActionService>;
20
+ }
@@ -0,0 +1,5 @@
1
+ import { InjectionToken, ValueProvider } from '@angular/core';
2
+ import { Action } from './action.interface';
3
+ export type NextActionTokens = ValueProvider[];
4
+ export declare const nextActionsToken: InjectionToken<Action<string, object>>;
5
+ export declare const nextActions: NextActionTokens;
@@ -0,0 +1,8 @@
1
+ import { Action } from '../action.interface';
2
+ import { ShowFieldsActionData, ShowFieldsActionType } from './show-fields.action.type';
3
+ import { SubmitResponse } from '../../submit/response/submit-response.class';
4
+ export declare class ShowFieldsAction implements Action {
5
+ type: ShowFieldsActionType;
6
+ data: ShowFieldsActionData;
7
+ constructor(submitResponse: SubmitResponse);
8
+ }
@@ -0,0 +1,4 @@
1
+ import { InjectionToken, ValueProvider } from '@angular/core';
2
+ import { ActionFactoryValue } from '../action-factory-value.interface';
3
+ export declare const showFieldsActionFactoryToken: InjectionToken<ActionFactoryValue>;
4
+ export declare const showFieldsActionFactoryProvider: ValueProvider;
@@ -0,0 +1,12 @@
1
+ import { Action } from '../action.interface';
2
+ import { Field } from '../../field.interface';
3
+ import { XpsMessage } from '../../xps-message.interface';
4
+ import { XpsError } from '../../xps-error.interface';
5
+ export type ShowFieldsActionType = 'show_fields';
6
+ export interface ShowFieldsActionData {
7
+ fields: Field[];
8
+ errors: XpsError[] | null;
9
+ messages: XpsMessage[] | undefined;
10
+ order?: object;
11
+ }
12
+ export type ShowFieldsAction = Action<ShowFieldsActionType, ShowFieldsActionData>;
@@ -0,0 +1,8 @@
1
+ import { Action } from '../action.interface';
2
+ import { StatusUpdatedActionData, StatusUpdatedActionType } from './status-updated.action.type';
3
+ import { StatusResponse } from '../../status/status-request/response/status-response.class';
4
+ export declare class StatusUpdatedAction implements Action {
5
+ type: StatusUpdatedActionType;
6
+ data: StatusUpdatedActionData;
7
+ constructor(statusResponse: StatusResponse);
8
+ }
@@ -0,0 +1,4 @@
1
+ import { InjectionToken, ValueProvider } from '@angular/core';
2
+ import { ActionFactoryValue } from '../action-factory-value.interface';
3
+ export declare const statusUpdatedActionFactoryToken: InjectionToken<ActionFactoryValue>;
4
+ export declare const statusUpdatedActionFactoryProvider: ValueProvider;
@@ -0,0 +1,11 @@
1
+ import { Action } from '../action.interface';
2
+ import { StatusEnum } from '../../status/status.enum';
3
+ export type StatusUpdatedActionType = 'status_updated';
4
+ export interface StatusUpdatedActionData {
5
+ statusState: StatusEnum;
6
+ group: string;
7
+ isCanceled?: boolean;
8
+ isSuccess?: boolean;
9
+ invoice?: number;
10
+ }
11
+ export type StatusUpdatedAction = Action<StatusUpdatedActionType, StatusUpdatedActionData>;
@@ -0,0 +1,62 @@
1
+ export declare enum FieldNames {
2
+ address1 = "address1",
3
+ address2 = "address2",
4
+ address = "address",
5
+ allowRecurrentSubscription = "allowRecurrentSubscription",
6
+ allowSubscription = "allowSubscription",
7
+ apt = "apt",
8
+ availableCardTypes = "available_card_types",
9
+ bank = "bank",
10
+ birthDate = "birth_date",
11
+ cardMonth = "card_month",
12
+ cardYear = "card_year",
13
+ cardNumber = "card_number",
14
+ cardholdername = "cardholdername",
15
+ city = "city",
16
+ couponCode = "couponCode",
17
+ cpfName = "cpf_name",
18
+ cpfNumber = "cpf_number",
19
+ cvv = "cvv",
20
+ description = "description",
21
+ email = "email",
22
+ psEmail = "psEmail",
23
+ euCheck = "eu_check",
24
+ extraCvv = "extra_cvv",
25
+ extraCardNumber = "extra_card_number",
26
+ extraCardType = "extra_card_type",
27
+ fName = "f_name",
28
+ installments = "installments",
29
+ lName = "l_name",
30
+ needInstallments = "needInstallments",
31
+ personId = "person_id",
32
+ personIdAr = "person_id_ar",
33
+ personIdCo = "person_id_co",
34
+ phone = "phone",
35
+ purchaseDescription = "purchaseDescription",
36
+ recurrentType = "recurrent_type",
37
+ rockstarTaxes = "rockstar_taxes",
38
+ state = "state",
39
+ street = "street",
40
+ streetNumber = "street_number",
41
+ take2Taxes = "take2_taxes",
42
+ termsAndConditions = "termsAndConditions",
43
+ termsAndConditionsAtariPp = "termsAndConditionsAtariPP",
44
+ termsAndConditionsAtariTc = "termsAndConditionsAtariTC",
45
+ termsAndConditionsHtcEula = "termsAndConditionsHtcEula",
46
+ termsAndConditionsRobloxEula = "termsAndConditionsRobloxEula",
47
+ termsAndConditionsRolandEula = "termsAndConditionsRolandEula",
48
+ termsAndConditionsDeusLoVultEula = "termsAndConditionsDeusLoVultEula",
49
+ termsAndConditionsOnzenga = "termsAndConditionsOnzenga",
50
+ xsollaTipsAmount = "xsollaTipsAmount",
51
+ zip = "zip",
52
+ allowSave = "allowSave",
53
+ koreaLimitsInstruction = "korea_limits_instruction",
54
+ tokenApplePay = "token_applepay",
55
+ fixInvoice = "fix_invoice",
56
+ fixPid = "fix_pid",
57
+ signature = "signature",
58
+ qr = "qr",
59
+ sum = "sum",
60
+ out = "out",
61
+ tinkoffDisclaimer = "ps.tinkoff.disclaimer"
62
+ }
@@ -1,4 +1,4 @@
1
- import { BooleanString } from '../boolean-string.enum';
1
+ import { XpsBoolean } from '../xps-boolean.enum';
2
2
  export interface Field {
3
3
  name: string;
4
4
  type: string;
@@ -6,10 +6,10 @@ export interface Field {
6
6
  title: string;
7
7
  example: string;
8
8
  options?: unknown[];
9
- isMandatory: BooleanString;
10
- isReadonly?: BooleanString;
11
- isVisible: BooleanString;
12
- isPakets?: BooleanString;
9
+ isMandatory: XpsBoolean;
10
+ isReadonly?: XpsBoolean;
11
+ isVisible: XpsBoolean;
12
+ isPakets?: XpsBoolean;
13
13
  tooltip?: string;
14
14
  regex?: string;
15
15
  validation_error_msg?: string;
@@ -0,0 +1,9 @@
1
+ export interface CommonControlConfig {
2
+ name: string;
3
+ title?: string;
4
+ labelHint?: string;
5
+ dataType: string | null;
6
+ readonly: boolean;
7
+ placeholder?: string;
8
+ autocomplete: string;
9
+ }
@@ -0,0 +1,9 @@
1
+ import { SafeHtml } from '@angular/platform-browser';
2
+ import { ControlType } from './control-type.type';
3
+ export declare class ControlConfig {
4
+ [option: string]: any;
5
+ controlType: ControlType | string;
6
+ name: string;
7
+ title?: string | null | SafeHtml;
8
+ shouldHideUserInput?: boolean | null;
9
+ }
@@ -0,0 +1,15 @@
1
+ import { Injector } from '@angular/core';
2
+ import { UntypedFormControl } from '@angular/forms';
3
+ import { Field } from '../../field.interface';
4
+ import { Converter } from '../converters/converter.abstract';
5
+ import { ConvertersMap } from '../converters/converters-map.interface';
6
+ import * as i0 from "@angular/core";
7
+ export declare class ControlConfigService {
8
+ private readonly convertersMap;
9
+ private readonly injector;
10
+ constructor(convertersMap: ConvertersMap, injector: Injector);
11
+ getFormControl(field: Field): UntypedFormControl | null;
12
+ getConverter(field: Field | null): Converter | null;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<ControlConfigService, never>;
14
+ static ɵprov: i0.ɵɵInjectableDeclaration<ControlConfigService>;
15
+ }
@@ -0,0 +1 @@
1
+ export type ControlType = 'text' | 'checkbox' | 'radio' | 'search-select' | 'phone' | 'phone-or-email';
@@ -0,0 +1,11 @@
1
+ import { ControlConfig } from './control-config';
2
+ export declare class TextControlConfig extends ControlConfig {
3
+ controlType: string;
4
+ dataType?: string;
5
+ maxLength?: number;
6
+ placeholder?: string;
7
+ autocomplete?: string;
8
+ icon?: string;
9
+ description?: string;
10
+ inputMode?: string;
11
+ }
@@ -0,0 +1,23 @@
1
+ import { AsyncValidatorFn, UntypedFormControl, ValidatorFn } from '@angular/forms';
2
+ import { Field } from '../../field.interface';
3
+ import { SyncService } from '../../sync/sync.service';
4
+ import { ControlConfig } from '../controls/control-config';
5
+ import { FormState } from '../form-state.interface';
6
+ export declare abstract class Converter {
7
+ protected syncService: SyncService;
8
+ protected constructor(syncService: SyncService);
9
+ convertToConfig(field: Field, formState?: FormState): ControlConfig;
10
+ convertToFormControl(field: Field): UntypedFormControl;
11
+ getValidators(field: Field): ValidatorFn[];
12
+ getAsyncValidators(field: Field): AsyncValidatorFn | AsyncValidatorFn[] | null;
13
+ createDefaultControlConfig<T extends {
14
+ [key: string]: unknown;
15
+ }>(controlConfigClass: new () => T, field: Field): T;
16
+ getValue(field: Field): string;
17
+ protected abstract createControlConfig(field: Field, formState?: FormState): ControlConfig;
18
+ protected getDataType(): string;
19
+ protected getAutocomplete(): string;
20
+ protected shouldHideUserInput(): boolean;
21
+ private getCommonControlConfig;
22
+ private copyCommonOptions;
23
+ }
@@ -0,0 +1,4 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import { ConvertersMap } from './converters-map.interface';
3
+ export declare const convertersMapToken: InjectionToken<ConvertersMap>;
4
+ export declare const convertersMap: ConvertersMap;
@@ -0,0 +1,5 @@
1
+ import { ProviderToken } from '@angular/core';
2
+ import { Converter } from './converter.abstract';
3
+ export interface ConvertersMap {
4
+ [fieldNameOrType: string]: ProviderToken<Converter>;
5
+ }
@@ -0,0 +1,14 @@
1
+ import { ValidatorFn } from '@angular/forms';
2
+ import { Field } from '../../field.interface';
3
+ import { SyncService } from '../../sync/sync.service';
4
+ import { TextControlConfig } from '../controls/text-control.config';
5
+ import { Converter } from './converter.abstract';
6
+ import * as i0 from "@angular/core";
7
+ export declare class EmailConverter extends Converter {
8
+ constructor(syncService: SyncService);
9
+ getValidators(field: Field): ValidatorFn[];
10
+ protected createControlConfig(field: Field): TextControlConfig;
11
+ protected getDataType(): string;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<EmailConverter, never>;
13
+ static ɵprov: i0.ɵɵInjectableDeclaration<EmailConverter>;
14
+ }
@@ -0,0 +1,21 @@
1
+ import { ValidatorFn } from '@angular/forms';
2
+ import { CountryService } from '../../../country/country.service';
3
+ import { Field } from '../../field.interface';
4
+ import { SyncService } from '../../sync/sync.service';
5
+ import { TextControlConfig } from '../controls/text-control.config';
6
+ import { Converter } from './converter.abstract';
7
+ import * as i0 from "@angular/core";
8
+ export declare class ZipConverter extends Converter {
9
+ private readonly countryService;
10
+ private readonly minLength;
11
+ private readonly maxLength;
12
+ private readonly usCountryLength;
13
+ constructor(syncService: SyncService, countryService: CountryService);
14
+ private get isUsCountry();
15
+ getValidators(field: Field): ValidatorFn[];
16
+ protected createControlConfig(field: Field): TextControlConfig;
17
+ protected getAutocomplete(): string;
18
+ protected getDataType(): string;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<ZipConverter, never>;
20
+ static ɵprov: i0.ɵɵInjectableDeclaration<ZipConverter>;
21
+ }
@@ -0,0 +1,3 @@
1
+ export interface FormState {
2
+ [key: string]: unknown;
3
+ }
@@ -0,0 +1,7 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "@angular/forms";
3
+ export declare class FormModule {
4
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormModule, never>;
5
+ static ɵmod: i0.ɵɵNgModuleDeclaration<FormModule, never, [typeof i1.ReactiveFormsModule], never>;
6
+ static ɵinj: i0.ɵɵInjectorDeclaration<FormModule>;
7
+ }
@@ -0,0 +1,12 @@
1
+ import { UntypedFormGroup } from '@angular/forms';
2
+ import { Field } from '../field.interface';
3
+ import { ControlConfigService } from './controls/control-config.service';
4
+ import * as i0 from "@angular/core";
5
+ export declare class FormService {
6
+ protected readonly controlConfigService: ControlConfigService;
7
+ constructor(controlConfigService: ControlConfigService);
8
+ createForm(fields: Field[]): UntypedFormGroup;
9
+ private getVisibleFields;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormService, never>;
11
+ static ɵprov: i0.ɵɵInjectableDeclaration<FormService>;
12
+ }
@@ -0,0 +1,3 @@
1
+ import { ValidatorFn } from '@angular/forms';
2
+ import { ValidatorFn as ConvertedValidatorFn } from './validator-fn.type';
3
+ export declare function convert(validator: ValidatorFn, message: string): ConvertedValidatorFn;
@@ -0,0 +1,2 @@
1
+ import { ValidatorFn } from './validator-fn.type';
2
+ export declare function emailValidator(): ValidatorFn;
@@ -0,0 +1,2 @@
1
+ import { ValidatorFn } from '@angular/forms';
2
+ export declare function requiredValidator(): ValidatorFn;
@@ -0,0 +1,2 @@
1
+ import { ValidatorFn } from './validator-fn.type';
2
+ export declare const restrictedValueValidator: (restrictedValue: unknown) => ValidatorFn;
@@ -0,0 +1,4 @@
1
+ export interface ValidationError {
2
+ message?: string;
3
+ [parameter: string]: unknown;
4
+ }
@@ -0,0 +1,4 @@
1
+ import { ValidationError } from './validation-error.interface';
2
+ export interface ValidationErrors {
3
+ [key: string]: ValidationError | false;
4
+ }
@@ -0,0 +1,3 @@
1
+ import { AbstractControl } from '@angular/forms';
2
+ import { ValidationErrors } from './validation-errors.interface';
3
+ export type ValidatorFn = (control: AbstractControl) => ValidationErrors | null;
@@ -0,0 +1,7 @@
1
+ import { PaymentForm } from '../payment-form.interface';
2
+ import { XpsResponse } from '../xps-response.interface';
3
+ export declare class InitializeResponse {
4
+ readonly paymentForm: PaymentForm | null;
5
+ constructor(response: XpsResponse);
6
+ private extractPaymentForm;
7
+ }
@@ -0,0 +1,6 @@
1
+ import { InjectionToken, ValueProvider } from '@angular/core';
2
+ import { InitializeResponse } from './initialize-response.class';
3
+ export type ResponseParameters = ConstructorParameters<typeof InitializeResponse>;
4
+ export type InitializeResponseFactory = (...args: ResponseParameters) => InitializeResponse;
5
+ export declare const initializeResponseFactoryToken: InjectionToken<InitializeResponseFactory>;
6
+ export declare const initializeResponseFactoryProvider: ValueProvider;
@@ -0,0 +1,18 @@
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 { PaymentConfig } from '../payment-config.interface';
5
+ import { InitializeResponseFactory } from './initialize-response.token';
6
+ import { InitializeResponse } from './initialize-response.class';
7
+ import * as i0 from "@angular/core";
8
+ export declare class InitializeService {
9
+ protected readonly responseFactory: InitializeResponseFactory;
10
+ private readonly secureApi;
11
+ private readonly settingsService;
12
+ private readonly countryService;
13
+ private readonly apiRoute;
14
+ constructor(responseFactory: InitializeResponseFactory, secureApi: SecureApiClient, settingsService: SettingsService, countryService: CountryService);
15
+ request(config: PaymentConfig): Promise<InitializeResponse>;
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<InitializeService, never>;
17
+ static ɵprov: i0.ɵɵInjectableDeclaration<InitializeService>;
18
+ }