@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.
- 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/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/field-names.enum.mjs +64 -0
- package/esm2020/lib/core/payment/field.interface.mjs +1 -1
- 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/payment-form.interface.mjs +2 -0
- package/esm2020/lib/core/payment/payment.interface.mjs +1 -1
- package/esm2020/lib/core/payment/payment.service.mjs +29 -12
- 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/xps-api-part-request.abstract.mjs +8 -0
- package/esm2020/lib/core/payment/xps-error.interface.mjs +1 -1
- package/esm2020/lib/core/payment/xps-request.abstract.mjs +8 -0
- package/esm2020/lib/core/payment/xps-response.interface.mjs +1 -1
- 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 +14 -10
- package/fesm2015/xsolla-payment-client-core.mjs +1093 -83
- package/fesm2015/xsolla-payment-client-core.mjs.map +1 -1
- package/fesm2020/xsolla-payment-client-core.mjs +1047 -79
- 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/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/{check-status.action.type.d.ts → check-status/check-status.action.type.d.ts} +1 -1
- 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/field-names.enum.d.ts +62 -0
- package/lib/core/payment/field.interface.d.ts +5 -5
- 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-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/payment-form.interface.d.ts +39 -0
- package/lib/core/payment/payment.interface.d.ts +6 -5
- package/lib/core/payment/payment.service.d.ts +18 -7
- 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/xps-api-part-request.abstract.d.ts +6 -0
- package/lib/core/payment/xps-error.interface.d.ts +1 -0
- package/lib/core/payment/xps-request.abstract.d.ts +6 -0
- package/lib/core/payment/xps-response.interface.d.ts +3 -6
- 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 +4 -2
- package/package.json +1 -1
- package/xsolla-payment-client-core-0.0.5.tgz +0 -0
- package/esm2020/lib/core/boolean-string.enum.mjs +0 -6
- package/esm2020/lib/core/payment/actions/action.type.mjs +0 -2
- package/esm2020/lib/core/payment/actions/check-status.action.type.mjs +0 -2
- package/esm2020/lib/core/payment/actions/next-action.type.mjs +0 -2
- package/esm2020/lib/core/payment/initialize-request-params.interface.mjs +0 -2
- package/esm2020/lib/core/payment/initialize.service.mjs +0 -39
- package/lib/core/boolean-string.enum.d.ts +0 -4
- package/lib/core/payment/actions/next-action.type.d.ts +0 -2
- package/lib/core/payment/initialize.service.d.ts +0 -16
- package/xsolla-payment-client-core-0.0.4.tgz +0 -0
- /package/lib/core/payment/actions/{action.type.d.ts → action.interface.d.ts} +0 -0
- /package/lib/core/payment/{initialize-request-params.interface.d.ts → initialize/initialize-request-params.interface.d.ts} +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { InjectionToken, ValueProvider } from '@angular/core';
|
|
2
|
+
import { SyncResponse } from './sync-response.class';
|
|
3
|
+
export type SyncResponseParameters = ConstructorParameters<typeof SyncResponse>;
|
|
4
|
+
export type SyncResponseFactory = (...args: SyncResponseParameters) => SyncResponse;
|
|
5
|
+
export declare const syncResponseFactoryToken: InjectionToken<SyncResponseFactory>;
|
|
6
|
+
export declare const syncResponseFactoryProvider: ValueProvider;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { UntypedFormGroup, ValidationErrors } from '@angular/forms';
|
|
2
|
+
import { SecureApiClient } from '../../http/secure-api/secure-api.service';
|
|
3
|
+
import { SettingsService } from '../../settings/settings.service';
|
|
4
|
+
import { Field } from '../field.interface';
|
|
5
|
+
import { SyncRequestFactory } from './sync-request.token';
|
|
6
|
+
import { SyncResponseFactory } from './sync-response.token';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export declare class SyncService {
|
|
9
|
+
private readonly requestFactory;
|
|
10
|
+
private readonly responseFactory;
|
|
11
|
+
private readonly secureApi;
|
|
12
|
+
private readonly settingsService;
|
|
13
|
+
private readonly apiRoute;
|
|
14
|
+
private prevFieldSyncStates;
|
|
15
|
+
private form;
|
|
16
|
+
private fields;
|
|
17
|
+
constructor(requestFactory: SyncRequestFactory, responseFactory: SyncResponseFactory, secureApi: SecureApiClient, settingsService: SettingsService);
|
|
18
|
+
setup(form: UntypedFormGroup, fields: Field[]): void;
|
|
19
|
+
reset(): void;
|
|
20
|
+
validate(field: Field): Promise<ValidationErrors | null>;
|
|
21
|
+
private request;
|
|
22
|
+
private isReadyField;
|
|
23
|
+
private getPrevFieldSyncState;
|
|
24
|
+
private setPrevFieldSyncState;
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SyncService, never>;
|
|
26
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SyncService>;
|
|
27
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { XpsBoolean } from '../xps-boolean.enum';
|
|
2
2
|
import { CheckoutItem } from './checkout-item.interface';
|
|
3
3
|
import { Field } from './field.interface';
|
|
4
4
|
import { Invoice } from './invoice.interface';
|
|
@@ -97,7 +97,7 @@ export interface XpsResponse {
|
|
|
97
97
|
isMandatory: null | boolean;
|
|
98
98
|
isPakets: null | boolean;
|
|
99
99
|
isReadonly: null | boolean;
|
|
100
|
-
isVisible:
|
|
100
|
+
isVisible: XpsBoolean;
|
|
101
101
|
label_hint: null | string;
|
|
102
102
|
name: string;
|
|
103
103
|
options: null | unknown[];
|
|
@@ -111,12 +111,9 @@ export interface XpsResponse {
|
|
|
111
111
|
};
|
|
112
112
|
accountXsolla: string;
|
|
113
113
|
public_id: string;
|
|
114
|
-
idCardType: string | null;
|
|
115
|
-
switch_card_icon: string | null;
|
|
116
114
|
form: {
|
|
117
115
|
[key: string]: Field;
|
|
118
116
|
};
|
|
119
|
-
isShortForm: BooleanString;
|
|
120
117
|
taxDisclaimer: string | null;
|
|
121
118
|
number: number;
|
|
122
119
|
barcode: unknown;
|
|
@@ -137,7 +134,7 @@ export interface XpsResponse {
|
|
|
137
134
|
[key: string]: string;
|
|
138
135
|
};
|
|
139
136
|
};
|
|
140
|
-
invoiceCreated:
|
|
137
|
+
invoiceCreated: XpsBoolean;
|
|
141
138
|
messages?: XpsMessage[];
|
|
142
139
|
status?: StatusEnum | XpsStatus | null;
|
|
143
140
|
final?: boolean;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import * as i1 from "@angular/common/http";
|
|
3
|
+
import * as i2 from "./core/payment/form/form.module";
|
|
3
4
|
export declare class CoreLibraryModule {
|
|
4
5
|
static ɵfac: i0.ɵɵFactoryDeclaration<CoreLibraryModule, never>;
|
|
5
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<CoreLibraryModule, never, [typeof i1.HttpClientModule], never>;
|
|
6
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<CoreLibraryModule, never, [typeof i1.HttpClientModule, typeof i2.FormModule], never>;
|
|
6
7
|
static ɵinj: i0.ɵɵInjectorDeclaration<CoreLibraryModule>;
|
|
7
8
|
}
|
|
@@ -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 { DeviceFingerPrintService } from './core/device-finger-print/device-finger-print.service';
|
|
13
14
|
import { LegalService } from './core/legal/legal.service';
|
|
14
15
|
import { LegalComponentConfig } from './core/legal/legal.component.config';
|
|
15
16
|
import * as i0 from "@angular/core";
|
|
@@ -19,15 +20,16 @@ export declare class CoreLibraryService {
|
|
|
19
20
|
private readonly paymentMethodsService;
|
|
20
21
|
private readonly savedMethodsService;
|
|
21
22
|
private readonly userBalanceService;
|
|
22
|
-
private readonly legalService;
|
|
23
23
|
private readonly paymentService;
|
|
24
|
+
private readonly deviceFingerPrintService;
|
|
25
|
+
private readonly legalService;
|
|
24
26
|
paymentMethods: {
|
|
25
27
|
getList: () => Promise<PaymentMethod[]>;
|
|
26
28
|
getQuickMethods: () => Promise<PaymentMethod[]>;
|
|
27
29
|
getSavedMethods: () => Promise<SavedMethod[]>;
|
|
28
30
|
getUserBalance: () => Promise<UserBalanceResponse>;
|
|
29
31
|
};
|
|
30
|
-
constructor(settingsService: SettingsService, countryService: CountryService, paymentMethodsService: PaymentMethodsService, savedMethodsService: SavedMethodsService, userBalanceService: UserBalanceService,
|
|
32
|
+
constructor(settingsService: SettingsService, countryService: CountryService, paymentMethodsService: PaymentMethodsService, savedMethodsService: SavedMethodsService, userBalanceService: UserBalanceService, paymentService: PaymentService, deviceFingerPrintService: DeviceFingerPrintService, legalService: LegalService);
|
|
31
33
|
init(configuration: InitConfiguration): Promise<void>;
|
|
32
34
|
setCountry(country: string): void;
|
|
33
35
|
createPayment(config: PaymentConfig): Payment;
|
package/package.json
CHANGED
|
Binary file
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export var BooleanString;
|
|
2
|
-
(function (BooleanString) {
|
|
3
|
-
BooleanString["true"] = "1";
|
|
4
|
-
BooleanString["false"] = "0";
|
|
5
|
-
})(BooleanString || (BooleanString = {}));
|
|
6
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYm9vbGVhbi1zdHJpbmcuZW51bS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL3BheW1lbnQtY2xpZW50LWNvcmUvc3JjL2xpYi9jb3JlL2Jvb2xlYW4tc3RyaW5nLmVudW0udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsTUFBTSxDQUFOLElBQVksYUFHWDtBQUhELFdBQVksYUFBYTtJQUN2QiwyQkFBVSxDQUFBO0lBQ1YsNEJBQVcsQ0FBQTtBQUNiLENBQUMsRUFIVyxhQUFhLEtBQWIsYUFBYSxRQUd4QiIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBlbnVtIEJvb2xlYW5TdHJpbmcge1xuICB0cnVlID0gJzEnLFxuICBmYWxzZSA9ICcwJyxcbn1cbiJdfQ==
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWN0aW9uLnR5cGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9wYXltZW50LWNsaWVudC1jb3JlL3NyYy9saWIvY29yZS9wYXltZW50L2FjdGlvbnMvYWN0aW9uLnR5cGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBpbnRlcmZhY2UgQWN0aW9uPFQgPSBzdHJpbmcsIEQgPSBvYmplY3Q+IHtcbiAgdHlwZTogVDtcbiAgZGF0YTogRDtcbn1cbiJdfQ==
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMapping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5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBDaGVja1N0YXR1c0FjdGlvbiB9IGZyb20gJy4vY2hlY2stc3RhdHVzLmFjdGlvbi50eXBlJztcblxuZXhwb3J0IHR5cGUgTmV4dEFjdGlvbiA9IENoZWNrU3RhdHVzQWN0aW9uO1xuIl19
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5pdGlhbGl6ZS1yZXF1ZXN0LXBhcmFtcy5pbnRlcmZhY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9wYXltZW50LWNsaWVudC1jb3JlL3NyYy9saWIvY29yZS9wYXltZW50L2luaXRpYWxpemUtcmVxdWVzdC1wYXJhbXMuaW50ZXJmYWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgaW50ZXJmYWNlIEluaXRpYWxpemVSZXF1ZXN0UGFyYW1zIHtcbiAgYWNjZXNzX3Rva2VuOiBzdHJpbmc7XG4gIHBpZDogc3RyaW5nO1xuICBjb3VudHJ5Pzogc3RyaW5nO1xuICByZXR1cm5Vcmw/OiBzdHJpbmc7XG59XG4iXX0=
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { HttpHeaders } from '@angular/common/http';
|
|
2
|
-
import { Injectable } from '@angular/core';
|
|
3
|
-
import { lastValueFrom } from 'rxjs';
|
|
4
|
-
import { ResponseError } from '../exceptions-handling/errors/response-error.class';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
import * as i1 from "../http/secure-api/secure-api.service";
|
|
7
|
-
import * as i2 from "../settings/settings.service";
|
|
8
|
-
import * as i3 from "../country/country.service";
|
|
9
|
-
export class InitializeService {
|
|
10
|
-
constructor(secureApi, settingsService, countryService) {
|
|
11
|
-
this.secureApi = secureApi;
|
|
12
|
-
this.settingsService = settingsService;
|
|
13
|
-
this.countryService = countryService;
|
|
14
|
-
this.apiRoute = 'directpayment';
|
|
15
|
-
}
|
|
16
|
-
async request(config) {
|
|
17
|
-
const requestParams = {
|
|
18
|
-
access_token: this.settingsService.token,
|
|
19
|
-
pid: String(config.paymentMethodId),
|
|
20
|
-
country: this.countryService.getCountry(),
|
|
21
|
-
returnUrl: config.returnUrl,
|
|
22
|
-
};
|
|
23
|
-
return lastValueFrom(this.secureApi.post(this.apiRoute, new URLSearchParams({ ...requestParams }), {
|
|
24
|
-
headers: new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded; charset=utf-8'),
|
|
25
|
-
responseType: 'json',
|
|
26
|
-
})).catch((error) => {
|
|
27
|
-
throw new ResponseError(error.message);
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
InitializeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: InitializeService, deps: [{ token: i1.SecureApiClient }, { token: i2.SettingsService }, { token: i3.CountryService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
32
|
-
InitializeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: InitializeService, providedIn: 'root' });
|
|
33
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: InitializeService, decorators: [{
|
|
34
|
-
type: Injectable,
|
|
35
|
-
args: [{
|
|
36
|
-
providedIn: 'root',
|
|
37
|
-
}]
|
|
38
|
-
}], ctorParameters: function () { return [{ type: i1.SecureApiClient }, { type: i2.SettingsService }, { type: i3.CountryService }]; } });
|
|
39
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5pdGlhbGl6ZS5zZXJ2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J5KCksXG4gICAgICByZXR1cm5Vcmw6IGNvbmZpZy5yZXR1cm5VcmwsXG4gICAgfTtcblxuICAgIHJldHVybiBsYXN0VmFsdWVGcm9tKFxuICAgICAgdGhpcy5zZWN1cmVBcGkucG9zdDxYcHNSZXNwb25zZT4oXG4gICAgICAgIHRoaXMuYXBpUm91dGUsXG4gICAgICAgIG5ldyBVUkxTZWFyY2hQYXJhbXMoeyAuLi5yZXF1ZXN0UGFyYW1zIH0pLFxuICAgICAgICB7XG4gICAgICAgICAgaGVhZGVyczogbmV3IEh0dHBIZWFkZXJzKCkuc2V0KFxuICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZScsXG4gICAgICAgICAgICAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkOyBjaGFyc2V0PXV0Zi04J1xuICAgICAgICAgICksXG4gICAgICAgICAgcmVzcG9uc2VUeXBlOiAnanNvbicsXG4gICAgICAgIH1cbiAgICAgIClcbiAgICApLmNhdGNoKChlcnJvcjogRXJyb3IpID0+IHtcbiAgICAgIHRocm93IG5ldyBSZXNwb25zZUVycm9yKGVycm9yLm1lc3NhZ2UpO1xuICAgIH0pO1xuICB9XG59XG4iXX0=
|
|
@@ -1,16 +0,0 @@
|
|
|
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 { XpsResponse } from './xps-response.interface';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
export declare class InitializeService {
|
|
8
|
-
private readonly secureApi;
|
|
9
|
-
private readonly settingsService;
|
|
10
|
-
private readonly countryService;
|
|
11
|
-
private readonly apiRoute;
|
|
12
|
-
constructor(secureApi: SecureApiClient, settingsService: SettingsService, countryService: CountryService);
|
|
13
|
-
request(config: PaymentConfig): Promise<XpsResponse>;
|
|
14
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<InitializeService, never>;
|
|
15
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<InitializeService>;
|
|
16
|
-
}
|
|
Binary file
|
|
File without changes
|