@xsolla/payment-client-core 0.2.76 → 0.2.78
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/esm2022/lib/core/payment/external-change-fields.const.mjs +6 -0
- package/esm2022/lib/core/payment/field-names.enum.mjs +2 -1
- package/esm2022/lib/core/payment/form/overrided-fields/empty-validator.function.mjs +2 -0
- package/esm2022/lib/core/payment/form/overrided-fields/fields-allowed-to-override.mjs +3 -1
- package/esm2022/lib/core/payment/form/overrided-fields/override-field-config.mjs +10 -1
- package/esm2022/lib/core/payment/form/validators/email/email-validator.mjs +2 -2
- package/esm2022/lib/core/payment/payment.interface.mjs +1 -1
- package/esm2022/lib/core/payment/payment.service.mjs +19 -1
- package/esm2022/lib/core/payment/requests/submit/response/submit-response.class.mjs +15 -3
- package/esm2022/lib/core/payment/update-submit-response/update-after-error-rules.const.mjs +34 -0
- package/esm2022/lib/core/payment/xps-response.interface.mjs +1 -1
- package/esm2022/lib/core/web-socket/nchan-web-socket.service.mjs +1 -2
- package/esm2022/lib/core-library.service.mjs +2 -1
- package/fesm2022/xsolla-payment-client-core.mjs +98 -20
- package/fesm2022/xsolla-payment-client-core.mjs.map +1 -1
- package/lib/core/payment/external-change-fields.const.d.ts +2 -0
- package/lib/core/payment/field-names.enum.d.ts +2 -1
- package/lib/core/payment/form/overrided-fields/empty-validator.function.d.ts +1 -0
- package/lib/core/payment/payment.interface.d.ts +1 -0
- package/lib/core/payment/payment.service.d.ts +2 -0
- package/lib/core/payment/requests/submit/response/submit-response.class.d.ts +3 -0
- package/lib/core/payment/update-submit-response/update-after-error-rules.const.d.ts +8 -0
- package/lib/core/payment/xps-response.interface.d.ts +6 -9
- package/package.json +1 -1
- package/xsolla-payment-client-core-0.2.78.tgz +0 -0
- package/xsolla-payment-client-core-0.2.76.tgz +0 -0
|
@@ -78,5 +78,6 @@ export declare enum FieldNames {
|
|
|
78
78
|
getApplePaySessionUrl = "getApplePaySessionUrl",
|
|
79
79
|
payViaCheckoutUrl = "payViaCheckoutUrl",
|
|
80
80
|
googlePayInitData = "googlePayInitData",
|
|
81
|
-
googlePayPaymentData = "googlePayPaymentData"
|
|
81
|
+
googlePayPaymentData = "googlePayPaymentData",
|
|
82
|
+
externalCardIssuerCountry = "externalCardIssuerCountry"
|
|
82
83
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const emptyValidator: () => boolean;
|
|
@@ -26,6 +26,7 @@ export interface Payment {
|
|
|
26
26
|
form: {
|
|
27
27
|
fieldsStatus$: Observable<FormFieldsStatus>;
|
|
28
28
|
changeFieldValue(name: string, value: string): void;
|
|
29
|
+
externalChangeFieldValue(name: string, value: string): void;
|
|
29
30
|
getControlConfig(field: Field): ControlConfig | null;
|
|
30
31
|
changeFieldState(name: string, state: InputEventName): void;
|
|
31
32
|
updateFieldFormState(fieldName: string, formState: FormState): void;
|
|
@@ -94,6 +94,7 @@ export declare class PaymentService {
|
|
|
94
94
|
listenFinalStatus(): Promise<void>;
|
|
95
95
|
getFieldConfig(field: Field): ControlConfig | null;
|
|
96
96
|
changeFieldValue(name: string, value: string): void;
|
|
97
|
+
externalChangeFieldValue(name: FieldNames, value: string): void;
|
|
97
98
|
changeFieldState(name: string, state: InputEventName): void;
|
|
98
99
|
addExtraField(name: string, value: string): void;
|
|
99
100
|
destroy(): void;
|
|
@@ -112,6 +113,7 @@ export declare class PaymentService {
|
|
|
112
113
|
private initializeBehaviourStrategies;
|
|
113
114
|
private destroyBehaviourStrategies;
|
|
114
115
|
private autoSubmitBehaviourStrategies;
|
|
116
|
+
private handleSubmitWithErrors;
|
|
115
117
|
static ɵfac: i0.ɵɵFactoryDeclaration<PaymentService, never>;
|
|
116
118
|
static ɵprov: i0.ɵɵInjectableDeclaration<PaymentService>;
|
|
117
119
|
}
|
|
@@ -2,6 +2,7 @@ import { XpsResponse } from '../../../xps-response.interface';
|
|
|
2
2
|
import { Field } from '../../../field.interface';
|
|
3
3
|
import { Invoice } from '../../../invoice.interface';
|
|
4
4
|
import { XpsCommand } from '../../../xps-comand.enum';
|
|
5
|
+
import { FieldNames } from '../../../field-names.enum';
|
|
5
6
|
import { XsollaNumber } from './xsolla-number.interface';
|
|
6
7
|
export declare class SubmitResponse {
|
|
7
8
|
readonly responseNumber: number;
|
|
@@ -25,4 +26,6 @@ export declare class SubmitResponse {
|
|
|
25
26
|
messages: XpsResponse['messages'];
|
|
26
27
|
xsollaNumber: XsollaNumber;
|
|
27
28
|
constructor(parameters: XpsResponse, responseNumber?: number);
|
|
29
|
+
setFieldValue(fieldName: FieldNames, value: string): void;
|
|
30
|
+
getFieldValue(fieldName: string): string | undefined;
|
|
28
31
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { UntypedFormGroup } from '@angular/forms';
|
|
2
|
+
import { SubmitResponse } from '../requests/submit/response/submit-response.class';
|
|
3
|
+
interface UpdateAfterErrorRule {
|
|
4
|
+
description: string;
|
|
5
|
+
apply(submitResponse: SubmitResponse, form: UntypedFormGroup | null): void;
|
|
6
|
+
}
|
|
7
|
+
export declare const updateAfterErrorRules: UpdateAfterErrorRule[];
|
|
8
|
+
export {};
|
|
@@ -10,13 +10,14 @@ import { XpsError } from './xps-error.interface';
|
|
|
10
10
|
import { XpsMessage } from './xps-message.interface';
|
|
11
11
|
import { XpsSummary } from './xps-summary.interface';
|
|
12
12
|
import { ThreeDsForm } from './three-ds/three-ds-form.interface';
|
|
13
|
+
export interface KeyValue<T> {
|
|
14
|
+
[key: string]: T;
|
|
15
|
+
}
|
|
13
16
|
export interface XpsResponse {
|
|
14
17
|
checkout: {
|
|
15
18
|
action: string;
|
|
16
19
|
method: string;
|
|
17
|
-
data:
|
|
18
|
-
[key: string]: string;
|
|
19
|
-
};
|
|
20
|
+
data: KeyValue<string>;
|
|
20
21
|
};
|
|
21
22
|
cardBinCountry?: string;
|
|
22
23
|
idCardType: string;
|
|
@@ -42,9 +43,7 @@ export interface XpsResponse {
|
|
|
42
43
|
};
|
|
43
44
|
accountXsolla: string;
|
|
44
45
|
public_id: string;
|
|
45
|
-
form:
|
|
46
|
-
[key: string]: Field;
|
|
47
|
-
};
|
|
46
|
+
form: KeyValue<Field>;
|
|
48
47
|
taxDisclaimer: string | null;
|
|
49
48
|
number: number;
|
|
50
49
|
barcode: unknown;
|
|
@@ -61,9 +60,7 @@ export interface XpsResponse {
|
|
|
61
60
|
name: string;
|
|
62
61
|
};
|
|
63
62
|
error?: {
|
|
64
|
-
fields:
|
|
65
|
-
[key: string]: string;
|
|
66
|
-
};
|
|
63
|
+
fields: KeyValue<string>;
|
|
67
64
|
};
|
|
68
65
|
invoiceCreated: XpsBoolean;
|
|
69
66
|
messages?: XpsMessage[];
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|