@alipay/ams-checkout 2.0.29 → 2.0.30
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/ams-checkout.js +3 -3
- package/dist/ams-checkout.min.js +1 -1
- package/esm/config/index.js +1 -1
- package/esm/core/component/element/elementProcessor/convertPaymentMethods.d.ts +1 -0
- package/esm/core/component/element/elementProcessor/convertPaymentMethods.js +4 -2
- package/esm/core/component/element/modernElementController/index.js +2 -2
- package/esm/core/component/element/type.d.ts +4 -0
- package/esm/modern/component/channel.d.ts +21 -0
- package/esm/modern/component/component.inline.style.d.ts +10 -0
- package/esm/modern/component/component.popup.style.d.ts +26 -0
- package/esm/modern/component/popupWindow.style.d.ts +27 -0
- package/esm/modern/config/index.d.ts +23 -0
- package/esm/modern/config/request.d.ts +21 -0
- package/esm/modern/constant/auto-debit.d.ts +12 -0
- package/esm/modern/constant/easysafepay.d.ts +16 -0
- package/esm/modern/constant/element.d.ts +27 -0
- package/esm/modern/constant/index.d.ts +331 -0
- package/esm/modern/core/bus/ability/callback.d.ts +9 -0
- package/esm/modern/core/bus/ability/security.d.ts +10 -0
- package/esm/modern/core/bus/ability/tracker.d.ts +9 -0
- package/esm/modern/core/bus/index.d.ts +125 -0
- package/esm/modern/core/bus/interface.d.ts +36 -0
- package/esm/modern/core/component/address.d.ts +8 -0
- package/esm/modern/core/component/appPreloadProcessing.d.ts +1 -0
- package/esm/modern/core/component/ckp/index.d.ts +29 -0
- package/esm/modern/core/component/element/EventCenter/index.d.ts +41 -0
- package/esm/modern/core/component/element/config.d.ts +10 -0
- package/esm/modern/core/component/element/elementContainerService/containerService.d.ts +34 -0
- package/esm/modern/core/component/element/elementContainerService/index.d.ts +20 -0
- package/esm/modern/core/component/element/elementController/index.d.ts +54 -0
- package/esm/modern/core/component/element/elementProcessor/addressProcessor.d.ts +20 -0
- package/esm/modern/core/component/element/elementProcessor/authProcessor.d.ts +20 -0
- package/esm/modern/core/component/element/elementProcessor/baseElementProcessor.d.ts +42 -0
- package/esm/modern/core/component/element/elementProcessor/convertPaymentMethods.d.ts +23 -0
- package/esm/modern/core/component/element/elementProcessor/paymentProcessor.d.ts +37 -0
- package/esm/modern/core/component/element/index.d.ts +17 -0
- package/esm/modern/core/component/element/mock.d.ts +10 -0
- package/esm/modern/core/component/element/modernElementController/adapter.d.ts +19 -0
- package/esm/modern/core/component/element/modernElementController/index.d.ts +172 -0
- package/esm/modern/core/component/element/type.d.ts +590 -0
- package/esm/modern/core/component/element/util.d.ts +93 -0
- package/esm/modern/core/component/index.d.ts +58 -0
- package/esm/modern/core/instance/index.d.ts +97 -0
- package/esm/modern/core/utils/connectConfig.d.ts +11 -0
- package/esm/modern/foundation/core/index.d.ts +36 -0
- package/esm/modern/foundation/index.d.ts +93 -0
- package/esm/modern/foundation/product-processor/autoDebit/deps.d.ts +14 -0
- package/esm/modern/foundation/product-processor/autoDebit/index.d.ts +48 -0
- package/esm/modern/foundation/product-processor/easysafepay/deps.d.ts +20 -0
- package/esm/modern/foundation/product-processor/easysafepay/index.d.ts +29 -0
- package/esm/modern/foundation/product-processor/element/index.d.ts +7 -0
- package/esm/modern/foundation/service/api-bus/ability/globalData.d.ts +10 -0
- package/esm/modern/foundation/service/api-bus/ability/request.d.ts +10 -0
- package/esm/modern/foundation/service/api-bus/ability/security.d.ts +12 -0
- package/esm/modern/foundation/service/api-bus/ability/tracker.d.ts +9 -0
- package/esm/modern/foundation/service/api-bus/busManager.d.ts +127 -0
- package/esm/modern/foundation/service/api-bus/index.d.ts +20 -0
- package/esm/modern/foundation/service/api-bus/interface.d.ts +48 -0
- package/esm/modern/foundation/service/container/index.d.ts +42 -0
- package/esm/modern/foundation/service/container/popup.d.ts +31 -0
- package/esm/modern/foundation/service/container/utils.d.ts +7 -0
- package/esm/modern/foundation/service/event-center.d.ts +82 -0
- package/esm/modern/foundation/service/global-data/index.d.ts +11 -0
- package/esm/modern/foundation/service/index.d.ts +19 -0
- package/esm/modern/foundation/service/log/index.d.ts +44 -0
- package/esm/modern/foundation/service/log/keys.d.ts +13 -0
- package/esm/modern/foundation/service/log/processor.d.ts +9 -0
- package/esm/modern/foundation/service/log/types.d.ts +33 -0
- package/esm/modern/foundation/service/requester/deps.d.ts +17 -0
- package/esm/modern/foundation/service/requester/requester.d.ts +22 -0
- package/esm/modern/foundation/service/security/index.d.ts +33 -0
- package/esm/modern/foundation/service/security/security.d.ts +54 -0
- package/esm/modern/foundation/utils/gray_scale_utils.d.ts +7 -0
- package/esm/modern/foundation/utils/payment_context_utils.d.ts +13 -0
- package/esm/modern/foundation/utils/payment_product_utils.d.ts +13 -0
- package/esm/modern/foundation/utils/preload_helper.d.ts +24 -0
- package/esm/modern/foundation/utils/redirect_utils.d.ts +11 -0
- package/esm/modern/foundation/utils/system_events.d.ts +4 -0
- package/esm/modern/foundation/utils/web_app_url_utils.d.ts +114 -0
- package/esm/modern/index.js +1 -1
- package/esm/modern/loader/constant.d.ts +36 -0
- package/esm/modern/loader/utils/proxyPerformance.d.ts +20 -0
- package/esm/modern/main.d.ts +54 -0
- package/esm/modern/{index.d.ts → modern/index.d.ts} +1 -1
- package/esm/modern/modern/loadAntomTracker.d.ts +7 -0
- package/esm/modern/modern/preload/antomManifestAdapter.d.ts +11 -0
- package/esm/modern/modern/preload/config.d.ts +10 -0
- package/esm/modern/modern/preload/gatewayPreconnection.d.ts +53 -0
- package/esm/modern/modern/preload/preloadAntomElements.d.ts +12 -0
- package/esm/modern/modern/preload/startAntomPreload.d.ts +2 -0
- package/esm/modern/modern/sdk/applepay-core/ApplePayHostService.d.ts +102 -0
- package/esm/modern/modern/sdk/elements/CVVElement.d.ts +144 -0
- package/esm/modern/modern/sdk/elements/PaymentElement.d.ts +204 -0
- package/esm/modern/modern/sdk/elements/appearanceRules.d.ts +59 -0
- package/esm/modern/modern/sdk/elements/appearanceRulesDefaults.d.ts +2 -0
- package/esm/modern/modern/sdk/eventsMap.d.ts +135 -0
- package/esm/modern/modern/sdk/oneapi/iexpfront/PaymentSessionService.d.ts +69 -0
- package/esm/modern/modern/sdk/oneapi/iexpfront/definitions.d.ts +5346 -0
- package/esm/modern/modern/sdk/oneapi/iexpfront/preConnection.d.ts +6 -0
- package/esm/modern/modern/sdk/stageName.d.ts +3 -0
- package/esm/modern/modern/sdk/tools/awaitWrap.d.ts +14 -0
- package/esm/modern/modern/sdk/tools/buildPageUrl.d.ts +4 -0
- package/esm/modern/modern/sdk/tools/checkSessionData.d.ts +1 -0
- package/esm/modern/modern/sdk/tools/expressElement/applePay.d.ts +9 -0
- package/esm/modern/modern/sdk/tools/expressElement/applePayHostToken.d.ts +32 -0
- package/esm/modern/modern/sdk/tools/expressElement/types.d.ts +277 -0
- package/esm/modern/modern/sdk/tools/getDevReqConfig.d.ts +2 -0
- package/esm/modern/modern/sdk/tools/getLocaleFromRenderData.d.ts +6 -0
- package/esm/modern/modern/sdk/tools/getMetaData.d.ts +126 -0
- package/esm/modern/modern/sdk/tools/modalMessageMonitor.d.ts +41 -0
- package/esm/modern/modern/sdk/tools/openModal.d.ts +20 -0
- package/esm/modern/modern/sdk/tools/paymentElement/applePayHostToken.d.ts +38 -0
- package/esm/modern/modern/sdk/tools/paymentElement/googlePayHostToken.d.ts +38 -0
- package/esm/modern/modern/sdk/tools/paymentElement/tracker.d.ts +16 -0
- package/esm/modern/modern/sdk/tools/paymentElement/walletHostListeners.d.ts +19 -0
- package/esm/modern/modern/sdk/tools/preloadTracking.d.ts +5 -0
- package/esm/modern/modern/sdk/tools/showToast.d.ts +33 -0
- package/esm/modern/modern/sdk/tools/validatePaymentAmount.d.ts +19 -0
- package/esm/modern/modern/sdk/tracking/elementTracker.d.ts +65 -0
- package/esm/modern/modern/sdk/types.d.ts +310 -0
- package/esm/modern/modern/tools.d.ts +26 -0
- package/esm/modern/plugin/applepay/component.d.ts +50 -0
- package/esm/modern/plugin/applepay/index.d.ts +17 -0
- package/esm/modern/plugin/applepay/interface.d.ts +161 -0
- package/esm/modern/plugin/applepay/service.d.ts +54 -0
- package/esm/modern/plugin/component/cashierApp.d.ts +38 -0
- package/esm/modern/plugin/component/channel.d.ts +73 -0
- package/esm/modern/plugin/component/component.inline.style.d.ts +10 -0
- package/esm/modern/plugin/component/component.popup.style.d.ts +25 -0
- package/esm/modern/plugin/component/index.d.ts +133 -0
- package/esm/modern/plugin/component/popupWindow.style.d.ts +11 -0
- package/esm/modern/plugin/const.d.ts +2 -0
- package/esm/modern/plugin/payment-element/utils.d.ts +2 -0
- package/esm/modern/plugin/paypal/index.d.ts +20 -0
- package/esm/modern/plugin/type.d.ts +34 -0
- package/esm/modern/plugin/utils.d.ts +6 -0
- package/esm/modern/preload/antomManifestAdapter.d.ts +11 -0
- package/esm/modern/preload/antomManifestAdapter.js +116 -0
- package/esm/modern/preload/config.d.ts +10 -0
- package/esm/modern/preload/config.js +46 -0
- package/esm/modern/preload/gatewayPreconnection.d.ts +53 -0
- package/esm/modern/preload/gatewayPreconnection.js +213 -0
- package/esm/modern/preload/preloadAntomElements.d.ts +12 -0
- package/esm/modern/preload/preloadAntomElements.js +99 -0
- package/esm/modern/preload/startAntomPreload.d.ts +2 -0
- package/esm/modern/preload/startAntomPreload.js +9 -0
- package/esm/modern/request/index.d.ts +9 -0
- package/esm/modern/request/utils.d.ts +28 -0
- package/esm/modern/service/index.d.ts +13 -0
- package/esm/modern/tools.js +1 -1
- package/esm/modern/types/index.d.ts +862 -0
- package/esm/modern/util/beforeConfirm.d.ts +14 -0
- package/esm/modern/util/createIframeNode.d.ts +6 -0
- package/esm/modern/util/debug.d.ts +1 -0
- package/esm/modern/util/get.d.ts +25 -0
- package/esm/modern/util/getBackScheme.d.ts +5 -0
- package/esm/modern/util/index.d.ts +61 -0
- package/esm/modern/util/jshield-apdid/apdid-loader.d.ts +89 -0
- package/esm/modern/util/jshield-apdid/index.d.ts +21 -0
- package/esm/modern/util/logger.d.ts +67 -0
- package/esm/modern/util/mock.d.ts +1 -0
- package/esm/modern/util/redirect.d.ts +6 -0
- package/esm/modern/util/security-registry.d.ts +72 -0
- package/esm/modern/util/security.d.ts +55 -0
- package/esm/modern/util/spm-map.d.ts +217 -0
- package/esm/modern/util/storage.d.ts +2 -0
- package/esm/modern/util/timezone.d.ts +1 -0
- package/esm/modern/util/upgrade.d.ts +39 -0
- package/esm/modern/util/versionCompare.d.ts +15 -0
- package/esm/tsdoc-metadata.json +1 -1
- package/esm/types/index.d.ts +6 -0
- package/esm/util/logger.js +1 -1
- package/package.json +2 -1
- package/types.d.ts +52 -2
- package/types.untrimmed.d.ts +70 -2
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** Configuration options for rendering a toast notification. */
|
|
2
|
+
export interface ToastParams {
|
|
3
|
+
/** Text displayed in the toast. */
|
|
4
|
+
message: string;
|
|
5
|
+
/** Placement of the toast container within the viewport. */
|
|
6
|
+
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'center';
|
|
7
|
+
/** Toast background color in any valid CSS color format. */
|
|
8
|
+
backgroundColor?: string;
|
|
9
|
+
/** Toast text color in any valid CSS color format. */
|
|
10
|
+
color?: string;
|
|
11
|
+
/** Toast padding in any valid CSS length format. */
|
|
12
|
+
padding?: string;
|
|
13
|
+
/** Toast border radius in any valid CSS length format. */
|
|
14
|
+
borderRadius?: string;
|
|
15
|
+
/** Toast font size in any valid CSS length format. */
|
|
16
|
+
fontSize?: string;
|
|
17
|
+
/** Stacking order of the toast container. */
|
|
18
|
+
zIndex?: number;
|
|
19
|
+
/** Toast width in any valid CSS length format. */
|
|
20
|
+
width?: string;
|
|
21
|
+
/** Time in milliseconds before the toast starts to disappear. */
|
|
22
|
+
duration?: number;
|
|
23
|
+
/** Preset status icon displayed above the message. */
|
|
24
|
+
icon?: 'SUCCESS' | 'FAIL';
|
|
25
|
+
/** Whether the status icon uses a spinning animation. */
|
|
26
|
+
spin?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Displays a toast notification using the provided appearance and timing options.
|
|
30
|
+
*
|
|
31
|
+
* @param options - Toast content, appearance, and display timing.
|
|
32
|
+
*/
|
|
33
|
+
export declare function showToast(options: ToastParams): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Amount object shape used for validation.
|
|
3
|
+
*/
|
|
4
|
+
export interface AmountInput {
|
|
5
|
+
currency?: string;
|
|
6
|
+
value: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Validate payment amount before updating config.
|
|
10
|
+
*
|
|
11
|
+
* Throws `AntomSDKError` with specific error codes when validation fails:
|
|
12
|
+
* - `PAYMENT_IN_PROGRESS` — amount update blocked during active payment
|
|
13
|
+
* - `AMOUNT_VALUE_EMPTY` — amount.value is falsy
|
|
14
|
+
* - `AMOUNT_VALUE_INVALID` — format mismatch or non-positive number
|
|
15
|
+
*
|
|
16
|
+
* @param amount The amount to validate (undefined = skip validation)
|
|
17
|
+
* @param paymentInProgress Whether a payment flow is currently active
|
|
18
|
+
*/
|
|
19
|
+
export declare function validatePaymentAmount(amount: AmountInput | undefined, paymentInProgress: boolean): void;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { sdkTracker } from '@antintl/opensdk-core';
|
|
2
|
+
import type { CashierSdkActionQueryResult } from '../oneapi/iexpfront/definitions';
|
|
3
|
+
import { type IPaymentSessionMetaData } from '../tools/getMetaData';
|
|
4
|
+
export type ApiOutcome = 'success' | 'fail' | 'cancelled' | 'processing' | 'error' | 'unknown';
|
|
5
|
+
export declare const normalizeElementEventName: (event: PropertyKey) => string;
|
|
6
|
+
export interface ElementTrackerEnrichment {
|
|
7
|
+
metaData?: IPaymentSessionMetaData;
|
|
8
|
+
renderData?: CashierSdkActionQueryResult;
|
|
9
|
+
locale?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ApiReport {
|
|
12
|
+
outcome: ApiOutcome;
|
|
13
|
+
durationMs: number;
|
|
14
|
+
errorCode?: string;
|
|
15
|
+
traceId?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface ApiOutput {
|
|
18
|
+
outcome: ApiOutcome;
|
|
19
|
+
errorCode?: string;
|
|
20
|
+
traceId?: string;
|
|
21
|
+
fields?: Record<string, unknown>;
|
|
22
|
+
}
|
|
23
|
+
export interface ApiError {
|
|
24
|
+
code: string;
|
|
25
|
+
source: string;
|
|
26
|
+
traceId: string;
|
|
27
|
+
}
|
|
28
|
+
interface ApiRunOptions<T> {
|
|
29
|
+
msg: string;
|
|
30
|
+
inputFields?: () => Record<string, unknown>;
|
|
31
|
+
outputFields?: (result: T) => ApiOutput;
|
|
32
|
+
errorFields?: (error: ApiError) => Record<string, unknown>;
|
|
33
|
+
}
|
|
34
|
+
export interface AsyncApiRunOptions<T> extends ApiRunOptions<T> {
|
|
35
|
+
action: () => Promise<T>;
|
|
36
|
+
}
|
|
37
|
+
export interface SyncApiRunOptions<T> extends ApiRunOptions<T> {
|
|
38
|
+
action: () => T;
|
|
39
|
+
}
|
|
40
|
+
export interface ElementTracker {
|
|
41
|
+
readonly merchantId: string;
|
|
42
|
+
readonly productScene: string;
|
|
43
|
+
readonly productSceneVersion: string;
|
|
44
|
+
readonly paymentMethodCategoryType: string;
|
|
45
|
+
readonly paymentMethodType: string;
|
|
46
|
+
readonly trackId: string;
|
|
47
|
+
readonly requestTracker: typeof sdkTracker;
|
|
48
|
+
enrich: (data: ElementTrackerEnrichment) => void;
|
|
49
|
+
setPaymentMethodType: (paymentMethodType?: string) => void;
|
|
50
|
+
trackMount: (msg: string, extra?: Record<string, unknown>) => void;
|
|
51
|
+
trackHandshake: (msg: string, extra?: Record<string, unknown>) => void;
|
|
52
|
+
trackElement: (msg: string, extra?: Record<string, unknown>) => void;
|
|
53
|
+
trackApi: (msg: string, report: ApiReport, extra?: Record<string, unknown>) => void;
|
|
54
|
+
trackError: (msg: string, extra?: Record<string, unknown>) => void;
|
|
55
|
+
runAsyncApi: <T>(options: AsyncApiRunOptions<T>) => Promise<T>;
|
|
56
|
+
runSyncApi: <T>(options: SyncApiRunOptions<T>) => T;
|
|
57
|
+
}
|
|
58
|
+
export interface CreateElementTrackerOptions {
|
|
59
|
+
elementType: string;
|
|
60
|
+
env?: string;
|
|
61
|
+
locale?: string;
|
|
62
|
+
elementInstanceId?: string;
|
|
63
|
+
}
|
|
64
|
+
export declare function createElementTracker(sessionData: string | undefined, options: CreateElementTrackerOptions): ElementTracker;
|
|
65
|
+
export {};
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
import { AntomError } from '@antintl/antom-toolset';
|
|
2
|
+
import type { BaseElements, BaseFactoryConfig, BaseMainElement } from '@antintl/opensdk-core';
|
|
3
|
+
import type { CVVAppearance } from './elements/CVVElement';
|
|
4
|
+
import type { PaymentSubmitParams } from './elements/PaymentElement';
|
|
5
|
+
import type { OpenModalParams } from './tools/openModal';
|
|
6
|
+
export type { AppearanceLayoutDeclarations, AppearanceLayoutProperty, AppearancePaintProperty, AppearanceRuleScopeSuffix, AppearanceRuleSelector, AppearanceSpacingToken, AppearanceSpacingValue, } from './elements/appearanceRules';
|
|
7
|
+
export type * from './eventsMap';
|
|
8
|
+
export type AntomPreloadElement = 'payment' | 'express' | 'vaulting' | 'CVV';
|
|
9
|
+
export interface AntomPreloadConfig {
|
|
10
|
+
/** Elements2 types the merchant expects to create after loading the SDK. */
|
|
11
|
+
elements: AntomPreloadElement[];
|
|
12
|
+
}
|
|
13
|
+
/** @internal Telemetry context passed to Elements2 through the existing handshake. */
|
|
14
|
+
export interface PreloadTelemetryContext {
|
|
15
|
+
requested: boolean;
|
|
16
|
+
phaseAtElementCreate: 'not_requested' | 'resolving' | 'running' | 'critical_completed' | 'failed' | 'skipped';
|
|
17
|
+
leadTimeMs?: number;
|
|
18
|
+
criticalDurationMs?: number;
|
|
19
|
+
taskId?: string;
|
|
20
|
+
preconnectedRegions?: readonly ('SG' | 'US' | 'DE')[];
|
|
21
|
+
preconnectionMode?: 'configured' | 'regional';
|
|
22
|
+
actualRegion?: string;
|
|
23
|
+
predictionResult?: 'hit' | 'miss';
|
|
24
|
+
preconnectionStatus?: 'running' | 'completed' | 'partial_failed' | 'failed';
|
|
25
|
+
preconnectionLeadTimeMs?: number;
|
|
26
|
+
preconnectionReadyBeforeFirstRpc?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @public
|
|
30
|
+
* @description loadAntom config type
|
|
31
|
+
*/
|
|
32
|
+
export interface LoadAntomConfig extends Omit<BaseFactoryConfig, 'trackerCode' | 'targetOrigin' | 'env' | 'version'> {
|
|
33
|
+
/**
|
|
34
|
+
* @description 这是env的别名,env优先级高于environment,两者都设置以env为准
|
|
35
|
+
*/
|
|
36
|
+
environment?: 'sandbox' | 'prod';
|
|
37
|
+
/**
|
|
38
|
+
* @description 环境配置,默认为prod
|
|
39
|
+
*/
|
|
40
|
+
env?: 'sandbox' | 'prod';
|
|
41
|
+
/** Starts best-effort Elements2 resource preload without delaying loadAntom. */
|
|
42
|
+
preload?: AntomPreloadConfig;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @description antom sdk config type
|
|
46
|
+
*/
|
|
47
|
+
export interface AntomSDKConfig extends Omit<BaseFactoryConfig, 'version' | 'targetOrigin'> {
|
|
48
|
+
version?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface ConfirmCardSetupOptions {
|
|
51
|
+
elements: BaseMainElement | BaseElements;
|
|
52
|
+
redirect?: 'always' | 'if_required';
|
|
53
|
+
}
|
|
54
|
+
export type ConfirmPaymentOptions = PaymentSubmitParams & {
|
|
55
|
+
appearance?: CVVAppearance;
|
|
56
|
+
/**
|
|
57
|
+
* @description 集成用户自定义信息(如 cardHolderName)
|
|
58
|
+
*/
|
|
59
|
+
params?: Record<string, unknown>;
|
|
60
|
+
} & ({
|
|
61
|
+
/** 已挂载的 Element;确认时使用其创建时绑定的会话。 */
|
|
62
|
+
elements: BaseMainElement | BaseElements;
|
|
63
|
+
/** @deprecated 传入 elements 时无需重复传递,且不会覆盖 Element 的会话。 */
|
|
64
|
+
sessionData?: string;
|
|
65
|
+
} | {
|
|
66
|
+
elements?: undefined;
|
|
67
|
+
/** 无 UI 模式必填,仅用于创建内部 CVVElement。 */
|
|
68
|
+
sessionData: string;
|
|
69
|
+
});
|
|
70
|
+
export type { ToastParams } from './tools/showToast';
|
|
71
|
+
/**
|
|
72
|
+
* modal打开参数类型
|
|
73
|
+
* @internal 内部使用,不暴露到外部
|
|
74
|
+
*/
|
|
75
|
+
export interface AntomOpenModalConfig extends OpenModalParams {
|
|
76
|
+
}
|
|
77
|
+
export type SubmitParams = {
|
|
78
|
+
redirect?: 'always' | 'if_required';
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* @description 成功时的数据类型
|
|
82
|
+
*/
|
|
83
|
+
export type SubmitResult = {
|
|
84
|
+
/**
|
|
85
|
+
* 查询到的结果码或者错误码, 在SUCCESS无该字段
|
|
86
|
+
* @deprecated 已废弃请读取error中的code
|
|
87
|
+
* @internal
|
|
88
|
+
*/
|
|
89
|
+
code?: string;
|
|
90
|
+
/**
|
|
91
|
+
* 查询到的结果消息, 在SUCCESS无该字段
|
|
92
|
+
* @deprecated 已废弃请读取error中的message
|
|
93
|
+
* @internal
|
|
94
|
+
*/
|
|
95
|
+
message?: string;
|
|
96
|
+
/**
|
|
97
|
+
* 查询到的状态
|
|
98
|
+
*/
|
|
99
|
+
status: 'SUCCESS' | 'CANCELLED' | 'FAIL' | 'PROCESSING';
|
|
100
|
+
/**
|
|
101
|
+
* @description 对结果的详细结果码和结果信息,在status为SUCCESS时无该字段
|
|
102
|
+
*/
|
|
103
|
+
error?: {
|
|
104
|
+
/**
|
|
105
|
+
* 查询到的结果码或者错误码
|
|
106
|
+
*/
|
|
107
|
+
code?: string;
|
|
108
|
+
/**
|
|
109
|
+
* 查询到的结果消息
|
|
110
|
+
*/
|
|
111
|
+
message?: string;
|
|
112
|
+
/**
|
|
113
|
+
* @description 接口错误时的链路追踪 id,用于定位排查根因(非错误状态无该字段)
|
|
114
|
+
*/
|
|
115
|
+
traceId?: string;
|
|
116
|
+
/**
|
|
117
|
+
* @description 是否需要更换 session 重试
|
|
118
|
+
*/
|
|
119
|
+
needChangeSessionForRetry?: boolean;
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* 是否是用户手动取消3D
|
|
123
|
+
*/
|
|
124
|
+
userCanceled3D?: boolean;
|
|
125
|
+
};
|
|
126
|
+
export declare const AntomSDKErrorCodes: {
|
|
127
|
+
/**
|
|
128
|
+
* @description 找不到主元素
|
|
129
|
+
*/
|
|
130
|
+
readonly NOT_FIND_MAINELEMENT: "NOT_FIND_MAINELEMENT";
|
|
131
|
+
/**
|
|
132
|
+
* @description sessionData无效
|
|
133
|
+
*/
|
|
134
|
+
readonly SESSION_DATA_INVALID: "SESSION_DATA_INVALID";
|
|
135
|
+
/**
|
|
136
|
+
* @description WebApp 初始化超时
|
|
137
|
+
*/
|
|
138
|
+
readonly SDK_LAUNCH_PAYMENT_APP_ERROR: "SDK_LAUNCH_PAYMENT_APP_ERROR";
|
|
139
|
+
/**
|
|
140
|
+
* @description 参数非法,缺少必填参数或参数值不合法
|
|
141
|
+
*/
|
|
142
|
+
readonly PARAM_INVALID: "PARAM_INVALID";
|
|
143
|
+
/**
|
|
144
|
+
* @description channelClientId 查询接口超时
|
|
145
|
+
*/
|
|
146
|
+
readonly CHANNEL_CLIENT_ID_QUERY_TIMEOUT: "CHANNEL_CLIENT_ID_QUERY_TIMEOUT";
|
|
147
|
+
/**
|
|
148
|
+
* @description channelClientId 查询返回 success=true 但缺少 channelClientId
|
|
149
|
+
*/
|
|
150
|
+
readonly CHANNEL_CLIENT_ID_MISSING: "CHANNEL_CLIENT_ID_MISSING";
|
|
151
|
+
/**
|
|
152
|
+
* @description channelClientId 查询失败(success=false 或其他异常)
|
|
153
|
+
*/
|
|
154
|
+
readonly CHANNEL_CLIENT_ID_QUERY_FAILED: "CHANNEL_CLIENT_ID_QUERY_FAILED";
|
|
155
|
+
/**
|
|
156
|
+
* @description channelClientId 查询失败(请求异常,如网络错误、服务器错误等)
|
|
157
|
+
*/
|
|
158
|
+
readonly CHANNEL_CLIENT_ID_QUERY_ERROR: "CHANNEL_CLIENT_ID_QUERY_ERROR";
|
|
159
|
+
/**
|
|
160
|
+
* @description checkout 页面未加载成功,不允许 updateConfig
|
|
161
|
+
*/
|
|
162
|
+
readonly CHECKOUT_NOT_READY: "CHECKOUT_NOT_READY";
|
|
163
|
+
/**
|
|
164
|
+
* @description 支付进行中,不允许更新金额
|
|
165
|
+
*/
|
|
166
|
+
readonly PAYMENT_IN_PROGRESS: "PAYMENT_IN_PROGRESS";
|
|
167
|
+
/**
|
|
168
|
+
* @description 金额不能为空
|
|
169
|
+
*/
|
|
170
|
+
readonly AMOUNT_VALUE_EMPTY: "AMOUNT_VALUE_EMPTY";
|
|
171
|
+
/**
|
|
172
|
+
* @description 金额格式非法(仅允许 ASCII 数字字符串)
|
|
173
|
+
*/
|
|
174
|
+
readonly AMOUNT_VALUE_INVALID: "AMOUNT_VALUE_INVALID";
|
|
175
|
+
/**
|
|
176
|
+
* @description Amount currency does not match the payment session currency
|
|
177
|
+
*/
|
|
178
|
+
readonly AMOUNT_CURRENCY_MISMATCH: "AMOUNT_CURRENCY_MISMATCH";
|
|
179
|
+
/**
|
|
180
|
+
* @description Amount currency is not supported
|
|
181
|
+
*/
|
|
182
|
+
readonly AMOUNT_CURRENCY_UNSUPPORTED: "AMOUNT_CURRENCY_UNSUPPORTED";
|
|
183
|
+
/**
|
|
184
|
+
* @description Amount currency precision is not supported
|
|
185
|
+
*/
|
|
186
|
+
readonly AMOUNT_PRECISION_UNSUPPORTED: "AMOUNT_PRECISION_UNSUPPORTED";
|
|
187
|
+
/**
|
|
188
|
+
* @description Amount conversion timed out
|
|
189
|
+
*/
|
|
190
|
+
readonly AMOUNT_RESOLVE_TIMEOUT: "AMOUNT_RESOLVE_TIMEOUT";
|
|
191
|
+
/**
|
|
192
|
+
* @description Amount conversion failed
|
|
193
|
+
*/
|
|
194
|
+
readonly AMOUNT_RESOLVE_FAILED: "AMOUNT_RESOLVE_FAILED";
|
|
195
|
+
readonly GENERATE_ELEMENT_KEY_FAILED: "GENERATE_ELEMENT_KEY_FAILED";
|
|
196
|
+
readonly ELEMENT_INIT_FAILED: "ELEMENT_INIT_FAILED";
|
|
197
|
+
readonly MOUNT_TIMEOUT: "MOUNT_TIMEOUT";
|
|
198
|
+
readonly MOUNT_MISSING_CONTAINER: "MOUNT_MISSING_CONTAINER";
|
|
199
|
+
readonly MOUNT_IFRAME_LOAD_ERROR: "MOUNT_IFRAME_LOAD_ERROR";
|
|
200
|
+
readonly MOUNT_NOT_MAINELEMENT_WITH_SINGLE_MODE: "MOUNT_NOT_MAINELEMENT_WITH_SINGLE_MODE";
|
|
201
|
+
readonly MOUNT_NOT_SUPPORT: "MOUNT_NOT_SUPPORT";
|
|
202
|
+
readonly MOUNT_INITIAL_FAILED: "MOUNT_INITIAL_FAILED";
|
|
203
|
+
readonly ELEMENT_INSTANCE_DESTROYED: "ELEMENT_INSTANCE_DESTROYED";
|
|
204
|
+
readonly ELEMENT_DEFINE_ERROR: "ELEMENT_DEFINE_ERROR";
|
|
205
|
+
readonly ELEMENT_ALREADY_REGISTERED: "ELEMENT_ALREADY_REGISTERED";
|
|
206
|
+
readonly CANNOT_CREATE_SAME_ELEMENT_TWICE: "CANNOT_CREATE_SAME_ELEMENT_TWICE";
|
|
207
|
+
readonly GROUPS_ONLY_ONE_MAIN_ELEMENT: "GROUPS_ONLY_ONE_MAIN_ELEMENT";
|
|
208
|
+
readonly GROUPS_NOT_FOUND_MAIN_ELEMENT: "GROUPS_NOT_FOUND_MAIN_ELEMENT";
|
|
209
|
+
readonly NOT_SUPPORT_ELEMENT: "NOT_SUPPORT_ELEMENT";
|
|
210
|
+
readonly NOT_SUPPORT_SUBMIT: "NOT_SUPPORT_SUBMIT";
|
|
211
|
+
readonly UPDATE_CONFIG_TIMEOUT: "UPDATE_CONFIG_TIMEOUT";
|
|
212
|
+
readonly UPDATE_CONFIG_NOT_READY: "UPDATE_CONFIG_NOT_READY";
|
|
213
|
+
readonly INVALID_MODAL_URL: "INVALID_MODAL_URL";
|
|
214
|
+
readonly LOAD_DEBUGGER_FAILED: "LOAD_DEBUGGER_FAILED";
|
|
215
|
+
readonly API_MISS_PARAMS: "API_MISS_PARAMS";
|
|
216
|
+
readonly API_GATEWAY_TIMEOUT: "API_GATEWAY_TIMEOUT";
|
|
217
|
+
readonly API_SYSTEM_ERROR: "API_SYSTEM_ERROR";
|
|
218
|
+
readonly API_TIMEOUT: "API_TIMEOUT";
|
|
219
|
+
readonly API_NOT_LOGIN: "API_NOT_LOGIN";
|
|
220
|
+
readonly API_GATEWAY_ERROR: "API_GATEWAY_ERROR";
|
|
221
|
+
readonly UNKNOWN_ERROR: "UNKNOWN_ERROR";
|
|
222
|
+
readonly NO_PORTS_ERROR: "NO_PORTS_ERROR";
|
|
223
|
+
readonly INVALID_REDIRECT_URL: "INVALID_REDIRECT_URL";
|
|
224
|
+
};
|
|
225
|
+
export type AntomSDKErrorCodes = (typeof AntomSDKErrorCodes)[keyof typeof AntomSDKErrorCodes];
|
|
226
|
+
export declare class AntomSDKError extends AntomError<AntomSDKErrorCodes> {
|
|
227
|
+
name: string;
|
|
228
|
+
}
|
|
229
|
+
export type AntomTheme = 'default' | 'agateGreen' | 'night' | 'nostalgicGray' | 'gamingPurple' | 'cherryBlossomPink' | 'light';
|
|
230
|
+
/**
|
|
231
|
+
* 主题色映射表 — 将 AntomTheme 映射到 loading 阶段的明暗模式和背景色。
|
|
232
|
+
* 被 antom.ts(老架构入口)和 modernElementController(新架构入口)共用,
|
|
233
|
+
* 确保两条路径的弹窗 loading 表现一致。
|
|
234
|
+
*/
|
|
235
|
+
export declare const themeColorMap: Record<AntomTheme, {
|
|
236
|
+
theme: 'dark' | 'light';
|
|
237
|
+
backgroundColor: string;
|
|
238
|
+
}>;
|
|
239
|
+
export type AntomLayouts = 'tabs' | 'accordion';
|
|
240
|
+
/**
|
|
241
|
+
* 对客公开 appearance variables 类型(Token 2.x,figma-v4「3 层 + 状态」命名)。
|
|
242
|
+
* 字段名为新 CSS 变量名去掉 '--' 前缀(如 color-text-primary)。
|
|
243
|
+
*
|
|
244
|
+
* 权威源:`antom-web-checkout-v2/packages/elements2/src/utils/themeConfig.ts` 的 `PUBLIC_TOKENS`
|
|
245
|
+
* (54 color + 4 radius + 10 spacing = 68 项)。本 union 是该清单的手工镜像,
|
|
246
|
+
* 增删 token 时必须两侧同步,否则商户会遇到「类型报错但运行时可用」的错位。
|
|
247
|
+
*
|
|
248
|
+
* 命名规则:`--color-<scene>-<level>[-<state>]`;brand 场景并入 scene 段的 camelCase
|
|
249
|
+
* (如 `color-backgroundBrand-primary-hover`),CSS 变量大小写敏感,不可改写为 kebab。
|
|
250
|
+
*
|
|
251
|
+
* @example
|
|
252
|
+
* variables: { 'color-text-primary': '#2a3a52', 'radius-sm': '4px' }
|
|
253
|
+
*/
|
|
254
|
+
export type AppearanceVariables = 'color-background-primary' | 'color-background-primary-hover' | 'color-background-primary-active' | 'color-background-secondary' | 'color-background-secondary-hover' | 'color-background-secondary-active' | 'color-background-layout' | 'color-background-inverse' | 'color-background-disabled' | 'color-background-transparency' | 'color-background-mask' | 'color-background-success' | 'color-background-warning' | 'color-background-danger' | 'color-background-info' | 'color-background-neutral' | 'color-background-promotional' | 'color-backgroundBrand-primary' | 'color-backgroundBrand-primary-hover' | 'color-backgroundBrand-secondary' | 'color-backgroundBrand-secondary-hover' | 'color-backgroundBrand-tertiary' | 'color-backgroundBrand-disabled' | 'color-text-primary' | 'color-text-secondary' | 'color-text-tertiary' | 'color-text-inverse' | 'color-text-active' | 'color-text-disabled' | 'color-text-success' | 'color-text-warning' | 'color-text-danger' | 'color-text-info' | 'color-text-neutral' | 'color-text-promotional' | 'color-textBrand-primary' | 'color-textBrand-secondary' | 'color-textBrand-secondary-hover' | 'color-textBrand-disabled' | 'color-border-primary' | 'color-border-secondary' | 'color-border-inverse' | 'color-border-active' | 'color-border-subtle' | 'color-border-disabled' | 'color-border-success' | 'color-border-warning' | 'color-border-danger' | 'color-border-info' | 'color-border-neutral' | 'color-border-promotional' | 'color-borderBrand-primary' | 'color-borderBrand-primary-hover' | 'color-borderBrand-disabled' | 'radius-sm' | 'radius-md' | 'radius-lg' | 'radius-xl' | 'spacing-base' | 'spacing-none' | 'spacing-2xs' | 'spacing-xs' | 'spacing-sm' | 'spacing-md' | 'spacing-lg' | 'spacing-xl' | 'spacing-2xl' | 'spacing-3xl';
|
|
255
|
+
/**
|
|
256
|
+
* @deprecated Token 1.0 老字段类型 — 请迁移到 {@link AppearanceVariables}。
|
|
257
|
+
* 所有字段均已废弃,运行时由 WebApp 侧 LEGACY_TO_NEW_TOKEN_MAP 翻译为新 token。
|
|
258
|
+
*
|
|
259
|
+
* @deprecated 'content-primary' → color-text-primary
|
|
260
|
+
* @deprecated 'content-secondary' → color-text-secondary
|
|
261
|
+
* @deprecated 'content-tertiary' → color-text-tertiary
|
|
262
|
+
* @deprecated 'content-quaternary' → color-text-inverse
|
|
263
|
+
* @deprecated 'background-primary' → color-background-primary
|
|
264
|
+
* @deprecated 'background-secondary' → color-background-secondary
|
|
265
|
+
* @deprecated 'background-disable' → color-background-disabled
|
|
266
|
+
* @deprecated 'background-transparency' → color-background-transparency
|
|
267
|
+
* @deprecated 'border-primary' → color-border-primary
|
|
268
|
+
* @deprecated 'border-secondary' → color-border-secondary
|
|
269
|
+
* @deprecated 'border-disable' → color-border-disabled
|
|
270
|
+
* @deprecated 'border-active' → color-border-active
|
|
271
|
+
* @deprecated 'action-normal' → 一对多 fan-out(无单值映射;运行时展开为 3 个新 token,老 key 不再注入):
|
|
272
|
+
* - background/background-color → color-backgroundBrand-primary
|
|
273
|
+
* - border/border-color/box-shadow → color-border-active
|
|
274
|
+
* - color/文本/图标/勾选态 → color-text-active
|
|
275
|
+
* @deprecated 'action-hover' → 一对多 fan-out(运行时展开为 2 个新 token,老 key 不再注入):
|
|
276
|
+
* - background → color-backgroundBrand-primary-hover
|
|
277
|
+
* - border → color-borderBrand-primary-hover
|
|
278
|
+
* 文字色 color-textBrand-secondary-hover 不参与派生
|
|
279
|
+
* (设计稿中与 bg/border 不同色阶),需要时请显式传入该新 token 键
|
|
280
|
+
* @deprecated 'action-secondary' → color-backgroundBrand-secondary
|
|
281
|
+
* @deprecated 'action-disable' → 一对多 fan-out(运行时展开为 2 个新 token,老 key 不再注入):
|
|
282
|
+
* - background/background-color → color-backgroundBrand-disabled
|
|
283
|
+
* - border/border-color → color-borderBrand-disabled
|
|
284
|
+
* 文字色 color-textBrand-disabled 不参与派生
|
|
285
|
+
* (设计稿中全部主题均与 bg/border 不同色阶),需要时请显式传入该新 token 键
|
|
286
|
+
* @deprecated 'state-success' → color-text-success
|
|
287
|
+
* @deprecated 'state-failure' → color-text-danger
|
|
288
|
+
* @deprecated 'state-warning' → color-text-warning
|
|
289
|
+
* @deprecated 'state-info' → color-text-info
|
|
290
|
+
* @deprecated 'state-conventional' → color-text-neutral
|
|
291
|
+
* @deprecated 'state-marketing' → color-text-promotional(color 上下文;background 上下文由 CSS 层直接迁移)
|
|
292
|
+
* @deprecated 'radius-backup' → radius-sm
|
|
293
|
+
* @deprecated 'radius-component' → radius-md
|
|
294
|
+
* @deprecated 'radius-module' → radius-lg
|
|
295
|
+
* @deprecated 'radius-button' → radius-lg(与 radius-module 同档合并)
|
|
296
|
+
* @deprecated 'wrapper-padding' → spacing-lg
|
|
297
|
+
* @deprecated 'stroke-default' → 由 Rules 机制接管
|
|
298
|
+
* @deprecated 'stroke-active' → 由 Rules 机制接管
|
|
299
|
+
*
|
|
300
|
+
* 注:fan-out 展开基数以 figma-v4 设计稿的色阶一致性为准,故 action-hover / action-disable
|
|
301
|
+
* 为 1→2 而非 1→3;三者合计派生 7 项。
|
|
302
|
+
*/
|
|
303
|
+
export type LegacyAppearanceVariables = 'content-primary' | 'content-secondary' | 'content-tertiary' | 'content-quaternary' | 'background-primary' | 'background-secondary' | 'background-disable' | 'background-transparency' | 'border-primary' | 'border-secondary' | 'border-disable' | 'action-normal' | 'action-hover' | 'action-disable' | 'action-secondary' | 'state-failure' | 'state-warning' | 'state-success' | 'state-info' | 'state-marketing' | 'state-conventional' | 'radius-backup' | 'radius-module' | 'radius-component' | 'radius-button' | 'wrapper-padding' | 'stroke-default' | 'stroke-active'
|
|
304
|
+
/** 非 Token 体系字段,由 WebApp 侧展开为 design-font-family-* 系列 */
|
|
305
|
+
| 'fontFamily';
|
|
306
|
+
/**
|
|
307
|
+
* @deprecated Use {@link AppearanceVariables} (Token 2.0) instead.
|
|
308
|
+
* 保留仅为向后兼容,将在下一个 major 版本中删除。
|
|
309
|
+
*/
|
|
310
|
+
export type AntomVariables = LegacyAppearanceVariables;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description modern tools,提供给老sdk使用,所以必须使用umd打包方式,不要修改
|
|
3
|
+
*/
|
|
4
|
+
export { buildPageUrl } from './sdk/tools/buildPageUrl';
|
|
5
|
+
export { getDevReqConfig } from './sdk/tools/getDevReqConfig';
|
|
6
|
+
export { getLocaleFromRenderData } from './sdk/tools/getLocaleFromRenderData';
|
|
7
|
+
export { getModalMessageTrackData, installModalMessageMonitor } from './sdk/tools/modalMessageMonitor';
|
|
8
|
+
export { getMetaData, isElements2, adjustSessionData, isModernWeb } from './sdk/tools/getMetaData';
|
|
9
|
+
export { checkSessionData } from './sdk/tools/checkSessionData';
|
|
10
|
+
export { openModal, type OpenModalParams } from './sdk/tools/openModal';
|
|
11
|
+
export { showToast, type ToastParams } from './sdk/tools/showToast';
|
|
12
|
+
export { awaitWrap } from './sdk/tools/awaitWrap';
|
|
13
|
+
export { sdkQuery, oneAccountQuery } from './sdk/oneapi/iexpfront/PaymentSessionService';
|
|
14
|
+
export type { AntomBridgeEventMap, SubmitResult, AntomTheme, AntomLayouts, AntomVariables, AppearanceVariables, LegacyAppearanceVariables } from './sdk/types';
|
|
15
|
+
export { themeColorMap } from './sdk/types';
|
|
16
|
+
export type { PaymentSubmitResult, PaymentAppearance, PaymentAppConfig } from './sdk/elements/PaymentElement';
|
|
17
|
+
export type { CashierSdkActionQueryResult } from './sdk/oneapi/iexpfront/definitions';
|
|
18
|
+
export type { ErrorPayload, BaseBridgeEventMap, BridgeMode } from '@antintl/opensdk-core';
|
|
19
|
+
export { MessageType } from '@antintl/opensdk-core';
|
|
20
|
+
export { debugError, debug, OpenSDKError } from '@antintl/opensdk-core';
|
|
21
|
+
export { sdkTracker } from '@antintl/opensdk-core';
|
|
22
|
+
export { request, parseHostSign, parseTrackerId } from '@antintl/antom-toolset';
|
|
23
|
+
export { SDKBridge, ModalPort } from '@antintl/opensdk-bridge';
|
|
24
|
+
export type { BaseOpenModalConfig } from '@antintl/opensdk-bridge';
|
|
25
|
+
export { ApplePayHostService, type ApplePayHostPaymentRequest } from './sdk/applepay-core/ApplePayHostService';
|
|
26
|
+
export { buildRecurringPaymentRequest } from './sdk/tools/expressElement/applePayHostToken';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 International Business Group, Ant Group. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), the rights to use, copy, modify, merge, and/or distribute the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
5
|
+
* 1. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE; and
|
|
6
|
+
* 2. If applicable, the use of the Software is also subject to the terms and conditions of any non-disclosure agreement signed by you and the relevant Ant Group entity.
|
|
7
|
+
*/
|
|
8
|
+
import { ApplePaySubTypeEnum, IAppendParams, IApplePayOptionsParams } from '../../types';
|
|
9
|
+
import type { Logger } from '../../util/logger';
|
|
10
|
+
export declare enum ApplePayComponentEvent {
|
|
11
|
+
sdk_event_appleAvailable = "sdk_event_appleAvailable",
|
|
12
|
+
sdk_event_appleCreateComponent = "sdk_event_appleCreateComponent",
|
|
13
|
+
sdk_event_appleShowPaymentSheet = "sdk_event_appleShowPaymentSheet",
|
|
14
|
+
sdk_event_appleOnvalidatemerchant = "sdk_event_appleOnvalidatemerchant",
|
|
15
|
+
sdk_event_appleSubmitToken = "sdk_event_appleSubmitToken",
|
|
16
|
+
sdk_event_applePaymentResult = "sdk_event_applePaymentResult",
|
|
17
|
+
sdk_event_appleDestroyComponent = "sdk_event_appleDestroyComponent"
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Apple pay Component
|
|
21
|
+
*/
|
|
22
|
+
declare class ApplePayComponent {
|
|
23
|
+
private _applePayService;
|
|
24
|
+
private _parseData;
|
|
25
|
+
private _sessionData;
|
|
26
|
+
private _isFinish;
|
|
27
|
+
private _options;
|
|
28
|
+
private logger;
|
|
29
|
+
private isRecurring;
|
|
30
|
+
constructor(options: IApplePayOptionsParams, logger: Logger);
|
|
31
|
+
/**
|
|
32
|
+
* Is Apple Pay Enabled
|
|
33
|
+
* @param subTypeEnum
|
|
34
|
+
* @returns
|
|
35
|
+
*/
|
|
36
|
+
canMakePayments(subTypeEnum?: ApplePaySubTypeEnum): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Is Apple Pay Enabled
|
|
39
|
+
* @param subTypeEnum
|
|
40
|
+
* @returns
|
|
41
|
+
*/
|
|
42
|
+
isAppPayEnabled(subTypeEnum?: ApplePaySubTypeEnum): boolean;
|
|
43
|
+
private onEventCallback;
|
|
44
|
+
/**
|
|
45
|
+
* Submit Pay
|
|
46
|
+
* @param paymentSessionData
|
|
47
|
+
*/
|
|
48
|
+
submitPay(appendParams: IAppendParams): void;
|
|
49
|
+
}
|
|
50
|
+
export default ApplePayComponent;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Logger } from "../../util/logger";
|
|
2
|
+
import { BusContext, BusMessage, BusSubscriber } from "../../core/bus";
|
|
3
|
+
export declare class ApplePayInitMessage {
|
|
4
|
+
private environment;
|
|
5
|
+
private locale;
|
|
6
|
+
}
|
|
7
|
+
export declare class ApplePayBusSubscriber extends BusSubscriber {
|
|
8
|
+
private applePay;
|
|
9
|
+
logger: Logger;
|
|
10
|
+
constructor(logger: Logger);
|
|
11
|
+
actionNames(): string[];
|
|
12
|
+
protected onOptionalInit(context: BusContext, message: BusMessage): void;
|
|
13
|
+
protected onCanMakePayments(context: BusContext, message: BusMessage): void;
|
|
14
|
+
protected onCreateComponent(context: BusContext, message: BusMessage): void;
|
|
15
|
+
protected onDestroyComponent(context: BusContext, message: BusMessage): void;
|
|
16
|
+
onMessage(context: BusContext, message: BusMessage): void;
|
|
17
|
+
}
|