@xsolla/payment-client-core 0.0.10 → 0.0.11
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/payment/actions/action-factory-value.interface.mjs +1 -1
- package/esm2020/lib/core/payment/actions/check-status/check-status.action.token.mjs +5 -2
- package/esm2020/lib/core/payment/actions/next-action.interface.mjs +1 -1
- package/esm2020/lib/core/payment/actions/next-action.service.mjs +11 -10
- package/esm2020/lib/core/payment/actions/next-actions.mjs +3 -1
- package/esm2020/lib/core/payment/actions/redirect/redirect.action.class.mjs +20 -0
- package/esm2020/lib/core/payment/actions/redirect/redirect.action.token.mjs +16 -0
- package/esm2020/lib/core/payment/actions/redirect/redirect.action.type.mjs +2 -0
- package/esm2020/lib/core/payment/actions/show-fields/show-fields.action.class.mjs +2 -2
- package/esm2020/lib/core/payment/actions/show-fields/show-fields.action.token.mjs +5 -2
- package/esm2020/lib/core/payment/actions/status-updated/status-updated.action.token.mjs +2 -2
- package/esm2020/lib/core/payment/form/converters/converter.abstract.mjs +5 -7
- package/esm2020/lib/core/payment/form/converters/zip.converter.mjs +9 -5
- package/esm2020/lib/core/payment/form/mask-config.interface.mjs +2 -0
- package/esm2020/lib/core/payment/form/masks-functions.map.mjs +7 -0
- package/esm2020/lib/core/payment/form/validators/convert.function.mjs +3 -2
- package/esm2020/lib/core/payment/form/validators/email-validator.mjs +3 -2
- package/esm2020/lib/core/payment/form/validators/errors-codes.enum.mjs +8 -0
- package/esm2020/lib/core/payment/form/validators/required-validator.mjs +3 -2
- package/esm2020/lib/core/payment/form/validators/validation-error.interface.mjs +1 -1
- package/esm2020/lib/core/payment/payment.interface.mjs +1 -1
- package/esm2020/lib/core/payment/payment.service.mjs +23 -4
- package/esm2020/lib/core/payment/submit/response/is-submit-response.function.mjs +5 -0
- package/esm2020/lib/core/payment/sync/field-sync-state.interface.mjs +1 -1
- package/esm2020/lib/core/payment/sync/sync.service.mjs +14 -2
- package/esm2020/lib/core-library.service.mjs +7 -2
- package/fesm2015/xsolla-payment-client-core.mjs +228 -139
- package/fesm2015/xsolla-payment-client-core.mjs.map +1 -1
- package/fesm2020/xsolla-payment-client-core.mjs +223 -136
- package/fesm2020/xsolla-payment-client-core.mjs.map +1 -1
- package/lib/core/payment/actions/action-factory-value.interface.d.ts +2 -1
- package/lib/core/payment/actions/next-action.interface.d.ts +2 -1
- package/lib/core/payment/actions/next-action.service.d.ts +2 -2
- package/lib/core/payment/actions/redirect/redirect.action.class.d.ts +9 -0
- package/lib/core/payment/actions/redirect/redirect.action.token.d.ts +4 -0
- package/lib/core/payment/actions/redirect/redirect.action.type.d.ts +17 -0
- package/lib/core/payment/form/converters/converter.abstract.d.ts +1 -2
- package/lib/core/payment/form/mask-config.interface.d.ts +6 -0
- package/lib/core/payment/form/masks-functions.map.d.ts +3 -0
- package/lib/core/payment/form/validators/convert.function.d.ts +1 -1
- package/lib/core/payment/form/validators/errors-codes.enum.d.ts +6 -0
- package/lib/core/payment/form/validators/validation-error.interface.d.ts +1 -0
- package/lib/core/payment/payment.interface.d.ts +1 -2
- package/lib/core/payment/payment.service.d.ts +4 -5
- package/lib/core/payment/submit/response/is-submit-response.function.d.ts +2 -0
- package/lib/core/payment/sync/field-sync-state.interface.d.ts +2 -2
- package/lib/core/payment/sync/sync.service.d.ts +1 -0
- package/lib/core-library.service.d.ts +2 -0
- package/package.json +1 -1
- package/xsolla-payment-client-core-0.0.11.tgz +0 -0
- package/esm2020/lib/core/payment/actions/action-type-command.map.mjs +0 -6
- package/lib/core/payment/actions/action-type-command.map.d.ts +0 -4
- package/xsolla-payment-client-core-0.0.10.tgz +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Action } from './action.interface';
|
|
2
|
+
import { SubmitResponse } from '../submit/response/submit-response.class';
|
|
2
3
|
export interface ActionFactoryValue {
|
|
3
4
|
factory(...args: unknown[]): Action;
|
|
4
|
-
|
|
5
|
+
isSuitable(submitResponse: SubmitResponse): boolean;
|
|
5
6
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CheckStatusAction } from './check-status/check-status.action.type';
|
|
2
2
|
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
|
+
export type NextAction = CheckStatusAction | ShowFieldsAction | StatusUpdatedAction | RedirectAction;
|
|
@@ -8,12 +8,12 @@ export declare class NextActionService {
|
|
|
8
8
|
private readonly nextActionTokens;
|
|
9
9
|
private readonly injector;
|
|
10
10
|
private readonly flowUpdatesSubject;
|
|
11
|
-
private readonly
|
|
11
|
+
private readonly nextActionsList;
|
|
12
12
|
get flowUpdates$(): Observable<NextAction>;
|
|
13
13
|
constructor(nextActionTokens: NextActionTokens, injector: Injector);
|
|
14
14
|
getNextAction(submitResponse: SubmitResponse): NextAction | null;
|
|
15
15
|
emitFlowUpdates(action: NextAction): void;
|
|
16
|
-
private
|
|
16
|
+
private fillNextActionsList;
|
|
17
17
|
private findNextAction;
|
|
18
18
|
static ɵfac: i0.ɵɵFactoryDeclaration<NextActionService, never>;
|
|
19
19
|
static ɵprov: i0.ɵɵInjectableDeclaration<NextActionService>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SubmitResponse } from '../../submit/response/submit-response.class';
|
|
2
|
+
import { Action } from '../action.interface';
|
|
3
|
+
import { RedirectActionData, RedirectActionType } from './redirect.action.type';
|
|
4
|
+
export declare class RedirectAction implements Action {
|
|
5
|
+
type: RedirectActionType;
|
|
6
|
+
data: RedirectActionData;
|
|
7
|
+
constructor(submitResponse: SubmitResponse);
|
|
8
|
+
private getRedirect;
|
|
9
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { InjectionToken, ValueProvider } from '@angular/core';
|
|
2
|
+
import { ActionFactoryValue } from '../action-factory-value.interface';
|
|
3
|
+
export declare const redirectActionFactoryToken: InjectionToken<ActionFactoryValue>;
|
|
4
|
+
export declare const redirectActionFactoryProvider: ValueProvider;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Action } from '../action.interface';
|
|
2
|
+
import { Field } from '../../field.interface';
|
|
3
|
+
import { XpsError } from '../../xps-error.interface';
|
|
4
|
+
import { XpsMessage } from '../../xps-message.interface';
|
|
5
|
+
export type RedirectActionType = 'redirect';
|
|
6
|
+
export interface RedirectActionData {
|
|
7
|
+
fields: Field[];
|
|
8
|
+
errors: XpsError[] | null;
|
|
9
|
+
messages: XpsMessage[] | undefined;
|
|
10
|
+
invoiceId?: string;
|
|
11
|
+
order?: object;
|
|
12
|
+
redirect: {
|
|
13
|
+
redirectUrl: string;
|
|
14
|
+
data: object;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export type RedirectAction = Action<RedirectActionType, RedirectActionData>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UntypedFormControl, ValidatorFn } from '@angular/forms';
|
|
2
2
|
import { Field } from '../../field.interface';
|
|
3
3
|
import { SyncService } from '../../sync/sync.service';
|
|
4
4
|
import { ControlConfig } from '../controls/control-config';
|
|
@@ -9,7 +9,6 @@ export declare abstract class Converter {
|
|
|
9
9
|
convertToConfig(field: Field, formState?: FormState): ControlConfig;
|
|
10
10
|
convertToFormControl(field: Field): UntypedFormControl;
|
|
11
11
|
getValidators(field: Field): ValidatorFn[];
|
|
12
|
-
getAsyncValidators(field: Field): AsyncValidatorFn | AsyncValidatorFn[] | null;
|
|
13
12
|
createDefaultControlConfig<T extends {
|
|
14
13
|
[key: string]: unknown;
|
|
15
14
|
}>(controlConfigClass: new () => T, field: Field): T;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ValidatorFn } from '@angular/forms';
|
|
2
2
|
import { ValidatorFn as ConvertedValidatorFn } from './validator-fn.type';
|
|
3
|
-
export declare function convert(validator: ValidatorFn, message: string): ConvertedValidatorFn;
|
|
3
|
+
export declare function convert(validator: ValidatorFn, message: string, errorCode: string): ConvertedValidatorFn;
|
|
@@ -2,7 +2,6 @@ import { ValidationErrors } from '@angular/forms';
|
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { NextAction } from './actions/next-action.interface';
|
|
4
4
|
import { Status } from './status/status.interface';
|
|
5
|
-
import { StatusParams } from './status/status-params.interface';
|
|
6
5
|
import { Field } from './field.interface';
|
|
7
6
|
import { ControlConfig } from './form/controls/control-config';
|
|
8
7
|
import { FinanceDetails } from './finance-details/finance-details.class';
|
|
@@ -13,7 +12,7 @@ export interface Payment {
|
|
|
13
12
|
validate(field: Field): Promise<ValidationErrors | null>;
|
|
14
13
|
getFinanceDetails(): FinanceDetails | null;
|
|
15
14
|
runThreeDs(): NextAction;
|
|
16
|
-
getStatus(
|
|
15
|
+
getStatus(): Promise<Status>;
|
|
17
16
|
form: {
|
|
18
17
|
changeFieldValue(name: string, value: string): void;
|
|
19
18
|
getControlConfig(field: Field): ControlConfig | null;
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { UntypedFormGroup, ValidationErrors } from '@angular/forms';
|
|
2
|
-
import { NextAction } from './actions/next-action.interface';
|
|
3
|
-
import { Field } from './field.interface';
|
|
4
2
|
import { FormService } from './form/form.service';
|
|
5
3
|
import { InitializeService } from './initialize/initialize.service';
|
|
6
|
-
import { PaymentConfig } from './payment-config.interface';
|
|
7
4
|
import { Status } from './status/status.interface';
|
|
8
5
|
import { SubmitService } from './submit/submit.service';
|
|
9
6
|
import { SyncService } from './sync/sync.service';
|
|
10
7
|
import { StatusService } from './status/status.service';
|
|
11
|
-
import { StatusParams } from './status/status-params.interface';
|
|
12
8
|
import { NextActionService } from './actions/next-action.service';
|
|
13
9
|
import { ControlConfig } from './form/controls/control-config';
|
|
14
10
|
import { ControlConfigService } from './form/controls/control-config.service';
|
|
15
11
|
import { FinanceDetails } from './finance-details/finance-details.class';
|
|
16
12
|
import { FinanceDetailsService } from './finance-details/finance-details.service';
|
|
13
|
+
import { NextAction } from './actions/next-action.interface';
|
|
14
|
+
import { Field } from './field.interface';
|
|
15
|
+
import { PaymentConfig } from './payment-config.interface';
|
|
17
16
|
import * as i0 from "@angular/core";
|
|
18
17
|
export declare class PaymentService {
|
|
19
18
|
private readonly initializeService;
|
|
@@ -37,7 +36,7 @@ export declare class PaymentService {
|
|
|
37
36
|
validate(field: Field): Promise<ValidationErrors | null>;
|
|
38
37
|
runThreeDs(): NextAction;
|
|
39
38
|
getFinanceDetails(): FinanceDetails | null;
|
|
40
|
-
getStatus(
|
|
39
|
+
getStatus(): Promise<Status>;
|
|
41
40
|
getFieldConfig(field: Field): ControlConfig | null;
|
|
42
41
|
changeFieldValue(name: string, value: string): void;
|
|
43
42
|
destroy(): void;
|
|
@@ -21,6 +21,7 @@ export declare class SyncService extends EmitDataService<XpsResponse> {
|
|
|
21
21
|
setup(form: UntypedFormGroup, fields: Field[]): void;
|
|
22
22
|
reset(): void;
|
|
23
23
|
validate(field: Field): Promise<ValidationErrors | null>;
|
|
24
|
+
getSyncValidationErrors(field: Field): ValidationErrors | null;
|
|
24
25
|
protected request(field: Field): Promise<SyncResponse>;
|
|
25
26
|
private isReadyField;
|
|
26
27
|
private getPrevFieldSyncState;
|
|
@@ -10,6 +10,7 @@ import { UserBalanceService } from './core/user-balance/user-balance.service';
|
|
|
10
10
|
import { PaymentConfig } from './core/payment/payment-config.interface';
|
|
11
11
|
import { PaymentService } from './core/payment/payment.service';
|
|
12
12
|
import { Payment } from './core/payment/payment.interface';
|
|
13
|
+
import { Field } from './core/payment/field.interface';
|
|
13
14
|
import { DeviceFingerPrintService } from './core/device-finger-print/device-finger-print.service';
|
|
14
15
|
import { LegalService } from './core/legal/legal.service';
|
|
15
16
|
import { LegalComponentConfig } from './core/legal/legal.component.config';
|
|
@@ -38,6 +39,7 @@ export declare class CoreLibraryService {
|
|
|
38
39
|
setCountry(country: string): void;
|
|
39
40
|
createPayment(config: PaymentConfig): Payment;
|
|
40
41
|
getLegalComponentConfig(): LegalComponentConfig;
|
|
42
|
+
getFieldMask(field: Field): undefined | (() => string);
|
|
41
43
|
static ɵfac: i0.ɵɵFactoryDeclaration<CoreLibraryService, never>;
|
|
42
44
|
static ɵprov: i0.ɵɵInjectableDeclaration<CoreLibraryService>;
|
|
43
45
|
}
|
package/package.json
CHANGED
|
Binary file
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { XpsCommand } from '../xps-comand.enum';
|
|
2
|
-
export const actionTypeCommandMap = {
|
|
3
|
-
[XpsCommand.check]: 'show_fields',
|
|
4
|
-
[XpsCommand.status]: 'check_status',
|
|
5
|
-
};
|
|
6
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWN0aW9uLXR5cGUtY29tbWFuZC5tYXAuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9wYXltZW50LWNsaWVudC1jb3JlL3NyYy9saWIvY29yZS9wYXltZW50L2FjdGlvbnMvYWN0aW9uLXR5cGUtY29tbWFuZC5tYXAudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBRWhELE1BQU0sQ0FBQyxNQUFNLG9CQUFvQixHQUFxQztJQUNwRSxDQUFDLFVBQVUsQ0FBQyxLQUFLLENBQUMsRUFBRSxhQUFhO0lBQ2pDLENBQUMsVUFBVSxDQUFDLE1BQU0sQ0FBQyxFQUFFLGNBQWM7Q0FDcEMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IFhwc0NvbW1hbmQgfSBmcm9tICcuLi94cHMtY29tYW5kLmVudW0nO1xuXG5leHBvcnQgY29uc3QgYWN0aW9uVHlwZUNvbW1hbmRNYXA6IHsgW2tleSBpbiBYcHNDb21tYW5kXT86IHN0cmluZyB9ID0ge1xuICBbWHBzQ29tbWFuZC5jaGVja106ICdzaG93X2ZpZWxkcycsXG4gIFtYcHNDb21tYW5kLnN0YXR1c106ICdjaGVja19zdGF0dXMnLFxufTtcbiJdfQ==
|
|
Binary file
|