@xsolla/payment-client-core 0.1.4 → 0.1.5-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 (160) hide show
  1. package/esm2020/lib/core/device-finger-print/device-finger-print.service.mjs +26 -126
  2. package/esm2020/lib/core/device-finger-print/hash.type.mjs +1 -1
  3. package/esm2020/lib/core/encrypt-credit-card/encrypt-credit-card.service.mjs +72 -0
  4. package/esm2020/lib/core/encrypt-credit-card/encrypted-card.interface.mjs +2 -0
  5. package/esm2020/lib/core/encrypt-credit-card/open-card.interface.mjs +2 -0
  6. package/esm2020/lib/core/exceptions-handling/errors/encrypt-card-error.mjs +9 -0
  7. package/esm2020/lib/core/payment/actions/check-status/check-status.action.class.mjs +2 -3
  8. package/esm2020/lib/core/payment/actions/next-action.interface.mjs +1 -1
  9. package/esm2020/lib/core/payment/actions/next-actions.mjs +3 -1
  10. package/esm2020/lib/core/payment/actions/three-ds/three-ds.action.class.mjs +7 -0
  11. package/esm2020/lib/core/payment/actions/three-ds/three-ds.action.token.mjs +11 -0
  12. package/esm2020/lib/core/payment/actions/three-ds/three-ds.action.type.mjs +2 -0
  13. package/esm2020/lib/core/payment/credit-card-payment-methods-id.variable.mjs +15 -0
  14. package/esm2020/lib/core/payment/form/controls/phone-control.config.mjs +8 -0
  15. package/esm2020/lib/core/payment/form/converters/birth-date.converter.mjs +38 -0
  16. package/esm2020/lib/core/payment/form/converters/card-expiration.converter.mjs +36 -0
  17. package/esm2020/lib/core/payment/form/converters/cardholder-name.converter.mjs +25 -0
  18. package/esm2020/lib/core/payment/form/converters/converters-map.mjs +21 -1
  19. package/esm2020/lib/core/payment/form/converters/cpf-name-regex.variable.mjs +2 -0
  20. package/esm2020/lib/core/payment/form/converters/cpf-name.converter.mjs +34 -0
  21. package/esm2020/lib/core/payment/form/converters/cpf-number.converter.mjs +31 -0
  22. package/esm2020/lib/core/payment/form/converters/cvv.converter.mjs +50 -0
  23. package/esm2020/lib/core/payment/form/converters/phone.converter.mjs +37 -0
  24. package/esm2020/lib/core/payment/form/converters/street-number/street-number-from-state.interface.mjs +2 -0
  25. package/esm2020/lib/core/payment/form/converters/street-number/street-number.converter.mjs +28 -0
  26. package/esm2020/lib/core/payment/form/converters/text.converter.mjs +19 -0
  27. package/esm2020/lib/core/payment/form/form.module.mjs +28 -1
  28. package/esm2020/lib/core/payment/form/validators/birth-date.validator.mjs +37 -0
  29. package/esm2020/lib/core/payment/form/validators/max-length-validator.mjs +6 -0
  30. package/esm2020/lib/core/payment/form/validators/min-length-validator.mjs +6 -0
  31. package/esm2020/lib/core/payment/form/validators/phone-validator.mjs +6 -0
  32. package/esm2020/lib/core/payment/initialize/initialize-request-params.interface.mjs +1 -1
  33. package/esm2020/lib/core/payment/initialize/initialize.service.mjs +28 -19
  34. package/esm2020/lib/core/payment/initialize/response/initialize-response.class.mjs +43 -0
  35. package/esm2020/lib/core/payment/initialize/response/initialize-response.token.mjs +8 -0
  36. package/esm2020/lib/core/payment/payment.interface.mjs +1 -1
  37. package/esm2020/lib/core/payment/payment.service.mjs +19 -5
  38. package/esm2020/lib/core/payment/status/check-status/check-status.service.mjs +8 -13
  39. package/esm2020/lib/core/payment/status/check-status/response/check-status-response.class.mjs +1 -1
  40. package/esm2020/lib/core/payment/submit/submit.service.mjs +13 -16
  41. package/esm2020/lib/core/payment/sync/field-async-validation.interface.mjs +1 -1
  42. package/esm2020/lib/core/payment/sync/field-sync-state.interface.mjs +1 -1
  43. package/esm2020/lib/core/payment/sync/request/sync-request.class.mjs +31 -0
  44. package/esm2020/lib/core/payment/sync/request/sync-request.token.mjs +8 -0
  45. package/esm2020/lib/core/payment/sync/response/sync-response.class.mjs +17 -0
  46. package/esm2020/lib/core/payment/sync/response/sync-response.token.mjs +8 -0
  47. package/esm2020/lib/core/payment/sync/sync.service.mjs +15 -15
  48. package/esm2020/lib/core/payment/three-ds/api/notify-dfp-status/notify-dfp-status.service.mjs +49 -0
  49. package/esm2020/lib/core/payment/three-ds/api/notify-dfp-status/request/notify-dfp-status-request.class.mjs +8 -0
  50. package/esm2020/lib/core/payment/three-ds/api/notify-dfp-status/request/notify-dfp-status-request.token.mjs +8 -0
  51. package/esm2020/lib/core/payment/three-ds/api/status-three-ds/request/status-three-ds-request.class.mjs +7 -0
  52. package/esm2020/lib/core/payment/three-ds/api/status-three-ds/request/status-three-ds-request.token.mjs +8 -0
  53. package/esm2020/lib/core/payment/three-ds/api/status-three-ds/response/status-three-ds-response.class.mjs +7 -0
  54. package/esm2020/lib/core/payment/three-ds/api/status-three-ds/response/status-three-ds-response.token.mjs +8 -0
  55. package/esm2020/lib/core/payment/three-ds/api/status-three-ds/status-three-ds-response.interface.mjs +2 -0
  56. package/esm2020/lib/core/payment/three-ds/api/status-three-ds/status-three-ds.service.mjs +60 -0
  57. package/esm2020/lib/core/payment/three-ds/api/status-three-ds/status-types.enum.mjs +7 -0
  58. package/esm2020/lib/core/payment/three-ds/api/status-three-ds/three-ds-checkout-form.interface.mjs +2 -0
  59. package/esm2020/lib/core/payment/three-ds/dfp-collect/dfp-collect.service.mjs +105 -0
  60. package/esm2020/lib/core/payment/three-ds/reinsurance-check/reinsurance-check.service.mjs +41 -0
  61. package/esm2020/lib/core/payment/three-ds/reinsurance-check/timer.interface.mjs +2 -0
  62. package/esm2020/lib/core/payment/three-ds/three-ds-20/status-update.interface.mjs +2 -0
  63. package/esm2020/lib/core/payment/three-ds/three-ds-20/three-ds20.service.mjs +109 -0
  64. package/esm2020/lib/core/payment/three-ds/three-ds-form.interface.mjs +2 -0
  65. package/esm2020/lib/core/payment/three-ds/three-ds-status-websocket-types.enum.mjs +5 -0
  66. package/esm2020/lib/core/payment/three-ds/three-ds.service.mjs +40 -0
  67. package/esm2020/lib/core/payment/xps-api/xps-api.service.mjs +79 -0
  68. package/esm2020/lib/core/payment/xps-request-params.interface.mjs +2 -0
  69. package/esm2020/lib/core/payment/xps-request.interface.mjs +2 -0
  70. package/esm2020/lib/core/payment/xps-response.error.mjs +7 -0
  71. package/esm2020/lib/core/payment/xps-response.interface.mjs +1 -1
  72. package/esm2020/lib/core-library.module.mjs +13 -4
  73. package/esm2020/lib/core-library.service.mjs +2 -2
  74. package/fesm2015/xsolla-payment-client-core.mjs +1899 -1057
  75. package/fesm2015/xsolla-payment-client-core.mjs.map +1 -1
  76. package/fesm2020/xsolla-payment-client-core.mjs +1852 -1017
  77. package/fesm2020/xsolla-payment-client-core.mjs.map +1 -1
  78. package/lib/core/device-finger-print/device-finger-print.service.d.ts +3 -31
  79. package/lib/core/device-finger-print/hash.type.d.ts +1 -1
  80. package/lib/core/encrypt-credit-card/encrypt-credit-card.service.d.ts +16 -0
  81. package/lib/core/encrypt-credit-card/encrypted-card.interface.d.ts +6 -0
  82. package/lib/core/encrypt-credit-card/open-card.interface.d.ts +6 -0
  83. package/lib/core/exceptions-handling/errors/encrypt-card-error.d.ts +5 -0
  84. package/lib/core/payment/actions/next-action.interface.d.ts +2 -1
  85. package/lib/core/payment/actions/three-ds/three-ds.action.class.d.ts +8 -0
  86. package/lib/core/payment/actions/three-ds/three-ds.action.token.d.ts +4 -0
  87. package/lib/core/payment/actions/three-ds/three-ds.action.type.d.ts +5 -0
  88. package/lib/core/payment/credit-card-payment-methods-id.variable.d.ts +6 -0
  89. package/lib/core/payment/form/controls/phone-control.config.d.ts +6 -0
  90. package/lib/core/payment/form/converters/birth-date.converter.d.ts +13 -0
  91. package/lib/core/payment/form/converters/card-expiration.converter.d.ts +16 -0
  92. package/lib/core/payment/form/converters/cardholder-name.converter.d.ts +13 -0
  93. package/lib/core/payment/form/converters/cpf-name-regex.variable.d.ts +1 -0
  94. package/lib/core/payment/form/converters/cpf-name.converter.d.ts +13 -0
  95. package/lib/core/payment/form/converters/cpf-number.converter.d.ts +11 -0
  96. package/lib/core/payment/form/converters/cvv.converter.d.ts +18 -0
  97. package/lib/core/payment/form/converters/phone.converter.d.ts +13 -0
  98. package/lib/core/payment/form/converters/street-number/street-number-from-state.interface.d.ts +3 -0
  99. package/lib/core/payment/form/converters/street-number/street-number.converter.d.ts +14 -0
  100. package/lib/core/payment/form/converters/text.converter.d.ts +11 -0
  101. package/lib/core/payment/form/validators/birth-date.validator.d.ts +2 -0
  102. package/lib/core/payment/form/validators/max-length-validator.d.ts +2 -0
  103. package/lib/core/payment/form/validators/min-length-validator.d.ts +2 -0
  104. package/lib/core/payment/form/validators/phone-validator.d.ts +2 -0
  105. package/lib/core/payment/initialize/initialize-request-params.interface.d.ts +1 -0
  106. package/lib/core/payment/initialize/initialize.service.d.ts +8 -6
  107. package/lib/core/payment/initialize/{initialize-response.class.d.ts → response/initialize-response.class.d.ts} +2 -2
  108. package/lib/core/payment/payment.interface.d.ts +2 -2
  109. package/lib/core/payment/payment.service.d.ts +4 -2
  110. package/lib/core/payment/status/check-status/check-status.service.d.ts +3 -4
  111. package/lib/core/payment/submit/submit.service.d.ts +5 -4
  112. package/lib/core/payment/sync/field-async-validation.interface.d.ts +1 -1
  113. package/lib/core/payment/sync/field-sync-state.interface.d.ts +1 -1
  114. package/lib/core/payment/sync/{sync-request.class.d.ts → request/sync-request.class.d.ts} +3 -3
  115. package/lib/core/payment/sync/{sync-response.class.d.ts → response/sync-response.class.d.ts} +2 -2
  116. package/lib/core/payment/sync/sync.service.d.ts +8 -7
  117. package/lib/core/payment/three-ds/api/notify-dfp-status/notify-dfp-status.service.d.ts +14 -0
  118. package/lib/core/payment/three-ds/api/notify-dfp-status/request/notify-dfp-status-request.class.d.ts +10 -0
  119. package/lib/core/payment/three-ds/api/notify-dfp-status/request/notify-dfp-status-request.token.d.ts +6 -0
  120. package/lib/core/payment/three-ds/api/status-three-ds/request/status-three-ds-request.class.d.ts +5 -0
  121. package/lib/core/payment/three-ds/api/status-three-ds/request/status-three-ds-request.token.d.ts +6 -0
  122. package/lib/core/payment/three-ds/api/status-three-ds/response/status-three-ds-response.class.d.ts +7 -0
  123. package/lib/core/payment/three-ds/api/status-three-ds/response/status-three-ds-response.token.d.ts +6 -0
  124. package/lib/core/payment/three-ds/api/status-three-ds/status-three-ds-response.interface.d.ts +7 -0
  125. package/lib/core/payment/three-ds/api/status-three-ds/status-three-ds.service.d.ts +21 -0
  126. package/lib/core/payment/three-ds/api/status-three-ds/status-types.enum.d.ts +5 -0
  127. package/lib/core/payment/three-ds/api/status-three-ds/three-ds-checkout-form.interface.d.ts +7 -0
  128. package/lib/core/payment/three-ds/dfp-collect/dfp-collect.service.d.ts +20 -0
  129. package/lib/core/payment/three-ds/reinsurance-check/reinsurance-check.service.d.ts +12 -0
  130. package/lib/core/payment/three-ds/reinsurance-check/timer.interface.d.ts +9 -0
  131. package/lib/core/payment/three-ds/three-ds-20/status-update.interface.d.ts +12 -0
  132. package/lib/core/payment/three-ds/three-ds-20/three-ds20.service.d.ts +32 -0
  133. package/lib/core/payment/three-ds/three-ds-form.interface.d.ts +11 -0
  134. package/lib/core/payment/three-ds/three-ds-status-websocket-types.enum.d.ts +3 -0
  135. package/lib/core/payment/three-ds/three-ds.service.d.ts +14 -0
  136. package/lib/core/payment/xps-api/xps-api.service.d.ts +20 -0
  137. package/lib/core/payment/xps-request-params.interface.d.ts +3 -0
  138. package/lib/core/payment/xps-request.interface.d.ts +10 -0
  139. package/lib/core/payment/xps-response.error.d.ts +4 -0
  140. package/lib/core/payment/xps-response.interface.d.ts +2 -10
  141. package/package.json +2 -3
  142. package/xsolla-payment-client-core-0.1.5-2.tgz +0 -0
  143. package/esm2020/lib/core/device-finger-print/device-finger-print-components.interface.mjs +0 -2
  144. package/esm2020/lib/core/device-finger-print/fingerprint-js.interface.mjs +0 -2
  145. package/esm2020/lib/core/exceptions-handling/errors/default-terminal-error.class.mjs +0 -8
  146. package/esm2020/lib/core/payment/initialize/initialize-response.class.mjs +0 -43
  147. package/esm2020/lib/core/payment/initialize/initialize-response.token.mjs +0 -8
  148. package/esm2020/lib/core/payment/sync/sync-request.class.mjs +0 -31
  149. package/esm2020/lib/core/payment/sync/sync-request.token.mjs +0 -8
  150. package/esm2020/lib/core/payment/sync/sync-response.class.mjs +0 -17
  151. package/esm2020/lib/core/payment/sync/sync-response.token.mjs +0 -8
  152. package/esm2020/lib/core/payment/xps-request.abstract.mjs +0 -8
  153. package/lib/core/device-finger-print/device-finger-print-components.interface.d.ts +0 -4
  154. package/lib/core/device-finger-print/fingerprint-js.interface.d.ts +0 -6
  155. package/lib/core/exceptions-handling/errors/default-terminal-error.class.d.ts +0 -4
  156. package/lib/core/payment/xps-request.abstract.d.ts +0 -6
  157. package/xsolla-payment-client-core-0.1.4.tgz +0 -0
  158. /package/lib/core/payment/initialize/{initialize-response.token.d.ts → response/initialize-response.token.d.ts} +0 -0
  159. /package/lib/core/payment/sync/{sync-request.token.d.ts → request/sync-request.token.d.ts} +0 -0
  160. /package/lib/core/payment/sync/{sync-response.token.d.ts → response/sync-response.token.d.ts} +0 -0
@@ -1,44 +1,16 @@
1
- import { SecureApiClient } from '../http/secure-api/secure-api.service';
2
1
  import { SettingsService } from '../settings/settings.service';
3
- import { ExtendedWindow } from '../extended-window.interface';
4
2
  import * as i0 from "@angular/core";
5
3
  export declare class DeviceFingerPrintService {
6
- private readonly secureApi;
7
4
  private readonly settingsService;
8
- private readonly window;
9
5
  private hash;
10
- private readonly apiRoute;
11
- private fingerprintJs;
12
6
  private antifraudFingerprintLibrary;
13
- private readonly fingerprintApiUrl;
14
- constructor(secureApi: SecureApiClient, settingsService: SettingsService, window: ExtendedWindow);
15
- init(): Promise<void>;
7
+ constructor(settingsService: SettingsService);
8
+ init(): void;
16
9
  getHash(): Promise<string>;
17
- private loadFingerprintJs;
18
10
  private loadAntifraudFingerprintLibrary;
19
- private makeAntifraudFingerprint;
20
- /**
21
- *Загружаем библиотеку, генерируем данные,
22
- *хешируем с помощью BASE64 и отправляем на бэкенд,
23
- *в ответ получаем dfp_hash.
24
- **/
25
11
  private buildHash;
26
- /**
27
- *Новая версия библиотеки содержит не все компоненты, некоторые приходится имплементировать самостоятельно
28
- **/
29
- private getHasLiedResolution;
30
- /**
31
- *Бэкенд заточен под конкретные поля, которые необходимо смапить.
32
- **/
33
- private getComponents;
34
- /**
35
- * Получаем данные dfp с помощью FingerprintJS, мапим необходимые поля, добавляем хэш
36
- **/
37
12
  private generate;
38
- /**
39
- * Отправка dfp на сервер, в ответ получаем dfp_hash
40
- **/
41
- private send;
13
+ private makeAntifraudFingerprint;
42
14
  static ɵfac: i0.ɵɵFactoryDeclaration<DeviceFingerPrintService, never>;
43
15
  static ɵprov: i0.ɵɵInjectableDeclaration<DeviceFingerPrintService>;
44
16
  }
@@ -1,3 +1,3 @@
1
1
  export type Hash = {
2
- '200': string;
2
+ '301': string;
3
3
  } | null;
@@ -0,0 +1,16 @@
1
+ import { XpsApiPartRequest } from '../payment/xps-api-part-request.abstract';
2
+ import { CreditCardService } from '../credit-card/credit-card.service';
3
+ import * as i0 from "@angular/core";
4
+ export declare class EncryptCreditCardService {
5
+ private readonly creditCardService;
6
+ private readonly jsEncrypt;
7
+ private readonly secureFieldNames;
8
+ constructor(creditCardService: CreditCardService);
9
+ setPublicKey(publicKey: string): void;
10
+ encryptCreditCard<T extends XpsApiPartRequest>(request: XpsApiPartRequest): T;
11
+ private encrypt;
12
+ private createEncryptedCard;
13
+ private createOpenCard;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<EncryptCreditCardService, never>;
15
+ static ɵprov: i0.ɵɵInjectableDeclaration<EncryptCreditCardService>;
16
+ }
@@ -0,0 +1,6 @@
1
+ export interface EncryptedCard {
2
+ card_number: string;
3
+ card_year: string;
4
+ card_month: string;
5
+ cvv: string;
6
+ }
@@ -0,0 +1,6 @@
1
+ export interface OpenCard {
2
+ card_bin: string;
3
+ card_suffix: string;
4
+ card_year: string;
5
+ card_month: string;
6
+ }
@@ -0,0 +1,5 @@
1
+ import { TaggedError } from './tagged-error.class';
2
+ import { ErrorTags } from './elk-error-types.enum';
3
+ export declare class EncryptCreditCardError extends TaggedError {
4
+ constructor(message: string, tags?: ErrorTags[]);
5
+ }
@@ -3,4 +3,5 @@ import { ShowFieldsAction } from './show-fields/show-fields.action.type';
3
3
  import { StatusUpdatedAction } from './status-updated/status-updated.action.type';
4
4
  import { RedirectAction } from './redirect/redirect.action.type';
5
5
  import { ShowErrorsAction } from './show-errors/show-errors.action.type';
6
- export type NextAction = CheckStatusAction | ShowFieldsAction | StatusUpdatedAction | ShowErrorsAction | RedirectAction;
6
+ import { ThreeDsAction } from './three-ds/three-ds.action.type';
7
+ export type NextAction = CheckStatusAction | ShowFieldsAction | StatusUpdatedAction | ShowErrorsAction | RedirectAction | ThreeDsAction;
@@ -0,0 +1,8 @@
1
+ import { Action } from '../action.interface';
2
+ import { ThreeDsActionData, ThreeDsActionType } from './three-ds.action.type';
3
+ import { StatusChallenge } from '../../three-ds/three-ds-20/status-update.interface';
4
+ export declare class ThreeDsAction implements Action {
5
+ type: ThreeDsActionType;
6
+ data: ThreeDsActionData;
7
+ constructor(statusUpdate: StatusChallenge);
8
+ }
@@ -0,0 +1,4 @@
1
+ import { InjectionToken, ValueProvider } from '@angular/core';
2
+ import { ActionFactoryValue } from '../action-factory-value.interface';
3
+ export declare const threeDsActionFactoryToken: InjectionToken<ActionFactoryValue>;
4
+ export declare const threeDsActionFactoryProvider: ValueProvider;
@@ -0,0 +1,5 @@
1
+ import { Action } from '../action.interface';
2
+ import { StatusChallenge } from '../../three-ds/three-ds-20/status-update.interface';
3
+ export type ThreeDsActionType = '3DS';
4
+ export type ThreeDsActionData = StatusChallenge;
5
+ export type ThreeDsAction = Action<ThreeDsActionType, ThreeDsActionData>;
@@ -0,0 +1,6 @@
1
+ export declare const masterCardAndVisaPaymentMethodId = 26;
2
+ export declare const maestroPaymentMethodId = 490;
3
+ export declare const creditCardPaymentMethodId = 1380;
4
+ export declare const americanExpressMethodId = 714;
5
+ export declare const specialCards: number[];
6
+ export declare const cardsWith3ds: number[];
@@ -0,0 +1,6 @@
1
+ import { ControlConfig } from './control-config';
2
+ export declare class PhoneControlConfig extends ControlConfig {
3
+ controlType: string;
4
+ placeholder?: string;
5
+ icon?: string;
6
+ }
@@ -0,0 +1,13 @@
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 BirthDateConverter extends Converter {
8
+ constructor(syncService: SyncService);
9
+ getValidators(field: Field): ValidatorFn[];
10
+ protected createControlConfig(field: Field): TextControlConfig;
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<BirthDateConverter, never>;
12
+ static ɵprov: i0.ɵɵInjectableDeclaration<BirthDateConverter>;
13
+ }
@@ -0,0 +1,16 @@
1
+ import { Converter } from './converter.abstract';
2
+ import { SyncService } from '../../sync/sync.service';
3
+ import { ValidatorFn } from '@angular/forms';
4
+ import { Field } from '../../field.interface';
5
+ import { FormState } from '../form-state.interface';
6
+ import { TextControlConfig } from '../controls/text-control.config';
7
+ import * as i0 from "@angular/core";
8
+ export declare class CardExpirationConverter extends Converter {
9
+ constructor(syncService: SyncService);
10
+ getValidators(): ValidatorFn[];
11
+ protected createControlConfig(field: Field, formState: FormState): TextControlConfig;
12
+ protected getAutocomplete(): string;
13
+ protected getDataType(): string;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<CardExpirationConverter, never>;
15
+ static ɵprov: i0.ɵɵInjectableDeclaration<CardExpirationConverter>;
16
+ }
@@ -0,0 +1,13 @@
1
+ import { Field } from '../../field.interface';
2
+ import { SyncService } from '../../sync/sync.service';
3
+ import { TextControlConfig } from '../controls/text-control.config';
4
+ import { Converter } from './converter.abstract';
5
+ import * as i0 from "@angular/core";
6
+ export declare class CardholderNameConverter extends Converter {
7
+ constructor(syncService: SyncService);
8
+ protected createControlConfig(field: Field): TextControlConfig;
9
+ protected getAutocomplete(): string;
10
+ protected getDataType(): string;
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<CardholderNameConverter, never>;
12
+ static ɵprov: i0.ɵɵInjectableDeclaration<CardholderNameConverter>;
13
+ }
@@ -0,0 +1 @@
1
+ export declare const cpfNameRegex: RegExp;
@@ -0,0 +1,13 @@
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 CpfNameConverter extends Converter {
8
+ constructor(syncService: SyncService);
9
+ getValidators(field: Field): ValidatorFn[];
10
+ protected createControlConfig(field: Field): TextControlConfig;
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<CpfNameConverter, never>;
12
+ static ɵprov: i0.ɵɵInjectableDeclaration<CpfNameConverter>;
13
+ }
@@ -0,0 +1,11 @@
1
+ import { Field } from '../../field.interface';
2
+ import { SyncService } from '../../sync/sync.service';
3
+ import { TextControlConfig } from '../controls/text-control.config';
4
+ import { Converter } from './converter.abstract';
5
+ import * as i0 from "@angular/core";
6
+ export declare class CpfNumberConverter extends Converter {
7
+ constructor(syncService: SyncService);
8
+ protected createControlConfig(field: Field): TextControlConfig;
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<CpfNumberConverter, never>;
10
+ static ɵprov: i0.ɵɵInjectableDeclaration<CpfNumberConverter>;
11
+ }
@@ -0,0 +1,18 @@
1
+ import { Converter } from './converter.abstract';
2
+ import { SyncService } from '../../sync/sync.service';
3
+ import { ValidatorFn } from '@angular/forms';
4
+ import { Field } from '../../field.interface';
5
+ import { FormState } from '../form-state.interface';
6
+ import { TextControlConfig } from '../controls/text-control.config';
7
+ import * as i0 from "@angular/core";
8
+ export declare class CvvConverter extends Converter {
9
+ private readonly maxFieldLength;
10
+ constructor(syncService: SyncService);
11
+ getValidators(): ValidatorFn[];
12
+ protected createControlConfig(field: Field, formState: FormState): TextControlConfig;
13
+ protected getAutocomplete(): string;
14
+ protected getDataType(): string;
15
+ protected shouldHideUserInput(): boolean;
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<CvvConverter, never>;
17
+ static ɵprov: i0.ɵɵInjectableDeclaration<CvvConverter>;
18
+ }
@@ -0,0 +1,13 @@
1
+ import { ValidatorFn } from '@angular/forms';
2
+ import { Converter } from './converter.abstract';
3
+ import { SyncService } from '../../sync/sync.service';
4
+ import { Field } from '../../field.interface';
5
+ import { PhoneControlConfig } from '../controls/phone-control.config';
6
+ import * as i0 from "@angular/core";
7
+ export declare class PhoneConverter extends Converter {
8
+ constructor(syncService: SyncService);
9
+ getValidators(field: Field): ValidatorFn[];
10
+ protected createControlConfig(field: Field): PhoneControlConfig;
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<PhoneConverter, never>;
12
+ static ɵprov: i0.ɵɵInjectableDeclaration<PhoneConverter>;
13
+ }
@@ -0,0 +1,3 @@
1
+ export interface StreetNumberFormState {
2
+ country?: string;
3
+ }
@@ -0,0 +1,14 @@
1
+ import { StreetNumberFormState } from './street-number-from-state.interface';
2
+ import { ValidatorFn } from '@angular/forms';
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 StreetNumberConverter extends Converter {
9
+ constructor(syncService: SyncService);
10
+ getValidators(field: Field, formState?: StreetNumberFormState): ValidatorFn[];
11
+ protected createControlConfig(field: Field): TextControlConfig;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<StreetNumberConverter, never>;
13
+ static ɵprov: i0.ɵɵInjectableDeclaration<StreetNumberConverter>;
14
+ }
@@ -0,0 +1,11 @@
1
+ import { Field } from '../../field.interface';
2
+ import { SyncService } from '../../sync/sync.service';
3
+ import { TextControlConfig } from '../controls/text-control.config';
4
+ import { Converter } from './converter.abstract';
5
+ import * as i0 from "@angular/core";
6
+ export declare class TextConverter extends Converter {
7
+ constructor(syncService: SyncService);
8
+ protected createControlConfig(field: Field): TextControlConfig;
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<TextConverter, never>;
10
+ static ɵprov: i0.ɵɵInjectableDeclaration<TextConverter>;
11
+ }
@@ -0,0 +1,2 @@
1
+ import { ValidatorFn } from '@angular/forms';
2
+ export declare const birthdateValidator: ValidatorFn;
@@ -0,0 +1,2 @@
1
+ import { ValidatorFn } from './validator-fn.type';
2
+ export declare function maxLengthValidator(maxLength: number): ValidatorFn;
@@ -0,0 +1,2 @@
1
+ import { ValidatorFn } from '@angular/forms';
2
+ export declare function minLengthValidator(minLength: number): ValidatorFn;
@@ -0,0 +1,2 @@
1
+ import { ValidatorFn } from './validator-fn.type';
2
+ export declare function phoneValidator(): ValidatorFn;
@@ -1,4 +1,5 @@
1
1
  export interface InitializeRequestParams {
2
+ [fieldName: `xps_${string}`]: unknown;
2
3
  access_token: string;
3
4
  pid: string;
4
5
  refer: string;
@@ -1,21 +1,23 @@
1
1
  import { CountryService } from '../../country/country.service';
2
- import { SecureApiClient } from '../../http/secure-api/secure-api.service';
2
+ import { EncryptCreditCardService } from '../../encrypt-credit-card/encrypt-credit-card.service';
3
3
  import { SettingsService } from '../../settings/settings.service';
4
4
  import { PaymentConfig } from '../payment-config.interface';
5
- import { InitializeResponseFactory } from './initialize-response.token';
6
- import { InitializeResponse } from './initialize-response.class';
7
5
  import { NextActionService } from '../actions/next-action.service';
6
+ import { XpsApiService } from '../xps-api/xps-api.service';
7
+ import { InitializeResponseFactory } from './response/initialize-response.token';
8
+ import { InitializeResponse } from './response/initialize-response.class';
8
9
  import * as i0 from "@angular/core";
9
10
  export declare class InitializeService {
10
11
  protected readonly responseFactory: InitializeResponseFactory;
11
- private readonly secureApi;
12
+ private readonly xpsApiService;
12
13
  private readonly settingsService;
13
14
  private readonly countryService;
14
15
  private readonly nextActionService;
15
- private readonly apiRoute;
16
+ private readonly encryptCreditCardService;
16
17
  private readonly ps4ReferId;
17
- constructor(responseFactory: InitializeResponseFactory, secureApi: SecureApiClient, settingsService: SettingsService, countryService: CountryService, nextActionService: NextActionService);
18
+ constructor(responseFactory: InitializeResponseFactory, xpsApiService: XpsApiService, settingsService: SettingsService, countryService: CountryService, nextActionService: NextActionService, encryptCreditCardService: EncryptCreditCardService);
18
19
  request(config: PaymentConfig): Promise<InitializeResponse>;
20
+ private setCreditCardEncryptKey;
19
21
  static ɵfac: i0.ɵɵFactoryDeclaration<InitializeService, never>;
20
22
  static ɵprov: i0.ɵɵInjectableDeclaration<InitializeService>;
21
23
  }
@@ -1,5 +1,5 @@
1
- import { PaymentForm } from '../payment-form.interface';
2
- import { XpsResponse } from '../xps-response.interface';
1
+ import { PaymentForm } from '../../payment-form.interface';
2
+ import { XpsResponse } from '../../xps-response.interface';
3
3
  export declare class InitializeResponse {
4
4
  readonly paymentForm: PaymentForm | null;
5
5
  constructor(response: XpsResponse);
@@ -1,5 +1,5 @@
1
- import { ValidationErrors } from '@angular/forms';
2
1
  import { Observable } from 'rxjs';
2
+ import { ValidationErrors } from '@angular/forms';
3
3
  import { NextAction } from './actions/next-action.interface';
4
4
  import { Status } from './status/status.interface';
5
5
  import { Field } from './field.interface';
@@ -13,7 +13,7 @@ export interface Payment {
13
13
  getFields(): Field[];
14
14
  validate(field: Field): Promise<ValidationErrors | null>;
15
15
  getFinanceDetails(): FinanceDetails | null;
16
- runThreeDs(): NextAction;
16
+ runThreeDs(): void;
17
17
  getStatus(): Promise<Status>;
18
18
  form: {
19
19
  fieldsStatus$: Observable<FormFieldsStatus>;
@@ -17,6 +17,7 @@ import { PaymentConfig } from './payment-config.interface';
17
17
  import { ValidationErrors } from './form/validators/validation-errors.interface';
18
18
  import { InputEventName } from './form/input-event.enum';
19
19
  import { FormFieldsStatus } from './form/form-fields-status.interface';
20
+ import { ThreeDsService } from './three-ds/three-ds.service';
20
21
  import { CreditCardStateService } from './credit-card-state/credit-card-state.service';
21
22
  import * as i0 from "@angular/core";
22
23
  export declare class PaymentService {
@@ -29,6 +30,7 @@ export declare class PaymentService {
29
30
  private readonly creditCardStateService;
30
31
  private readonly nextActionService;
31
32
  private readonly controlConfigService;
33
+ private readonly threeDsService;
32
34
  form: UntypedFormGroup | null;
33
35
  get formFieldsStatus$(): Observable<FormFieldsStatus>;
34
36
  private data;
@@ -39,12 +41,12 @@ export declare class PaymentService {
39
41
  private destroy$;
40
42
  private formDestroy$;
41
43
  private readonly formFieldsStatusSubject;
42
- constructor(initializeService: InitializeService, submitService: SubmitService, syncService: SyncService, formService: FormService, statusService: StatusService, financeDetailsService: FinanceDetailsService, creditCardStateService: CreditCardStateService, nextActionService: NextActionService, controlConfigService: ControlConfigService);
44
+ constructor(initializeService: InitializeService, submitService: SubmitService, syncService: SyncService, formService: FormService, statusService: StatusService, financeDetailsService: FinanceDetailsService, creditCardStateService: CreditCardStateService, nextActionService: NextActionService, controlConfigService: ControlConfigService, threeDsService: ThreeDsService);
43
45
  initialize(config: PaymentConfig): Promise<Field[]>;
44
46
  submit(): Promise<NextAction | null | void>;
45
47
  getFields(): Field[];
46
48
  validate(field: Field): Promise<ValidationErrors | null>;
47
- runThreeDs(): NextAction;
49
+ runThreeDs(): void;
48
50
  getFinanceDetails(): FinanceDetails | null;
49
51
  getStatus(): Promise<Status>;
50
52
  getFieldConfig(field: Field): ControlConfig | null;
@@ -1,18 +1,17 @@
1
- import { SecureApiClient } from '../../../http/secure-api/secure-api.service';
2
1
  import { SettingsService } from '../../../settings/settings.service';
3
2
  import { CheckStatusRequestFactory } from './request/check-status-request.token';
4
3
  import { CheckStatusResponseFactory } from './response/check-status-response.token';
5
4
  import { XpsApiPart } from '../../xps-api-part.abstract';
5
+ import { XpsApiService } from '../../xps-api/xps-api.service';
6
6
  import { CheckStatusResponse } from './response/check-status-response.class';
7
7
  import * as i0 from "@angular/core";
8
8
  export declare class CheckStatusService extends XpsApiPart<CheckStatusResponse> {
9
- private readonly secureApiClient;
9
+ private readonly xpsApiService;
10
10
  private readonly settingsService;
11
11
  private readonly requestFactory;
12
12
  private readonly responseFactory;
13
- private readonly apiRoute;
14
13
  private invoice;
15
- constructor(secureApiClient: SecureApiClient, settingsService: SettingsService, requestFactory: CheckStatusRequestFactory, responseFactory: CheckStatusResponseFactory);
14
+ constructor(xpsApiService: XpsApiService, settingsService: SettingsService, requestFactory: CheckStatusRequestFactory, responseFactory: CheckStatusResponseFactory);
16
15
  setRequestParams(invoice: number): void;
17
16
  request(): void;
18
17
  static ɵfac: i0.ɵɵFactoryDeclaration<CheckStatusService, never>;
@@ -5,16 +5,17 @@ import { SettingsService } from '../../settings/settings.service';
5
5
  import { SubmitResponse } from './response/submit-response.class';
6
6
  import { UntypedFormGroup } from '@angular/forms';
7
7
  import { DeviceFingerPrintService } from '../../device-finger-print/device-finger-print.service';
8
- import { SecureApiClient } from '../../http/secure-api/secure-api.service';
8
+ import { XpsApiService } from '../xps-api/xps-api.service';
9
+ import { EncryptCreditCardService } from '../../encrypt-credit-card/encrypt-credit-card.service';
9
10
  import * as i0 from "@angular/core";
10
11
  export declare class SubmitService {
11
12
  private readonly requestFactory;
12
13
  private readonly responseFactory;
13
14
  private readonly settingsService;
14
15
  private readonly deviceFingerPrintService;
15
- private readonly secureApi;
16
- private readonly directPaymentApiRoute;
17
- constructor(requestFactory: SubmitRequestFactory, responseFactory: SubmitResponseFactory, settingsService: SettingsService, deviceFingerPrintService: DeviceFingerPrintService, secureApi: SecureApiClient);
16
+ private readonly xpsApiService;
17
+ private readonly encryptCreditCardService;
18
+ constructor(requestFactory: SubmitRequestFactory, responseFactory: SubmitResponseFactory, settingsService: SettingsService, deviceFingerPrintService: DeviceFingerPrintService, xpsApiService: XpsApiService, encryptCreditCardService: EncryptCreditCardService);
18
19
  request(fields: Field[], form: UntypedFormGroup): Promise<SubmitResponse>;
19
20
  static ɵfac: i0.ɵɵFactoryDeclaration<SubmitService, never>;
20
21
  static ɵprov: i0.ɵɵInjectableDeclaration<SubmitService>;
@@ -1,5 +1,5 @@
1
1
  import { Field } from '../field.interface';
2
- import { SyncResponse } from './sync-response.class';
2
+ import { SyncResponse } from './response/sync-response.class';
3
3
  export interface FieldAsyncValidation {
4
4
  value: unknown;
5
5
  field: Field;
@@ -1,4 +1,4 @@
1
- import { SyncResponse } from './sync-response.class';
1
+ import { SyncResponse } from './response/sync-response.class';
2
2
  export interface FieldSyncState {
3
3
  value: unknown;
4
4
  result: Promise<SyncResponse | null>;
@@ -1,7 +1,7 @@
1
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 {
2
+ import { Field } from '../../field.interface';
3
+ import { XpsApiPartRequest } from '../../xps-api-part-request.abstract';
4
+ export declare class SyncRequest extends XpsApiPartRequest {
5
5
  readonly access_token: string;
6
6
  readonly xps_fix_command = "calculate";
7
7
  constructor(parameters: {
@@ -1,6 +1,6 @@
1
1
  import { ValidationErrors } from '@angular/forms';
2
- import { Field } from '../field.interface';
3
- import { XpsResponse } from '../xps-response.interface';
2
+ import { Field } from '../../field.interface';
3
+ import { XpsResponse } from '../../xps-response.interface';
4
4
  export declare class SyncResponse {
5
5
  readonly error: ValidationErrors | null;
6
6
  readonly fields: Field[];
@@ -1,28 +1,29 @@
1
1
  import { UntypedFormGroup, ValidationErrors } from '@angular/forms';
2
2
  import { Observable } from 'rxjs';
3
- import { SecureApiClient } from '../../http/secure-api/secure-api.service';
4
3
  import { SettingsService } from '../../settings/settings.service';
5
4
  import { EmitDataService } from '../emit-data.service.abstract';
6
5
  import { Field } from '../field.interface';
7
6
  import { XpsResponse } from '../xps-response.interface';
8
- import { SyncRequestFactory } from './sync-request.token';
9
- import { SyncResponse } from './sync-response.class';
10
- import { SyncResponseFactory } from './sync-response.token';
7
+ import { SyncRequestFactory } from './request/sync-request.token';
8
+ import { SyncResponse } from './response/sync-response.class';
9
+ import { SyncResponseFactory } from './response/sync-response.token';
11
10
  import { NextActionService } from '../actions/next-action.service';
11
+ import { XpsApiService } from '../xps-api/xps-api.service';
12
12
  import { FieldAsyncValidation } from './field-async-validation.interface';
13
+ import { EncryptCreditCardService } from '../../encrypt-credit-card/encrypt-credit-card.service';
13
14
  import * as i0 from "@angular/core";
14
15
  export declare class SyncService extends EmitDataService<XpsResponse> {
15
16
  private readonly requestFactory;
16
17
  private readonly responseFactory;
17
- private readonly secureApi;
18
+ private readonly xpsApiService;
18
19
  private readonly nextActionService;
19
20
  private readonly settingsService;
20
- private readonly apiRoute;
21
+ private readonly encryptCreditCardService;
21
22
  private prevFieldSyncStates;
22
23
  private form;
23
24
  private fields;
24
25
  private readonly fieldAsyncValidation;
25
- constructor(requestFactory: SyncRequestFactory, responseFactory: SyncResponseFactory, secureApi: SecureApiClient, nextActionService: NextActionService, settingsService: SettingsService);
26
+ constructor(requestFactory: SyncRequestFactory, responseFactory: SyncResponseFactory, xpsApiService: XpsApiService, nextActionService: NextActionService, settingsService: SettingsService, encryptCreditCardService: EncryptCreditCardService);
26
27
  get fieldAsyncValidation$(): Observable<FieldAsyncValidation>;
27
28
  setup(form: UntypedFormGroup, fields: Field[]): void;
28
29
  reset(): void;
@@ -0,0 +1,14 @@
1
+ import { SecureApiClient } from '../../../../http/secure-api/secure-api.service';
2
+ import { SettingsService } from '../../../../settings/settings.service';
3
+ import { NotifyDfpStatusRequestFactory } from './request/notify-dfp-status-request.token';
4
+ import * as i0 from "@angular/core";
5
+ export declare class NotifyDfpStatusService {
6
+ private readonly secureApi;
7
+ private readonly settingsService;
8
+ private readonly requestFactory;
9
+ private readonly apiRouteComplete;
10
+ constructor(secureApi: SecureApiClient, settingsService: SettingsService, requestFactory: NotifyDfpStatusRequestFactory);
11
+ request(threeDsId: string, isCompind: boolean): void;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<NotifyDfpStatusService, never>;
13
+ static ɵprov: i0.ɵɵInjectableDeclaration<NotifyDfpStatusService>;
14
+ }
@@ -0,0 +1,10 @@
1
+ export declare class NotifyDfpStatusRequest {
2
+ readonly access_token: string;
3
+ readonly threeDSTrXid: string;
4
+ readonly secure3dCompind: 'Y' | 'N';
5
+ constructor(params: {
6
+ token: string;
7
+ threeDsTrXid: string;
8
+ isCompind: boolean;
9
+ });
10
+ }
@@ -0,0 +1,6 @@
1
+ import { InjectionToken, ValueProvider } from '@angular/core';
2
+ import { NotifyDfpStatusRequest } from './notify-dfp-status-request.class';
3
+ export type NotifyDfpStatusRequestParameters = ConstructorParameters<typeof NotifyDfpStatusRequest>;
4
+ export type NotifyDfpStatusRequestFactory = (...args: NotifyDfpStatusRequestParameters) => NotifyDfpStatusRequest;
5
+ export declare const notifyDfpStatusRequestFactoryToken: InjectionToken<NotifyDfpStatusRequestFactory>;
6
+ export declare const notifyDfpStatusRequestFactoryProvider: ValueProvider;
@@ -0,0 +1,5 @@
1
+ export declare class StatusThreeDsRequest {
2
+ readonly access_token: string;
3
+ readonly threeDSTrXid: string;
4
+ constructor(token: string, threeDsId: string);
5
+ }
@@ -0,0 +1,6 @@
1
+ import { InjectionToken, ValueProvider } from '@angular/core';
2
+ import { StatusThreeDsRequest } from './status-three-ds-request.class';
3
+ export type StatusThreeDsRequestParameters = ConstructorParameters<typeof StatusThreeDsRequest>;
4
+ export type StatusThreeDsRequestFactory = (...args: StatusThreeDsRequestParameters) => StatusThreeDsRequest;
5
+ export declare const statusThreeDsRequestFactoryToken: InjectionToken<StatusThreeDsRequestFactory>;
6
+ export declare const statusThreeDsRequestFactoryProvider: ValueProvider;
@@ -0,0 +1,7 @@
1
+ import { ThreeDsCheckoutForm } from '../three-ds-checkout-form.interface';
2
+ import { Properties } from '../../../../../properties.type';
3
+ export declare class StatusThreeDsResponse {
4
+ readonly status: string;
5
+ readonly checkoutForm?: ThreeDsCheckoutForm;
6
+ constructor(params: Properties<StatusThreeDsResponse>);
7
+ }
@@ -0,0 +1,6 @@
1
+ import { InjectionToken, ValueProvider } from '@angular/core';
2
+ import { StatusThreeDsResponse } from './status-three-ds-response.class';
3
+ export type StatusThreeDsResponseParameters = ConstructorParameters<typeof StatusThreeDsResponse>;
4
+ export type StatusThreeDsResponseFactory = (...args: StatusThreeDsResponseParameters) => StatusThreeDsResponse;
5
+ export declare const statusThreeDsResponseFactoryToken: InjectionToken<StatusThreeDsResponseFactory>;
6
+ export declare const statusThreeDsResponseFactoryProvider: ValueProvider;
@@ -0,0 +1,7 @@
1
+ import { ThreeDsCheckoutForm } from './three-ds-checkout-form.interface';
2
+ export interface StatusThreeDsResponseApi {
3
+ secure3d: {
4
+ status: string;
5
+ checkout_form?: ThreeDsCheckoutForm;
6
+ };
7
+ }