@xsolla/payment-client-core 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/core/device-finger-print/device-finger-print-components.interface.mjs +2 -0
- package/esm2020/lib/core/device-finger-print/device-finger-print.service.mjs +167 -0
- package/esm2020/lib/core/device-finger-print/fingerprint-js.interface.mjs +2 -0
- package/esm2020/lib/core/device-finger-print/hash.type.mjs +2 -0
- package/esm2020/lib/core/exceptions-handling/errors/default-terminal-error.class.mjs +8 -0
- package/esm2020/lib/core/exceptions-handling/errors/terminal-error.class.mjs +8 -0
- package/esm2020/lib/core/exceptions-handling/errors/token-error.class.mjs +7 -0
- package/esm2020/lib/core/legal/disclaimer.service.mjs +16 -0
- package/esm2020/lib/core/legal/legal.component.config.mjs +2 -0
- package/esm2020/lib/core/legal/legal.service.mjs +39 -0
- package/esm2020/lib/core/legal/refund-policy.service.mjs +30 -0
- package/esm2020/lib/core/legal/secure-connection.service.mjs +31 -0
- package/esm2020/lib/core/payment/actions/action-factory-value.interface.mjs +2 -0
- package/esm2020/lib/core/payment/actions/action-type-command.map.mjs +5 -0
- package/esm2020/lib/core/payment/actions/action.interface.mjs +2 -0
- package/esm2020/lib/core/payment/actions/check-status/check-status.action.type.mjs +2 -0
- package/esm2020/lib/core/payment/actions/next-action.interface.mjs +2 -0
- package/esm2020/lib/core/payment/actions/next-action.service.mjs +47 -0
- package/esm2020/lib/core/payment/actions/next-actions.mjs +5 -0
- package/esm2020/lib/core/payment/actions/show-fields/show-fields.action.class.mjs +16 -0
- package/esm2020/lib/core/payment/actions/show-fields/show-fields.action.token.mjs +11 -0
- package/esm2020/lib/core/payment/actions/show-fields/show-fields.action.type.mjs +2 -0
- package/esm2020/lib/core/payment/checkout-item.interface.mjs +2 -0
- package/esm2020/lib/core/payment/field-names.enum.mjs +64 -0
- package/esm2020/lib/core/payment/field.interface.mjs +2 -0
- package/esm2020/lib/core/payment/finance-details.interface.mjs +2 -0
- package/esm2020/lib/core/payment/form/common-control-config.interface.mjs +2 -0
- package/esm2020/lib/core/payment/form/controls/control-config.mjs +6 -0
- package/esm2020/lib/core/payment/form/controls/control-config.service.mjs +39 -0
- package/esm2020/lib/core/payment/form/controls/control-type.type.mjs +2 -0
- package/esm2020/lib/core/payment/form/controls/text-control.config.mjs +8 -0
- package/esm2020/lib/core/payment/form/converters/converter.abstract.mjs +75 -0
- package/esm2020/lib/core/payment/form/converters/converters-map.interface.mjs +2 -0
- package/esm2020/lib/core/payment/form/converters/converters-map.mjs +9 -0
- package/esm2020/lib/core/payment/form/converters/email.converter.mjs +29 -0
- package/esm2020/lib/core/payment/form/converters/zip.converter.mjs +64 -0
- package/esm2020/lib/core/payment/form/form-state.interface.mjs +2 -0
- package/esm2020/lib/core/payment/form/form.module.mjs +33 -0
- package/esm2020/lib/core/payment/form/form.service.mjs +28 -0
- package/esm2020/lib/core/payment/form/validators/convert.function.mjs +22 -0
- package/esm2020/lib/core/payment/form/validators/email-validator.mjs +7 -0
- package/esm2020/lib/core/payment/form/validators/required-validator.mjs +6 -0
- package/esm2020/lib/core/payment/form/validators/restricted-value.validator.mjs +6 -0
- package/esm2020/lib/core/payment/form/validators/validation-error.interface.mjs +2 -0
- package/esm2020/lib/core/payment/form/validators/validation-errors.interface.mjs +2 -0
- package/esm2020/lib/core/payment/form/validators/validator-fn.type.mjs +2 -0
- package/esm2020/lib/core/payment/initialize/initialize-request-params.interface.mjs +2 -0
- package/esm2020/lib/core/payment/initialize/initialize-response.class.mjs +43 -0
- package/esm2020/lib/core/payment/initialize/initialize-response.token.mjs +8 -0
- package/esm2020/lib/core/payment/initialize/initialize.service.mjs +46 -0
- package/esm2020/lib/core/payment/invoice.interface.mjs +2 -0
- package/esm2020/lib/core/payment/payment-config.interface.mjs +2 -0
- package/esm2020/lib/core/payment/payment-form.interface.mjs +2 -0
- package/esm2020/lib/core/payment/payment.interface.mjs +2 -0
- package/esm2020/lib/core/payment/payment.service.mjs +58 -0
- package/esm2020/lib/core/payment/status/finance-info-field.interface.mjs +2 -0
- package/esm2020/lib/core/payment/status/line-item.interface.mjs +2 -0
- package/esm2020/lib/core/payment/status/status.enum.mjs +12 -0
- package/esm2020/lib/core/payment/status/status.interface.mjs +2 -0
- package/esm2020/lib/core/payment/status/title-class.enum.mjs +7 -0
- package/esm2020/lib/core/payment/status/web-socket-client-type.enum.mjs +6 -0
- package/esm2020/lib/core/payment/submit/request/submit-request.class.mjs +16 -0
- package/esm2020/lib/core/payment/submit/request/submit-request.token.mjs +8 -0
- package/esm2020/lib/core/payment/submit/response/submit-response.class.mjs +31 -0
- package/esm2020/lib/core/payment/submit/response/submit-response.token.mjs +8 -0
- package/esm2020/lib/core/payment/submit/submit.service.mjs +59 -0
- package/esm2020/lib/core/payment/sync/field-sync-state.interface.mjs +2 -0
- package/esm2020/lib/core/payment/sync/sync-request.class.mjs +31 -0
- package/esm2020/lib/core/payment/sync/sync-request.token.mjs +8 -0
- package/esm2020/lib/core/payment/sync/sync-response.class.mjs +14 -0
- package/esm2020/lib/core/payment/sync/sync-response.token.mjs +8 -0
- package/esm2020/lib/core/payment/sync/sync.service.mjs +91 -0
- package/esm2020/lib/core/payment/virtual-currency.interface.mjs +2 -0
- package/esm2020/lib/core/payment/xps-api-part-request.abstract.mjs +8 -0
- package/esm2020/lib/core/payment/xps-comand.enum.mjs +10 -0
- package/esm2020/lib/core/payment/xps-error.interface.mjs +2 -0
- package/esm2020/lib/core/payment/xps-message.interface.mjs +2 -0
- package/esm2020/lib/core/payment/xps-request.abstract.mjs +8 -0
- package/esm2020/lib/core/payment/xps-response.interface.mjs +2 -0
- package/esm2020/lib/core/payment/xps-subscription-item.interface.mjs +2 -0
- package/esm2020/lib/core/saved-methods/saved-methods.service.mjs +5 -7
- package/esm2020/lib/core/xps-boolean.enum.mjs +2 -0
- package/esm2020/lib/core-library.module.mjs +31 -4
- package/esm2020/lib/core-library.service.mjs +27 -5
- package/esm2020/public-api.mjs +2 -1
- package/fesm2015/xsolla-payment-client-core.mjs +1214 -11
- package/fesm2015/xsolla-payment-client-core.mjs.map +1 -1
- package/fesm2020/xsolla-payment-client-core.mjs +1165 -11
- package/fesm2020/xsolla-payment-client-core.mjs.map +1 -1
- package/lib/core/device-finger-print/device-finger-print-components.interface.d.ts +4 -0
- package/lib/core/device-finger-print/device-finger-print.service.d.ts +44 -0
- package/lib/core/device-finger-print/fingerprint-js.interface.d.ts +6 -0
- package/lib/core/device-finger-print/hash.type.d.ts +3 -0
- package/lib/core/exceptions-handling/errors/default-terminal-error.class.d.ts +4 -0
- package/lib/core/exceptions-handling/errors/terminal-error.class.d.ts +5 -0
- package/lib/core/exceptions-handling/errors/token-error.class.d.ts +4 -0
- package/lib/core/legal/disclaimer.service.d.ts +6 -0
- package/lib/core/legal/legal.component.config.d.ts +10 -0
- package/lib/core/legal/legal.service.d.ts +18 -0
- package/lib/core/legal/refund-policy.service.d.ts +11 -0
- package/lib/core/legal/secure-connection.service.d.ts +13 -0
- package/lib/core/payment/actions/action-factory-value.interface.d.ts +5 -0
- package/lib/core/payment/actions/action-type-command.map.d.ts +4 -0
- package/lib/core/payment/actions/action.interface.d.ts +4 -0
- package/lib/core/payment/actions/check-status/check-status.action.type.d.ts +12 -0
- package/lib/core/payment/actions/next-action.interface.d.ts +3 -0
- package/lib/core/payment/actions/next-action.service.d.ts +16 -0
- package/lib/core/payment/actions/next-actions.d.ts +5 -0
- package/lib/core/payment/actions/show-fields/show-fields.action.class.d.ts +8 -0
- package/lib/core/payment/actions/show-fields/show-fields.action.token.d.ts +4 -0
- package/lib/core/payment/actions/show-fields/show-fields.action.type.d.ts +12 -0
- package/lib/core/payment/checkout-item.interface.d.ts +11 -0
- package/lib/core/payment/field-names.enum.d.ts +62 -0
- package/lib/core/payment/field.interface.d.ts +26 -0
- package/lib/core/payment/finance-details.interface.d.ts +2 -0
- package/lib/core/payment/form/common-control-config.interface.d.ts +9 -0
- package/lib/core/payment/form/controls/control-config.d.ts +9 -0
- package/lib/core/payment/form/controls/control-config.service.d.ts +15 -0
- package/lib/core/payment/form/controls/control-type.type.d.ts +1 -0
- package/lib/core/payment/form/controls/text-control.config.d.ts +11 -0
- package/lib/core/payment/form/converters/converter.abstract.d.ts +23 -0
- package/lib/core/payment/form/converters/converters-map.d.ts +4 -0
- package/lib/core/payment/form/converters/converters-map.interface.d.ts +5 -0
- package/lib/core/payment/form/converters/email.converter.d.ts +14 -0
- package/lib/core/payment/form/converters/zip.converter.d.ts +21 -0
- package/lib/core/payment/form/form-state.interface.d.ts +3 -0
- package/lib/core/payment/form/form.module.d.ts +7 -0
- package/lib/core/payment/form/form.service.d.ts +12 -0
- package/lib/core/payment/form/validators/convert.function.d.ts +3 -0
- package/lib/core/payment/form/validators/email-validator.d.ts +2 -0
- package/lib/core/payment/form/validators/required-validator.d.ts +2 -0
- package/lib/core/payment/form/validators/restricted-value.validator.d.ts +2 -0
- package/lib/core/payment/form/validators/validation-error.interface.d.ts +4 -0
- package/lib/core/payment/form/validators/validation-errors.interface.d.ts +4 -0
- package/lib/core/payment/form/validators/validator-fn.type.d.ts +3 -0
- package/lib/core/payment/initialize/initialize-request-params.interface.d.ts +6 -0
- package/lib/core/payment/initialize/initialize-response.class.d.ts +7 -0
- package/lib/core/payment/initialize/initialize-response.token.d.ts +6 -0
- package/lib/core/payment/initialize/initialize.service.d.ts +18 -0
- package/lib/core/payment/invoice.interface.d.ts +14 -0
- package/lib/core/payment/payment-config.interface.d.ts +5 -0
- package/lib/core/payment/payment-form.interface.d.ts +39 -0
- package/lib/core/payment/payment.interface.d.ts +15 -0
- package/lib/core/payment/payment.service.d.ts +33 -0
- package/lib/core/payment/status/finance-info-field.interface.d.ts +5 -0
- package/lib/core/payment/status/line-item.interface.d.ts +8 -0
- package/lib/core/payment/status/status.enum.d.ts +10 -0
- package/lib/core/payment/status/status.interface.d.ts +63 -0
- package/lib/core/payment/status/title-class.enum.d.ts +5 -0
- package/lib/core/payment/status/web-socket-client-type.enum.d.ts +4 -0
- package/lib/core/payment/submit/request/submit-request.class.d.ts +13 -0
- package/lib/core/payment/submit/request/submit-request.token.d.ts +6 -0
- package/lib/core/payment/submit/response/submit-response.class.d.ts +26 -0
- package/lib/core/payment/submit/response/submit-response.token.d.ts +6 -0
- package/lib/core/payment/submit/submit.service.d.ts +21 -0
- package/lib/core/payment/sync/field-sync-state.interface.d.ts +5 -0
- package/lib/core/payment/sync/sync-request.class.d.ts +15 -0
- package/lib/core/payment/sync/sync-request.token.d.ts +6 -0
- package/lib/core/payment/sync/sync-response.class.d.ts +11 -0
- package/lib/core/payment/sync/sync-response.token.d.ts +6 -0
- package/lib/core/payment/sync/sync.service.d.ts +27 -0
- package/lib/core/payment/virtual-currency.interface.d.ts +10 -0
- package/lib/core/payment/xps-api-part-request.abstract.d.ts +6 -0
- package/lib/core/payment/xps-comand.enum.d.ts +8 -0
- package/lib/core/payment/xps-error.interface.d.ts +7 -0
- package/lib/core/payment/xps-message.interface.d.ts +4 -0
- package/lib/core/payment/xps-request.abstract.d.ts +6 -0
- package/lib/core/payment/xps-response.interface.d.ts +261 -0
- package/lib/core/payment/xps-subscription-item.interface.d.ts +20 -0
- package/lib/core/saved-methods/saved-methods.service.d.ts +1 -3
- package/lib/core/xps-boolean.enum.d.ts +4 -0
- package/lib/core-library.module.d.ts +2 -1
- package/lib/core-library.service.d.ts +12 -1
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/xsolla-payment-client-core-0.0.5.tgz +0 -0
- package/xsolla-payment-client-core-0.0.3.tgz +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { LegalComponentConfig } from './legal.component.config';
|
|
2
|
+
import { SettingsService } from '../settings/settings.service';
|
|
3
|
+
import { RefundPolicyService } from './refund-policy.service';
|
|
4
|
+
import { SecureConnectionService } from './secure-connection.service';
|
|
5
|
+
import { DisclaimerService } from './disclaimer.service';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class LegalService {
|
|
8
|
+
private readonly settingsService;
|
|
9
|
+
private readonly refundPolicyService;
|
|
10
|
+
private readonly secureConnectionService;
|
|
11
|
+
private readonly disclaimerService;
|
|
12
|
+
readonly sctlPolicyUrl = "https://xsolla.com/sctl";
|
|
13
|
+
private get isJapanUser();
|
|
14
|
+
constructor(settingsService: SettingsService, refundPolicyService: RefundPolicyService, secureConnectionService: SecureConnectionService, disclaimerService: DisclaimerService);
|
|
15
|
+
getLegalComponentConfig(): LegalComponentConfig;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LegalService, never>;
|
|
17
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<LegalService>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SettingsService } from '../../core/settings/settings.service';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class RefundPolicyService {
|
|
4
|
+
private readonly settingsService;
|
|
5
|
+
readonly defaultVersionId = 2;
|
|
6
|
+
readonly defaultUrl = "https://xsolla.com/refund-policy-ps";
|
|
7
|
+
constructor(settingsService: SettingsService);
|
|
8
|
+
get url(): string;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RefundPolicyService, never>;
|
|
10
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<RefundPolicyService>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SettingsService } from '../settings/settings.service';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class SecureConnectionService {
|
|
4
|
+
private readonly settingsService;
|
|
5
|
+
get isWhiteLabel(): boolean;
|
|
6
|
+
get secureConnectionUrl(): string | undefined;
|
|
7
|
+
readonly secureConnectionApi = "https://verify.xsolla.com/?url=";
|
|
8
|
+
private _secureConnectionUrl?;
|
|
9
|
+
constructor(settingsService: SettingsService);
|
|
10
|
+
private setSecureConnectionUrl;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SecureConnectionService, never>;
|
|
12
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SecureConnectionService>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Action } from '../action.interface';
|
|
2
|
+
type CheckStatusActionType = 'check_status';
|
|
3
|
+
interface CheckStatusActionData {
|
|
4
|
+
order: object;
|
|
5
|
+
invoiceId: number;
|
|
6
|
+
status: {
|
|
7
|
+
type: string;
|
|
8
|
+
isFinalStatus: boolean;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export type CheckStatusAction = Action<CheckStatusActionType, CheckStatusActionData>;
|
|
12
|
+
export {};
|
|
@@ -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,11 @@
|
|
|
1
|
+
export interface CheckoutItem {
|
|
2
|
+
quantity: number;
|
|
3
|
+
amount: number | null;
|
|
4
|
+
amount_before_discount?: number | null;
|
|
5
|
+
name: string;
|
|
6
|
+
image_url: string;
|
|
7
|
+
description: string | null;
|
|
8
|
+
currency: string;
|
|
9
|
+
is_bonus: boolean;
|
|
10
|
+
indirect_tax_rate: number;
|
|
11
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { XpsBoolean } from '../xps-boolean.enum';
|
|
2
|
+
export interface Field {
|
|
3
|
+
name: string;
|
|
4
|
+
type: string;
|
|
5
|
+
value: string;
|
|
6
|
+
title: string;
|
|
7
|
+
example: string;
|
|
8
|
+
options?: unknown[];
|
|
9
|
+
isMandatory: XpsBoolean;
|
|
10
|
+
isReadonly?: XpsBoolean;
|
|
11
|
+
isVisible: XpsBoolean;
|
|
12
|
+
isPakets?: XpsBoolean;
|
|
13
|
+
tooltip?: string;
|
|
14
|
+
regex?: string;
|
|
15
|
+
validation_error_msg?: string;
|
|
16
|
+
label_hint?: string;
|
|
17
|
+
javascript: {
|
|
18
|
+
change: {
|
|
19
|
+
mutableFields: string[];
|
|
20
|
+
staticParams: {
|
|
21
|
+
[key: string]: string;
|
|
22
|
+
};
|
|
23
|
+
params: string[];
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -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,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,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,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,14 @@
|
|
|
1
|
+
export interface Invoice {
|
|
2
|
+
purchase_invoice_id: number | null;
|
|
3
|
+
geotype_id: number | null;
|
|
4
|
+
payment_country: string | null;
|
|
5
|
+
payment_method_contr_id: number | null;
|
|
6
|
+
ps_type: number | null;
|
|
7
|
+
purchase_sum: number | null;
|
|
8
|
+
purchase_currency: string | null;
|
|
9
|
+
purchase_sku: string | null;
|
|
10
|
+
purchase_digital_content_sku: string | null;
|
|
11
|
+
purchase_description: string | null;
|
|
12
|
+
digital_content_cart_id: number | null;
|
|
13
|
+
digital_good_cart_id: number | null;
|
|
14
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { UntypedFormGroup, ValidationErrors } from '@angular/forms';
|
|
2
|
+
import { NextAction } from './actions/next-action.interface';
|
|
3
|
+
import { Field } from './field.interface';
|
|
4
|
+
import { FinanceDetails } from './finance-details.interface';
|
|
5
|
+
import { Status } from './status/status.interface';
|
|
6
|
+
export interface Payment {
|
|
7
|
+
initialize(): Promise<Field[]>;
|
|
8
|
+
submit(fields: Field[], form: UntypedFormGroup): Promise<NextAction | null>;
|
|
9
|
+
getFields(): Field[];
|
|
10
|
+
validate(field: Field): Promise<ValidationErrors | null>;
|
|
11
|
+
getFinanceDetails(): FinanceDetails;
|
|
12
|
+
runThreeDs(): NextAction;
|
|
13
|
+
getStatus(): Status;
|
|
14
|
+
changeFieldValue(name: string, value: string): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { UntypedFormGroup, ValidationErrors } from '@angular/forms';
|
|
2
|
+
import { NextAction } from './actions/next-action.interface';
|
|
3
|
+
import { Field } from './field.interface';
|
|
4
|
+
import { FinanceDetails } from './finance-details.interface';
|
|
5
|
+
import { FormService } from './form/form.service';
|
|
6
|
+
import { InitializeService } from './initialize/initialize.service';
|
|
7
|
+
import { PaymentConfig } from './payment-config.interface';
|
|
8
|
+
import { Status } from './status/status.interface';
|
|
9
|
+
import { SubmitService } from './submit/submit.service';
|
|
10
|
+
import { SyncService } from './sync/sync.service';
|
|
11
|
+
import { NextActionService } from './actions/next-action.service';
|
|
12
|
+
import * as i0 from "@angular/core";
|
|
13
|
+
export declare class PaymentService {
|
|
14
|
+
private readonly initializeService;
|
|
15
|
+
private readonly submitService;
|
|
16
|
+
private readonly syncService;
|
|
17
|
+
private readonly formService;
|
|
18
|
+
private readonly nextActionService;
|
|
19
|
+
form: UntypedFormGroup | null;
|
|
20
|
+
private data;
|
|
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>;
|
|
25
|
+
getFields(): Field[];
|
|
26
|
+
validate(field: Field): Promise<ValidationErrors | null>;
|
|
27
|
+
runThreeDs(): NextAction;
|
|
28
|
+
getFinanceDetails(): FinanceDetails;
|
|
29
|
+
getStatus(): Status;
|
|
30
|
+
changeFieldValue(name: string, value: string): void;
|
|
31
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PaymentService, never>;
|
|
32
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<PaymentService>;
|
|
33
|
+
}
|