@xsolla/payment-client-core 0.0.4 → 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 (144) 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/payment/actions/action-factory-value.interface.mjs +2 -0
  9. package/esm2020/lib/core/payment/actions/action-type-command.map.mjs +5 -0
  10. package/esm2020/lib/core/payment/actions/action.interface.mjs +2 -0
  11. package/esm2020/lib/core/payment/actions/check-status/check-status.action.type.mjs +2 -0
  12. package/esm2020/lib/core/payment/actions/next-action.interface.mjs +2 -0
  13. package/esm2020/lib/core/payment/actions/next-action.service.mjs +47 -0
  14. package/esm2020/lib/core/payment/actions/next-actions.mjs +5 -0
  15. package/esm2020/lib/core/payment/actions/show-fields/show-fields.action.class.mjs +16 -0
  16. package/esm2020/lib/core/payment/actions/show-fields/show-fields.action.token.mjs +11 -0
  17. package/esm2020/lib/core/payment/actions/show-fields/show-fields.action.type.mjs +2 -0
  18. package/esm2020/lib/core/payment/field-names.enum.mjs +64 -0
  19. package/esm2020/lib/core/payment/field.interface.mjs +1 -1
  20. package/esm2020/lib/core/payment/form/common-control-config.interface.mjs +2 -0
  21. package/esm2020/lib/core/payment/form/controls/control-config.mjs +6 -0
  22. package/esm2020/lib/core/payment/form/controls/control-config.service.mjs +39 -0
  23. package/esm2020/lib/core/payment/form/controls/control-type.type.mjs +2 -0
  24. package/esm2020/lib/core/payment/form/controls/text-control.config.mjs +8 -0
  25. package/esm2020/lib/core/payment/form/converters/converter.abstract.mjs +75 -0
  26. package/esm2020/lib/core/payment/form/converters/converters-map.interface.mjs +2 -0
  27. package/esm2020/lib/core/payment/form/converters/converters-map.mjs +9 -0
  28. package/esm2020/lib/core/payment/form/converters/email.converter.mjs +29 -0
  29. package/esm2020/lib/core/payment/form/converters/zip.converter.mjs +64 -0
  30. package/esm2020/lib/core/payment/form/form-state.interface.mjs +2 -0
  31. package/esm2020/lib/core/payment/form/form.module.mjs +33 -0
  32. package/esm2020/lib/core/payment/form/form.service.mjs +28 -0
  33. package/esm2020/lib/core/payment/form/validators/convert.function.mjs +22 -0
  34. package/esm2020/lib/core/payment/form/validators/email-validator.mjs +7 -0
  35. package/esm2020/lib/core/payment/form/validators/required-validator.mjs +6 -0
  36. package/esm2020/lib/core/payment/form/validators/restricted-value.validator.mjs +6 -0
  37. package/esm2020/lib/core/payment/form/validators/validation-error.interface.mjs +2 -0
  38. package/esm2020/lib/core/payment/form/validators/validation-errors.interface.mjs +2 -0
  39. package/esm2020/lib/core/payment/form/validators/validator-fn.type.mjs +2 -0
  40. package/esm2020/lib/core/payment/initialize/initialize-request-params.interface.mjs +2 -0
  41. package/esm2020/lib/core/payment/initialize/initialize-response.class.mjs +43 -0
  42. package/esm2020/lib/core/payment/initialize/initialize-response.token.mjs +8 -0
  43. package/esm2020/lib/core/payment/initialize/initialize.service.mjs +46 -0
  44. package/esm2020/lib/core/payment/payment-form.interface.mjs +2 -0
  45. package/esm2020/lib/core/payment/payment.interface.mjs +1 -1
  46. package/esm2020/lib/core/payment/payment.service.mjs +29 -12
  47. package/esm2020/lib/core/payment/submit/request/submit-request.class.mjs +16 -0
  48. package/esm2020/lib/core/payment/submit/request/submit-request.token.mjs +8 -0
  49. package/esm2020/lib/core/payment/submit/response/submit-response.class.mjs +31 -0
  50. package/esm2020/lib/core/payment/submit/response/submit-response.token.mjs +8 -0
  51. package/esm2020/lib/core/payment/submit/submit.service.mjs +59 -0
  52. package/esm2020/lib/core/payment/sync/field-sync-state.interface.mjs +2 -0
  53. package/esm2020/lib/core/payment/sync/sync-request.class.mjs +31 -0
  54. package/esm2020/lib/core/payment/sync/sync-request.token.mjs +8 -0
  55. package/esm2020/lib/core/payment/sync/sync-response.class.mjs +14 -0
  56. package/esm2020/lib/core/payment/sync/sync-response.token.mjs +8 -0
  57. package/esm2020/lib/core/payment/sync/sync.service.mjs +91 -0
  58. package/esm2020/lib/core/payment/xps-api-part-request.abstract.mjs +8 -0
  59. package/esm2020/lib/core/payment/xps-error.interface.mjs +1 -1
  60. package/esm2020/lib/core/payment/xps-request.abstract.mjs +8 -0
  61. package/esm2020/lib/core/payment/xps-response.interface.mjs +1 -1
  62. package/esm2020/lib/core/xps-boolean.enum.mjs +2 -0
  63. package/esm2020/lib/core-library.module.mjs +31 -4
  64. package/esm2020/lib/core-library.service.mjs +14 -10
  65. package/fesm2015/xsolla-payment-client-core.mjs +1093 -83
  66. package/fesm2015/xsolla-payment-client-core.mjs.map +1 -1
  67. package/fesm2020/xsolla-payment-client-core.mjs +1047 -79
  68. package/fesm2020/xsolla-payment-client-core.mjs.map +1 -1
  69. package/lib/core/device-finger-print/device-finger-print-components.interface.d.ts +4 -0
  70. package/lib/core/device-finger-print/device-finger-print.service.d.ts +44 -0
  71. package/lib/core/device-finger-print/fingerprint-js.interface.d.ts +6 -0
  72. package/lib/core/device-finger-print/hash.type.d.ts +3 -0
  73. package/lib/core/exceptions-handling/errors/default-terminal-error.class.d.ts +4 -0
  74. package/lib/core/exceptions-handling/errors/terminal-error.class.d.ts +5 -0
  75. package/lib/core/exceptions-handling/errors/token-error.class.d.ts +4 -0
  76. package/lib/core/payment/actions/action-factory-value.interface.d.ts +5 -0
  77. package/lib/core/payment/actions/action-type-command.map.d.ts +4 -0
  78. package/lib/core/payment/actions/{check-status.action.type.d.ts → check-status/check-status.action.type.d.ts} +1 -1
  79. package/lib/core/payment/actions/next-action.interface.d.ts +3 -0
  80. package/lib/core/payment/actions/next-action.service.d.ts +16 -0
  81. package/lib/core/payment/actions/next-actions.d.ts +5 -0
  82. package/lib/core/payment/actions/show-fields/show-fields.action.class.d.ts +8 -0
  83. package/lib/core/payment/actions/show-fields/show-fields.action.token.d.ts +4 -0
  84. package/lib/core/payment/actions/show-fields/show-fields.action.type.d.ts +12 -0
  85. package/lib/core/payment/field-names.enum.d.ts +62 -0
  86. package/lib/core/payment/field.interface.d.ts +5 -5
  87. package/lib/core/payment/form/common-control-config.interface.d.ts +9 -0
  88. package/lib/core/payment/form/controls/control-config.d.ts +9 -0
  89. package/lib/core/payment/form/controls/control-config.service.d.ts +15 -0
  90. package/lib/core/payment/form/controls/control-type.type.d.ts +1 -0
  91. package/lib/core/payment/form/controls/text-control.config.d.ts +11 -0
  92. package/lib/core/payment/form/converters/converter.abstract.d.ts +23 -0
  93. package/lib/core/payment/form/converters/converters-map.d.ts +4 -0
  94. package/lib/core/payment/form/converters/converters-map.interface.d.ts +5 -0
  95. package/lib/core/payment/form/converters/email.converter.d.ts +14 -0
  96. package/lib/core/payment/form/converters/zip.converter.d.ts +21 -0
  97. package/lib/core/payment/form/form-state.interface.d.ts +3 -0
  98. package/lib/core/payment/form/form.module.d.ts +7 -0
  99. package/lib/core/payment/form/form.service.d.ts +12 -0
  100. package/lib/core/payment/form/validators/convert.function.d.ts +3 -0
  101. package/lib/core/payment/form/validators/email-validator.d.ts +2 -0
  102. package/lib/core/payment/form/validators/required-validator.d.ts +2 -0
  103. package/lib/core/payment/form/validators/restricted-value.validator.d.ts +2 -0
  104. package/lib/core/payment/form/validators/validation-error.interface.d.ts +4 -0
  105. package/lib/core/payment/form/validators/validation-errors.interface.d.ts +4 -0
  106. package/lib/core/payment/form/validators/validator-fn.type.d.ts +3 -0
  107. package/lib/core/payment/initialize/initialize-response.class.d.ts +7 -0
  108. package/lib/core/payment/initialize/initialize-response.token.d.ts +6 -0
  109. package/lib/core/payment/initialize/initialize.service.d.ts +18 -0
  110. package/lib/core/payment/payment-form.interface.d.ts +39 -0
  111. package/lib/core/payment/payment.interface.d.ts +6 -5
  112. package/lib/core/payment/payment.service.d.ts +18 -7
  113. package/lib/core/payment/submit/request/submit-request.class.d.ts +13 -0
  114. package/lib/core/payment/submit/request/submit-request.token.d.ts +6 -0
  115. package/lib/core/payment/submit/response/submit-response.class.d.ts +26 -0
  116. package/lib/core/payment/submit/response/submit-response.token.d.ts +6 -0
  117. package/lib/core/payment/submit/submit.service.d.ts +21 -0
  118. package/lib/core/payment/sync/field-sync-state.interface.d.ts +5 -0
  119. package/lib/core/payment/sync/sync-request.class.d.ts +15 -0
  120. package/lib/core/payment/sync/sync-request.token.d.ts +6 -0
  121. package/lib/core/payment/sync/sync-response.class.d.ts +11 -0
  122. package/lib/core/payment/sync/sync-response.token.d.ts +6 -0
  123. package/lib/core/payment/sync/sync.service.d.ts +27 -0
  124. package/lib/core/payment/xps-api-part-request.abstract.d.ts +6 -0
  125. package/lib/core/payment/xps-error.interface.d.ts +1 -0
  126. package/lib/core/payment/xps-request.abstract.d.ts +6 -0
  127. package/lib/core/payment/xps-response.interface.d.ts +3 -6
  128. package/lib/core/xps-boolean.enum.d.ts +4 -0
  129. package/lib/core-library.module.d.ts +2 -1
  130. package/lib/core-library.service.d.ts +4 -2
  131. package/package.json +1 -1
  132. package/xsolla-payment-client-core-0.0.5.tgz +0 -0
  133. package/esm2020/lib/core/boolean-string.enum.mjs +0 -6
  134. package/esm2020/lib/core/payment/actions/action.type.mjs +0 -2
  135. package/esm2020/lib/core/payment/actions/check-status.action.type.mjs +0 -2
  136. package/esm2020/lib/core/payment/actions/next-action.type.mjs +0 -2
  137. package/esm2020/lib/core/payment/initialize-request-params.interface.mjs +0 -2
  138. package/esm2020/lib/core/payment/initialize.service.mjs +0 -39
  139. package/lib/core/boolean-string.enum.d.ts +0 -4
  140. package/lib/core/payment/actions/next-action.type.d.ts +0 -2
  141. package/lib/core/payment/initialize.service.d.ts +0 -16
  142. package/xsolla-payment-client-core-0.0.4.tgz +0 -0
  143. /package/lib/core/payment/actions/{action.type.d.ts → action.interface.d.ts} +0 -0
  144. /package/lib/core/payment/{initialize-request-params.interface.d.ts → initialize/initialize-request-params.interface.d.ts} +0 -0
@@ -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 { 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
+ };
@@ -1,4 +1,4 @@
1
- import { Action } from './action.type';
1
+ import { Action } from '../action.interface';
2
2
  type CheckStatusActionType = 'check_status';
3
3
  interface CheckStatusActionData {
4
4
  order: object;
@@ -0,0 +1,3 @@
1
+ import { CheckStatusAction } from './check-status/check-status.action.type';
2
+ import { ShowFieldsAction } from './show-fields/show-fields.action.type';
3
+ export type NextAction = CheckStatusAction | ShowFieldsAction;
@@ -0,0 +1,16 @@
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 * as i0 from "@angular/core";
6
+ export declare class NextActionService {
7
+ private readonly nextActionTokens;
8
+ private readonly injector;
9
+ private readonly nextActionsMap;
10
+ constructor(nextActionTokens: NextActionTokens, injector: Injector);
11
+ getNextAction(submitResponse: SubmitResponse): NextAction | null;
12
+ private fillNextActionsMap;
13
+ private findNextAction;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<NextActionService, never>;
15
+ static ɵprov: i0.ɵɵInjectableDeclaration<NextActionService>;
16
+ }
@@ -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,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
+ }
@@ -0,0 +1,39 @@
1
+ import { Field } from './field.interface';
2
+ import { Invoice } from './invoice.interface';
3
+ import { StatusEnum } from './status/status.enum';
4
+ import { XpsResponse } from './xps-response.interface';
5
+ export interface PaymentForm {
6
+ totalAmount: string;
7
+ currency: string;
8
+ fields: Field[];
9
+ taxDisclaimer: string | null;
10
+ number: number;
11
+ barcode: unknown;
12
+ offers: unknown;
13
+ instruction: string;
14
+ errors: XpsResponse['errors'];
15
+ error?: {
16
+ fields: {
17
+ [key: string]: string;
18
+ };
19
+ };
20
+ restrictions: unknown;
21
+ info: string;
22
+ buyData: XpsResponse['buyData'];
23
+ pid: XpsResponse['pid'];
24
+ messages: XpsResponse['messages'];
25
+ title: string;
26
+ summary: XpsResponse['summary'];
27
+ skipForm: XpsResponse['skipForm'];
28
+ isSavedMethodPayment?: boolean;
29
+ couponCode?: string;
30
+ publicId: XpsResponse['public_id'];
31
+ koreaNotification?: Field;
32
+ skipCheckout: XpsResponse['skipCheckout'];
33
+ isCheckout: XpsResponse['isCheckout'];
34
+ categories: XpsResponse['categories'];
35
+ hasFatalErrors?: boolean;
36
+ userSession?: Invoice;
37
+ statusText?: StatusEnum | null;
38
+ country: string | null;
39
+ }
@@ -1,14 +1,15 @@
1
- import { NextAction } from './actions/next-action.type';
1
+ import { UntypedFormGroup, ValidationErrors } from '@angular/forms';
2
+ import { NextAction } from './actions/next-action.interface';
2
3
  import { Field } from './field.interface';
3
4
  import { FinanceDetails } from './finance-details.interface';
4
5
  import { Status } from './status/status.interface';
5
- import { XpsResponse } from './xps-response.interface';
6
6
  export interface Payment {
7
- initialize(): Promise<XpsResponse>;
8
- submit(): NextAction;
7
+ initialize(): Promise<Field[]>;
8
+ submit(fields: Field[], form: UntypedFormGroup): Promise<NextAction | null>;
9
9
  getFields(): Field[];
10
- validate(field: Field): boolean;
10
+ validate(field: Field): Promise<ValidationErrors | null>;
11
11
  getFinanceDetails(): FinanceDetails;
12
12
  runThreeDs(): NextAction;
13
13
  getStatus(): Status;
14
+ changeFieldValue(name: string, value: string): void;
14
15
  }
@@ -1,22 +1,33 @@
1
- import { NextAction } from './actions/next-action.type';
1
+ import { UntypedFormGroup, ValidationErrors } from '@angular/forms';
2
+ import { NextAction } from './actions/next-action.interface';
2
3
  import { Field } from './field.interface';
3
4
  import { FinanceDetails } from './finance-details.interface';
4
- import { InitializeService } from './initialize.service';
5
+ import { FormService } from './form/form.service';
6
+ import { InitializeService } from './initialize/initialize.service';
5
7
  import { PaymentConfig } from './payment-config.interface';
6
8
  import { Status } from './status/status.interface';
7
- import { XpsResponse } from './xps-response.interface';
9
+ import { SubmitService } from './submit/submit.service';
10
+ import { SyncService } from './sync/sync.service';
11
+ import { NextActionService } from './actions/next-action.service';
8
12
  import * as i0 from "@angular/core";
9
13
  export declare class PaymentService {
10
14
  private readonly initializeService;
15
+ private readonly submitService;
16
+ private readonly syncService;
17
+ private readonly formService;
18
+ private readonly nextActionService;
19
+ form: UntypedFormGroup | null;
11
20
  private data;
12
- constructor(initializeService: InitializeService);
13
- initialize(config: PaymentConfig): Promise<XpsResponse>;
14
- submit(): NextAction;
21
+ private fields;
22
+ constructor(initializeService: InitializeService, submitService: SubmitService, syncService: SyncService, formService: FormService, nextActionService: NextActionService);
23
+ initialize(config: PaymentConfig): Promise<Field[]>;
24
+ submit(fields: Field[], form: UntypedFormGroup): Promise<NextAction | null>;
15
25
  getFields(): Field[];
16
- validate(field: Field): boolean;
26
+ validate(field: Field): Promise<ValidationErrors | null>;
17
27
  runThreeDs(): NextAction;
18
28
  getFinanceDetails(): FinanceDetails;
19
29
  getStatus(): Status;
30
+ changeFieldValue(name: string, value: string): void;
20
31
  static ɵfac: i0.ɵɵFactoryDeclaration<PaymentService, never>;
21
32
  static ɵprov: i0.ɵɵInjectableDeclaration<PaymentService>;
22
33
  }
@@ -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
+ }