@xsolla/payment-client-core 0.2.6 → 0.2.8
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/agreementsGroup.const.mjs +14 -0
- package/esm2020/lib/core/extended-window.interface.mjs +1 -1
- package/esm2020/lib/core/payment/actions/redirect/ps4-pages/pages-payment-methods-id.const.mjs +2 -2
- package/esm2020/lib/core/payment/actions/redirect/ps4-pages/pages-routes.const.mjs +3 -3
- package/esm2020/lib/core/payment/field-names.enum.mjs +2 -1
- package/esm2020/lib/core/payment/form-response.interface.mjs +2 -0
- package/esm2020/lib/core/payment/payment.interface.mjs +1 -1
- package/esm2020/lib/core/payment/payment.service.mjs +56 -2
- package/esm2020/lib/core/sdk-payment-systems/apple-pay/apple-pay-integration.type.mjs +2 -0
- package/esm2020/lib/core/sdk-payment-systems/apple-pay/apple-pay-params.interface.mjs +2 -0
- package/esm2020/lib/core/sdk-payment-systems/apple-pay/apple-pay.const.mjs +2 -0
- package/esm2020/lib/core/sdk-payment-systems/apple-pay/apple-pay.errors.enum.mjs +6 -0
- package/esm2020/lib/core/sdk-payment-systems/apple-pay/apple-pay.service.mjs +265 -0
- package/esm2020/lib/core/sdk-payment-systems/apple-pay/checkout-params.interface.mjs +2 -0
- package/esm2020/lib/core/sdk-payment-systems/google-pay/google-pay.service.mjs +4 -8
- package/esm2020/lib/core/user-agent/browserInfo.interface.mjs +2 -0
- package/esm2020/lib/core/user-agent/browsers.mjs +44 -0
- package/esm2020/lib/core/user-agent/device.enum.mjs +6 -0
- package/esm2020/lib/core/user-agent/os.mjs +255 -0
- package/esm2020/lib/core/user-agent/user-agent-data.interface.mjs +2 -0
- package/esm2020/lib/core/user-agent/user-agent.service.mjs +200 -0
- package/esm2020/lib/core-library.service.mjs +11 -1
- package/esm2020/public-api.mjs +3 -1
- package/fesm2015/xsolla-payment-client-core.mjs +852 -11
- package/fesm2015/xsolla-payment-client-core.mjs.map +1 -1
- package/fesm2020/xsolla-payment-client-core.mjs +845 -11
- package/fesm2020/xsolla-payment-client-core.mjs.map +1 -1
- package/lib/core/agreementsGroup.const.d.ts +2 -0
- package/lib/core/extended-window.interface.d.ts +11 -0
- package/lib/core/payment/actions/redirect/ps4-pages/pages-payment-methods-id.const.d.ts +1 -1
- package/lib/core/payment/field-names.enum.d.ts +2 -1
- package/lib/core/payment/form-response.interface.d.ts +8 -0
- package/lib/core/payment/payment.interface.d.ts +1 -0
- package/lib/core/payment/payment.service.d.ts +9 -1
- package/lib/core/sdk-payment-systems/apple-pay/apple-pay-integration.type.d.ts +1 -0
- package/lib/core/sdk-payment-systems/apple-pay/apple-pay-params.interface.d.ts +4 -0
- package/lib/core/sdk-payment-systems/apple-pay/apple-pay.const.d.ts +1 -0
- package/lib/core/sdk-payment-systems/apple-pay/apple-pay.errors.enum.d.ts +4 -0
- package/lib/core/sdk-payment-systems/apple-pay/apple-pay.service.d.ts +46 -0
- package/lib/core/sdk-payment-systems/apple-pay/checkout-params.interface.d.ts +9 -0
- package/lib/core/user-agent/browserInfo.interface.d.ts +13 -0
- package/lib/core/user-agent/browsers.d.ts +9 -0
- package/lib/core/user-agent/device.enum.d.ts +4 -0
- package/lib/core/user-agent/os.d.ts +7 -0
- package/lib/core/user-agent/user-agent-data.interface.d.ts +10 -0
- package/lib/core/user-agent/user-agent.service.d.ts +36 -0
- package/lib/core-library.service.d.ts +5 -0
- package/package.json +4 -2
- package/public-api.d.ts +2 -0
- package/xsolla-payment-client-core-0.2.8.tgz +0 -0
- package/xsolla-payment-client-core-0.2.6.tgz +0 -0
|
@@ -1,4 +1,15 @@
|
|
|
1
|
+
import { ApplePaySession } from 'braintree-web';
|
|
1
2
|
import { GooglePayLibrary } from './sdk-payment-systems/google-pay/google-pay-library.interface';
|
|
2
3
|
export interface ExtendedWindow extends Window {
|
|
4
|
+
ApplePaySession: typeof ApplePaySession;
|
|
5
|
+
BraintreeData?: {
|
|
6
|
+
_getDeviceData(): unknown;
|
|
7
|
+
_setupCollector(env: string): void;
|
|
8
|
+
environments: {
|
|
9
|
+
production: {
|
|
10
|
+
withId(merchant: string): string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
3
14
|
google?: GooglePayLibrary;
|
|
4
15
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const vkPay = 3496;
|
|
2
2
|
export declare const googlePay = 3431;
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const applePayId = 3175;
|
|
4
4
|
export declare const barzahlenPay = 1679;
|
|
5
5
|
export declare const naverPay = 3563;
|
|
6
6
|
export declare const venmoPay = 3636;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { XpsResponse } from './xps-response.interface';
|
|
2
|
+
import { InitializeResponse } from './initialize/response/initialize-response.class';
|
|
3
|
+
import { SubmitResponse } from './submit/response/submit-response.class';
|
|
4
|
+
export interface FormResponse {
|
|
5
|
+
type: 'sync' | 'initialize' | 'submit';
|
|
6
|
+
data: InitializeResponse | SubmitResponse | XpsResponse;
|
|
7
|
+
token: string;
|
|
8
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { UntypedFormGroup } from '@angular/forms';
|
|
2
|
+
import { FormControlStatus, UntypedFormGroup } from '@angular/forms';
|
|
3
3
|
import { FormService } from './form/form.service';
|
|
4
4
|
import { InitializeService } from './initialize/initialize.service';
|
|
5
5
|
import { Status } from './status/status.interface';
|
|
@@ -24,6 +24,7 @@ import { FormMessagesService } from './form-messages/form-messages.service';
|
|
|
24
24
|
import { SettingsService } from '../settings/settings.service';
|
|
25
25
|
import { CountryService } from '../country/country.service';
|
|
26
26
|
import { SdkPaymentSystemsInitialData } from '../sdk-payment-systems/sdk-payment-systems-initial-data.interface';
|
|
27
|
+
import { FormResponse } from './form-response.interface';
|
|
27
28
|
import * as i0 from "@angular/core";
|
|
28
29
|
export declare class PaymentService {
|
|
29
30
|
private readonly initializeService;
|
|
@@ -41,6 +42,9 @@ export declare class PaymentService {
|
|
|
41
42
|
private readonly countryService;
|
|
42
43
|
form: UntypedFormGroup | null;
|
|
43
44
|
get formFieldsStatus$(): Observable<FormFieldsStatus>;
|
|
45
|
+
get paymentForm$(): Observable<FormControlStatus | null>;
|
|
46
|
+
get formResponse$(): Observable<FormResponse | null>;
|
|
47
|
+
get formResponseValue(): FormResponse | null;
|
|
44
48
|
private data;
|
|
45
49
|
private financeDetails;
|
|
46
50
|
private focusFieldName;
|
|
@@ -48,7 +52,9 @@ export declare class PaymentService {
|
|
|
48
52
|
private config;
|
|
49
53
|
private destroy$;
|
|
50
54
|
private formDestroy$;
|
|
55
|
+
private readonly _paymentForm$;
|
|
51
56
|
private readonly formFieldsStatusSubject;
|
|
57
|
+
private readonly _formResponse$;
|
|
52
58
|
private isSavingMethodMode;
|
|
53
59
|
constructor(initializeService: InitializeService, submitService: SubmitService, syncService: SyncService, formService: FormService, statusService: StatusService, financeDetailsService: FinanceDetailsService, creditCardStateService: CreditCardStateService, nextActionService: NextActionService, controlConfigService: ControlConfigService, threeDsService: ThreeDsService, formMessagesService: FormMessagesService, settingsService: SettingsService, countryService: CountryService);
|
|
54
60
|
initialize(config: PaymentConfig): Promise<Field[]>;
|
|
@@ -64,6 +70,7 @@ export declare class PaymentService {
|
|
|
64
70
|
getFieldConfig(field: Field): ControlConfig | null;
|
|
65
71
|
changeFieldValue(name: string, value: string): void;
|
|
66
72
|
changeFieldState(name: string, state: InputEventName): void;
|
|
73
|
+
addExtraField(name: string, value: string): void;
|
|
67
74
|
destroy(): void;
|
|
68
75
|
private emitFinanceDetails;
|
|
69
76
|
private emitCreditCardState;
|
|
@@ -73,6 +80,7 @@ export declare class PaymentService {
|
|
|
73
80
|
private listenFinanceDetails;
|
|
74
81
|
private listenFormStatusChanges;
|
|
75
82
|
private updatePidConfig;
|
|
83
|
+
private emitFormResponse;
|
|
76
84
|
static ɵfac: i0.ɵɵFactoryDeclaration<PaymentService, never>;
|
|
77
85
|
static ɵprov: i0.ɵɵInjectableDeclaration<PaymentService>;
|
|
78
86
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ApplePayIntegration = 'sdk' | 'redirect' | 'none';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const applePayVersion = 3;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { ApplePayParams } from './apple-pay-params.interface';
|
|
3
|
+
import { ExtendedWindow } from '../../extended-window.interface';
|
|
4
|
+
import { ApplePayErrors } from './apple-pay.errors.enum';
|
|
5
|
+
import { UserAgentService } from '../../user-agent/user-agent.service';
|
|
6
|
+
import { ApplePayIntegration } from './apple-pay-integration.type';
|
|
7
|
+
import { SummaryFinanceDetailsAdapterService } from '../../payment/finance-details/summary/summary-finance-details-adapter.service';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
export declare class ApplePayService {
|
|
10
|
+
private readonly window;
|
|
11
|
+
private readonly userAgentService;
|
|
12
|
+
private readonly summaryFinanceDetailsAdapterService;
|
|
13
|
+
private readonly agreementFieldsNames;
|
|
14
|
+
private readonly payment;
|
|
15
|
+
private readonly error;
|
|
16
|
+
private readonly integrationType;
|
|
17
|
+
private paymentClient;
|
|
18
|
+
private readonly api;
|
|
19
|
+
private applePayParams;
|
|
20
|
+
private order?;
|
|
21
|
+
get paymentParameters(): ApplePayParams | null;
|
|
22
|
+
get payment$(): Observable<string>;
|
|
23
|
+
get error$(): Observable<ApplePayErrors>;
|
|
24
|
+
get integrationType$(): Observable<ApplePayIntegration>;
|
|
25
|
+
constructor(window: ExtendedWindow, userAgentService: UserAgentService, summaryFinanceDetailsAdapterService: SummaryFinanceDetailsAdapterService);
|
|
26
|
+
setApplePayParams(data: unknown): void;
|
|
27
|
+
initLibrary(tokenKey: string): Promise<void>;
|
|
28
|
+
redirectToPaymentPage(parameters: ApplePayParams, token: string): string | undefined;
|
|
29
|
+
setOrder(data: unknown): void;
|
|
30
|
+
proceedCheckout(parameters?: ApplePayParams): void;
|
|
31
|
+
isDeviceCapable(): boolean;
|
|
32
|
+
getTokenNonceFieldData(tokenNonce: string): {
|
|
33
|
+
name: string;
|
|
34
|
+
value: string;
|
|
35
|
+
};
|
|
36
|
+
updateApplePayParams(data: unknown): void;
|
|
37
|
+
private loadBraintree;
|
|
38
|
+
private getAppleToken;
|
|
39
|
+
private getTotalAmount;
|
|
40
|
+
private getTotalCurrency;
|
|
41
|
+
private getJsonValueFromField;
|
|
42
|
+
private emitError;
|
|
43
|
+
private emitIntegrationType;
|
|
44
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ApplePayService, never>;
|
|
45
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ApplePayService>;
|
|
46
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Device } from './device.enum';
|
|
2
|
+
export interface BrowserInfo {
|
|
3
|
+
name: string;
|
|
4
|
+
version: string | null;
|
|
5
|
+
ui_version: Device;
|
|
6
|
+
os: string | null;
|
|
7
|
+
mobile?: boolean;
|
|
8
|
+
tablet?: boolean;
|
|
9
|
+
iphone?: boolean;
|
|
10
|
+
ipad?: boolean;
|
|
11
|
+
ipod?: boolean;
|
|
12
|
+
android?: boolean;
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const unknownValue: "unknown";
|
|
2
|
+
export type BrowserName = typeof browsers[number]['sentName'] | typeof unknownValue | null;
|
|
3
|
+
export type BrowserApp = typeof browsers[number]['shortName'] | typeof unknownValue | null;
|
|
4
|
+
export interface BrowserInterface {
|
|
5
|
+
sentName: 'Mozilla Firefox' | 'Samsung Internet' | 'Opera' | 'Microsoft Edge (Legacy)' | 'Microsoft Edge (Chromium)' | 'Google Chrome or Chromium' | 'Apple Safari';
|
|
6
|
+
shortName: 'Firefox' | 'SamsungBrowser' | 'Opera' | 'MSEdge-legacy' | 'MSEdge' | 'Chrome' | 'Safari';
|
|
7
|
+
regexpBrowserNameWithVersion: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const browsers: BrowserInterface[];
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { browsers, BrowserApp } from './browsers';
|
|
2
|
+
import { ExtendedWindow } from '../extended-window.interface';
|
|
3
|
+
import { BrowserInfo } from './browserInfo.interface';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class UserAgentService {
|
|
6
|
+
private readonly window;
|
|
7
|
+
private _browserName;
|
|
8
|
+
private _browserVersion;
|
|
9
|
+
private _browserApp;
|
|
10
|
+
private _platform;
|
|
11
|
+
private _os;
|
|
12
|
+
constructor(window: ExtendedWindow);
|
|
13
|
+
get browserVersion(): string | null;
|
|
14
|
+
get browserApp(): BrowserApp;
|
|
15
|
+
get platform(): string | null;
|
|
16
|
+
get userAgent(): string;
|
|
17
|
+
get browserDescription(): typeof browsers[number]['sentName'] | string;
|
|
18
|
+
get isSafari(): boolean;
|
|
19
|
+
get iOsVersion(): string | null;
|
|
20
|
+
get browserInfo(): BrowserInfo;
|
|
21
|
+
get isMobileDevice(): boolean;
|
|
22
|
+
get isIosAndNotIpad(): boolean;
|
|
23
|
+
private getUserPlatform;
|
|
24
|
+
private getBrowserInformation;
|
|
25
|
+
private getOsInformation;
|
|
26
|
+
private get browserName();
|
|
27
|
+
private get isAndroid();
|
|
28
|
+
private get isXbox();
|
|
29
|
+
private get isLinux();
|
|
30
|
+
private get isWindows();
|
|
31
|
+
private get browserEngine();
|
|
32
|
+
private get os();
|
|
33
|
+
private get osType();
|
|
34
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UserAgentService, never>;
|
|
35
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<UserAgentService>;
|
|
36
|
+
}
|
|
@@ -29,9 +29,11 @@ import { NextAction } from './core/payment/actions/next-action.interface';
|
|
|
29
29
|
import { Balance } from './core/settings/balance.interface';
|
|
30
30
|
import { FormMessagesService } from './core/payment/form-messages/form-messages.service';
|
|
31
31
|
import { EditSavedMethodsService } from './core/edit-saved-methods/edit-saved-methods.service';
|
|
32
|
+
import { FormControlStatus } from '@angular/forms';
|
|
32
33
|
import { GooglePayService } from './core/sdk-payment-systems/google-pay/google-pay.service';
|
|
33
34
|
import { PaymentSystemProcessingService } from './core/sdk-payment-systems/payment-systems/payment-system-processing.service';
|
|
34
35
|
import { SdkPaymentSystems } from './core/sdk-payment-systems/sdk-payment-systems.interface';
|
|
36
|
+
import { FormResponse } from './core/payment/form-response.interface';
|
|
35
37
|
import * as i0 from "@angular/core";
|
|
36
38
|
export declare class CoreLibraryService {
|
|
37
39
|
private readonly settingsService;
|
|
@@ -73,6 +75,9 @@ export declare class CoreLibraryService {
|
|
|
73
75
|
getLegalComponentConfig(): LegalComponentConfig;
|
|
74
76
|
getFieldMask(field: Field): undefined | (() => string);
|
|
75
77
|
getUserBalanceValue(): Balance | null;
|
|
78
|
+
get paymentForm$(): Observable<FormControlStatus | null>;
|
|
79
|
+
get formResponse$(): Observable<FormResponse | null>;
|
|
80
|
+
get formResponseValue(): FormResponse | null;
|
|
76
81
|
static ɵfac: i0.ɵɵFactoryDeclaration<CoreLibraryService, never>;
|
|
77
82
|
static ɵprov: i0.ɵɵInjectableDeclaration<CoreLibraryService>;
|
|
78
83
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsolla/payment-client-core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^15.2.0",
|
|
6
6
|
"@angular/core": "^15.2.0",
|
|
@@ -14,7 +14,9 @@
|
|
|
14
14
|
"centrifuge": "^4.0.1",
|
|
15
15
|
"jsencrypt": "^3.3.2",
|
|
16
16
|
"stacktrace-js": "^2.0.2",
|
|
17
|
-
"tslib": "^2.3.0"
|
|
17
|
+
"tslib": "^2.3.0",
|
|
18
|
+
"braintree-web": "^3.100.0",
|
|
19
|
+
"@types/braintree-web": "^3.96.11"
|
|
18
20
|
},
|
|
19
21
|
"module": "fesm2015/xsolla-payment-client-core.mjs",
|
|
20
22
|
"es2020": "fesm2020/xsolla-payment-client-core.mjs",
|
package/public-api.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export * from './lib/core-library.service';
|
|
2
2
|
export * from './lib/core-library.module';
|
|
3
3
|
export * from './lib/core/legal/legal.component.config';
|
|
4
|
+
export * from './lib/core/sdk-payment-systems/apple-pay/apple-pay.service';
|
|
5
|
+
export * from './lib/core/sdk-payment-systems/apple-pay/apple-pay-params.interface';
|
|
Binary file
|
|
Binary file
|