@alipay/ams-checkout 0.0.1763539719-dev.0 → 0.0.1763711027-dev.1

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.
Files changed (139) hide show
  1. package/ams-checkout.js +1 -0
  2. package/dist/umd/ams-checkout.min.js +1 -1
  3. package/esm/config/index.js +8 -8
  4. package/esm/constant/auto-debit.js +15 -0
  5. package/esm/constant/element.js +30 -0
  6. package/esm/constant/index.js +3 -0
  7. package/esm/core/component/element/elementProcessor/addressProcessor.js +2 -3
  8. package/esm/core/component/element/elementProcessor/authProcessor.js +2 -3
  9. package/esm/core/component/element/elementProcessor/paymentProcessor.js +30 -28
  10. package/esm/foundation/core/index.js +27 -0
  11. package/esm/foundation/service/container/index.js +33 -2
  12. package/esm/foundation/utils/web_app_url_utils.js +10 -15
  13. package/esm/index.js +19 -339
  14. package/esm/loader/Proxy.js +364 -0
  15. package/esm/loader/constant.js +36 -0
  16. package/esm/loader/index.js +23 -0
  17. package/esm/loader/utils/common.js +63 -0
  18. package/esm/loader/utils/debugger.js +15 -0
  19. package/esm/loader/utils/loadSDK.js +92 -0
  20. package/esm/loader/utils/logger.js +59 -0
  21. package/esm/loader/utils/proxyPerformance.js +66 -0
  22. package/esm/main.js +329 -0
  23. package/esm/plugin/component/cashierApp.js +7 -4
  24. package/esm/util/integrationType.js +48 -0
  25. package/esm/util/logger.js +1 -1
  26. package/package.json +7 -1
  27. package/LEGAL.md +0 -6
  28. package/LICENSE +0 -6
  29. package/README.md +0 -49
  30. package/esm/component/channel.d.ts +0 -21
  31. package/esm/component/component.inline.style.d.ts +0 -10
  32. package/esm/component/component.popup.style.d.ts +0 -26
  33. package/esm/component/popupWindow.style.d.ts +0 -24
  34. package/esm/config/index.d.ts +0 -16
  35. package/esm/config/request.d.ts +0 -21
  36. package/esm/constant/easysafepay.d.ts +0 -16
  37. package/esm/constant/index.d.ts +0 -341
  38. package/esm/core/bus/ability/callback.d.ts +0 -9
  39. package/esm/core/bus/ability/security.d.ts +0 -10
  40. package/esm/core/bus/ability/tracker.d.ts +0 -9
  41. package/esm/core/bus/index.d.ts +0 -125
  42. package/esm/core/bus/interface.d.ts +0 -36
  43. package/esm/core/component/address.d.ts +0 -8
  44. package/esm/core/component/appPreloadProcessing.d.ts +0 -1
  45. package/esm/core/component/ckp/index.d.ts +0 -29
  46. package/esm/core/component/element/EventCenter/index.d.ts +0 -31
  47. package/esm/core/component/element/elementContainerService/containerService.d.ts +0 -34
  48. package/esm/core/component/element/elementContainerService/index.d.ts +0 -20
  49. package/esm/core/component/element/elementController/index.d.ts +0 -48
  50. package/esm/core/component/element/elementProcessor/addressProcessor.d.ts +0 -20
  51. package/esm/core/component/element/elementProcessor/authProcessor.d.ts +0 -20
  52. package/esm/core/component/element/elementProcessor/baseElementProcessor.d.ts +0 -41
  53. package/esm/core/component/element/elementProcessor/paymentProcessor.d.ts +0 -22
  54. package/esm/core/component/element/index.d.ts +0 -13
  55. package/esm/core/component/element/mock.d.ts +0 -10
  56. package/esm/core/component/element/type.d.ts +0 -443
  57. package/esm/core/component/element/util.d.ts +0 -85
  58. package/esm/core/component/index.d.ts +0 -58
  59. package/esm/core/drop-in/index.d.ts +0 -22
  60. package/esm/core/instance/index.d.ts +0 -89
  61. package/esm/foundation/core/index.d.ts +0 -36
  62. package/esm/foundation/index.d.ts +0 -97
  63. package/esm/foundation/product-processor/autoDebit/deps.d.ts +0 -14
  64. package/esm/foundation/product-processor/autoDebit/index.d.ts +0 -48
  65. package/esm/foundation/product-processor/easysafepay/deps.d.ts +0 -20
  66. package/esm/foundation/product-processor/easysafepay/index.d.ts +0 -29
  67. package/esm/foundation/product-processor/element/index.d.ts +0 -7
  68. package/esm/foundation/service/api-bus/ability/callback.d.ts +0 -9
  69. package/esm/foundation/service/api-bus/ability/globalData.d.ts +0 -10
  70. package/esm/foundation/service/api-bus/ability/request.d.ts +0 -10
  71. package/esm/foundation/service/api-bus/ability/security.d.ts +0 -12
  72. package/esm/foundation/service/api-bus/ability/tracker.d.ts +0 -9
  73. package/esm/foundation/service/api-bus/busManager.d.ts +0 -127
  74. package/esm/foundation/service/api-bus/index.d.ts +0 -20
  75. package/esm/foundation/service/api-bus/interface.d.ts +0 -48
  76. package/esm/foundation/service/container/index.d.ts +0 -41
  77. package/esm/foundation/service/container/popup.d.ts +0 -31
  78. package/esm/foundation/service/container/utils.d.ts +0 -7
  79. package/esm/foundation/service/event-center.d.ts +0 -82
  80. package/esm/foundation/service/global-data/index.d.ts +0 -11
  81. package/esm/foundation/service/index.d.ts +0 -19
  82. package/esm/foundation/service/log/index.d.ts +0 -43
  83. package/esm/foundation/service/log/keys.d.ts +0 -13
  84. package/esm/foundation/service/log/processor.d.ts +0 -9
  85. package/esm/foundation/service/log/types.d.ts +0 -33
  86. package/esm/foundation/service/requester/deps.d.ts +0 -17
  87. package/esm/foundation/service/requester/requester.d.ts +0 -22
  88. package/esm/foundation/service/security/index.d.ts +0 -28
  89. package/esm/foundation/service/security/security.d.ts +0 -33
  90. package/esm/foundation/utils/gray_scale_utils.d.ts +0 -7
  91. package/esm/foundation/utils/payment_context_utils.d.ts +0 -13
  92. package/esm/foundation/utils/payment_product_utils.d.ts +0 -13
  93. package/esm/foundation/utils/preload_helper.d.ts +0 -21
  94. package/esm/foundation/utils/redirect_utils.d.ts +0 -11
  95. package/esm/foundation/utils/system_events.d.ts +0 -4
  96. package/esm/foundation/utils/web_app_url_utils.d.ts +0 -116
  97. package/esm/index.d.ts +0 -54
  98. package/esm/plugin/applepay/component.d.ts +0 -50
  99. package/esm/plugin/applepay/index.d.ts +0 -17
  100. package/esm/plugin/applepay/interface.d.ts +0 -161
  101. package/esm/plugin/applepay/service.d.ts +0 -54
  102. package/esm/plugin/component/cashierApp.d.ts +0 -38
  103. package/esm/plugin/component/channel.d.ts +0 -57
  104. package/esm/plugin/component/component.inline.style.d.ts +0 -10
  105. package/esm/plugin/component/component.popup.style.d.ts +0 -25
  106. package/esm/plugin/component/index.d.ts +0 -133
  107. package/esm/plugin/component/popupWindow.style.d.ts +0 -11
  108. package/esm/plugin/const.d.ts +0 -2
  109. package/esm/plugin/drop-in/index.d.ts +0 -71
  110. package/esm/plugin/payment-element/utils.d.ts +0 -2
  111. package/esm/plugin/paypal/index.d.ts +0 -20
  112. package/esm/plugin/type.d.ts +0 -34
  113. package/esm/plugin/utils.d.ts +0 -6
  114. package/esm/request/index.d.ts +0 -9
  115. package/esm/request/utils.d.ts +0 -28
  116. package/esm/service/index.d.ts +0 -13
  117. package/esm/types/index.d.ts +0 -854
  118. package/esm/util/createIframeNode.d.ts +0 -6
  119. package/esm/util/debug.d.ts +0 -1
  120. package/esm/util/get.d.ts +0 -25
  121. package/esm/util/getBackScheme.d.ts +0 -5
  122. package/esm/util/index.d.ts +0 -61
  123. package/esm/util/intl-callapp/es/browser.d.ts +0 -21
  124. package/esm/util/intl-callapp/es/evoke.d.ts +0 -13
  125. package/esm/util/intl-callapp/es/generate.d.ts +0 -29
  126. package/esm/util/intl-callapp/es/index.d.ts +0 -43
  127. package/esm/util/intl-callapp/es/main.d.ts +0 -41
  128. package/esm/util/intl-callapp/es/openWallet.d.ts +0 -15
  129. package/esm/util/intl-callapp/es/types.d.ts +0 -46
  130. package/esm/util/intl-callapp/es/utils/config.d.ts +0 -24
  131. package/esm/util/intl-callapp/es/utils/index.d.ts +0 -15
  132. package/esm/util/logger.d.ts +0 -64
  133. package/esm/util/mock.d.ts +0 -1
  134. package/esm/util/redirect.d.ts +0 -6
  135. package/esm/util/security.d.ts +0 -34
  136. package/esm/util/spm-map.d.ts +0 -211
  137. package/esm/util/storage.d.ts +0 -2
  138. package/esm/util/upgrade.d.ts +0 -39
  139. package/esm/util/versionCompare.d.ts +0 -15
@@ -1,82 +0,0 @@
1
- import { EventPayload, EventPayloadContext, IoptionsParams } from '../../types';
2
- import { SDKMetaData, Service } from '../index';
3
- /**
4
- * @author 江跃 <jiangbin.gjb@antgroup.com>
5
- * @date 2024/9/17
6
- */
7
- export declare class EventCenter implements Service {
8
- private events;
9
- private iframes;
10
- private instanceId;
11
- constructor();
12
- /**
13
- * Initializes the event center
14
- */
15
- init(initOptions: IoptionsParams, instanceId: string, sdkMetaData: SDKMetaData): void;
16
- /**
17
- * Cleans up event listeners when the event center is destroyed.
18
- */
19
- destroy(): void;
20
- /**
21
- * Placeholder for future update logic.
22
- */
23
- update(): void;
24
- /**
25
- * Sets the iframe container and its domain.
26
- * @param iframe - The HTMLIFrameElement that serves as the container.
27
- * @param domain - The domain of the app.
28
- */
29
- addIFrame(iframe: HTMLIFrameElement): void;
30
- /**
31
- * Cleans iframes when web app close
32
- */
33
- cleanIFrames(): void;
34
- removeIFrame(iframe: HTMLIFrameElement): void;
35
- /**
36
- * Handles messages received from the app.
37
- * @param e - The message event.
38
- */
39
- private handleAppMessage;
40
- private checkEventCompliant;
41
- /**
42
- * Processes the application message and emits the associated event.
43
- * @param data - Parsed EventPayload from the app.
44
- */
45
- private _handleAppMessage;
46
- /**
47
- * Listens to an event by adding a callback function.
48
- * @param name - The name of the event to listen for.
49
- * @param func - The callback function to execute when the event is emitted.
50
- * @param isAppend - Append to event handlers as chain, default value is false
51
- */
52
- listen(name: string, func: IListener, isAppend?: boolean): void;
53
- /**
54
- * Unsubscribes from an event. If a function is provided, only that function is removed.
55
- * @param name - The name of the event to unlisten to.
56
- * @param func - The optional callback function to remove.
57
- */
58
- unlisten(name: string, func?: IListener): void;
59
- /**
60
- * Emits an event, executing all associated callback functions.
61
- * @param name - The name of the event to emit.
62
- * @param data - The event data to pass to the event listeners.
63
- */
64
- emit(name: string, data: any, eventPayload?: EventPayload): void;
65
- /**
66
- * Registers a callback for an event and immediately dispatches the event to the app.
67
- * @param payloadContext - The context containing event information and callback ID.
68
- * @param func - The callback function to execute when the event is emitted.
69
- */
70
- emitAndListen(payloadContext: EventPayloadContext, func: IListener): void;
71
- queryParse(url?: string): Record<string, any>;
72
- /**
73
- * Dispatches the event payload to the app via postMessage.
74
- * @param payloadContext - The context containing event to be dispatched.
75
- */
76
- dispatchToApp(payloadContext: EventPayloadContext): void;
77
- isExist(name: string): boolean;
78
- }
79
- interface IListener {
80
- (data: any, eventPayload?: EventPayload): void;
81
- }
82
- export {};
@@ -1,11 +0,0 @@
1
- import { IoptionsParams } from "../../../types";
2
- import { Service } from "../../index";
3
- export declare class GlobalDataService implements Service {
4
- private globalData;
5
- init(initOptions: IoptionsParams, instanceId: string): void;
6
- destroy(): void;
7
- update(): void;
8
- getGlobalData(dataKey: string): any;
9
- setGlobalData(dataKey: string, data: any): void;
10
- clearGlobalData(): void;
11
- }
@@ -1,19 +0,0 @@
1
- import { IoptionsParams } from '../../types';
2
- import { PaymentContext, SDKMetaData, Service } from '../index';
3
- /**
4
- * @author 谦彧 <zhangmian.zm@alipay.com>
5
- * @date 2024/9/17
6
- */
7
- export type ServiceName = 'Container' | 'EventCenter' | 'Log' | 'ApiBusManager' | 'Requester' | 'Security' | 'GlobalData';
8
- export declare class ServiceProvider {
9
- private static ProvidersMapping;
10
- static getInstance(instanceId: string): ServiceProvider;
11
- private readonly instanceId;
12
- private services;
13
- private extendServices;
14
- private constructor();
15
- init(initOptions: IoptionsParams, sdkMetaData: SDKMetaData): void;
16
- update(paymentContext: PaymentContext): void;
17
- getService<T>(serviceName: ServiceName): T;
18
- registerService(serviceName: string, service: Service): void;
19
- }
@@ -1,43 +0,0 @@
1
- import { PaymentContext, SDKMetaData, Service } from '../../index';
2
- import { IoptionsParams } from '../../../types';
3
- import { LogExtra, LogMetaData, LogPayload } from './types';
4
- /**
5
- * @author 谦彧 <zhangmian.zm@alipay.com>
6
- * @date 2024/9/18
7
- */
8
- interface Config {
9
- scriptUrl: string;
10
- spmConfig: object;
11
- appId: string;
12
- server?: string;
13
- bizType: string;
14
- batchCount: number;
15
- productId: string;
16
- mdata?: LogMetaData;
17
- version?: string;
18
- }
19
- export declare class LogService implements Service {
20
- private instanceId;
21
- private logs;
22
- private config;
23
- private debug;
24
- private componentStartTime;
25
- private isLoaded;
26
- private trackId;
27
- constructor();
28
- init(initOptions: IoptionsParams, instanceId: string, sdkMetaData: SDKMetaData): void;
29
- update(paymentContext: PaymentContext): void;
30
- destroy(): void;
31
- setMetaData(metaData: LogMetaData): void;
32
- getLogConfig(): Config;
33
- logError(error: LogPayload, extra?: LogExtra, enableExtractCompliance?: boolean): LogService;
34
- logInfo(info: LogPayload, extra?: LogExtra): LogService;
35
- log(type: string, payload: LogPayload, extra?: LogExtra, enableExtractCompliance?: boolean): LogService;
36
- private reportLogs;
37
- private loadScript;
38
- private initTracker;
39
- send(): void;
40
- setComponentStartTime(val: number): void;
41
- getComponentStartTime(): number;
42
- }
43
- export {};
@@ -1,13 +0,0 @@
1
- export declare class LogComplianceExtendKeys {
2
- static complianceExtParams: Record<string, string>;
3
- }
4
- export declare const KEYS: {
5
- EVENT_SDK_ON_ABNORMAL_EVENT_NAME: {
6
- spmId: string;
7
- alias: string;
8
- };
9
- EVENT_SDK_ON_ABNORMAL_EVENT_EXT_INFO: {
10
- spmId: string;
11
- alias: string;
12
- };
13
- };
@@ -1,9 +0,0 @@
1
- import { LogExtra, LogPayload } from './types';
2
- export declare class LogComplianceProcessor {
3
- private static abnormalEventNameSet;
4
- private static nonComplianceEventKeys;
5
- static extractComplianceParams(eventName: string, params: Record<string, any>, errorLogCallback?: (error: LogPayload, extra?: LogExtra) => void): Record<string, string>;
6
- private static reportHasAbnormalEventName;
7
- private static reportHasIllegalExtendInfoKey;
8
- static flushAbnormalInfo(errorLogCallback?: (error: LogPayload, extra?: LogExtra) => void): void;
9
- }
@@ -1,33 +0,0 @@
1
- /**
2
- * @author 谦彧 <zhangmian.zm@alipay.com>
3
- * @date 2024/9/18
4
- */
5
- export interface LogPayload {
6
- title?: string;
7
- msg?: string;
8
- errorMessage?: string;
9
- name?: string;
10
- label?: string;
11
- time?: number;
12
- success?: boolean;
13
- code?: string;
14
- traceId?: string;
15
- }
16
- export type LogExtra = Record<string, any>;
17
- export interface LogMetaData {
18
- platform?: string;
19
- sdkVersion?: string;
20
- webAppVersion?: string;
21
- firstLogTime?: number;
22
- fsDuration?: number;
23
- instanceId?: string;
24
- deviceId?: string;
25
- renderDisplayType?: string;
26
- merchantId?: string;
27
- productScene?: string;
28
- productSceneVersion?: string;
29
- paymentMethodType?: string;
30
- paymentMethodCategoryType?: string;
31
- requestSeq?: string;
32
- trackId?: string;
33
- }
@@ -1,17 +0,0 @@
1
- /**
2
- * 这个文件暂时先用来存放架构升级时不稳定的依赖。
3
- * 以及方便单测时mock外部依赖
4
- */
5
- export type { SDKMetaData } from "../..";
6
- export type { LogPayload, LogExtra } from '../log/types';
7
- export type { LogService } from '../log';
8
- export type { Service, PaymentContext } from '../../index';
9
- export { fomatGetwayError } from '../../../request/utils';
10
- export type { IoptionsParams, IPaymentSessionMetaData } from '../../../types';
11
- export { sdkVersion } from '../../../config/index';
12
- export { appId, hostSignMap, lightSandboxMap, requestHost, sofaId, tntInstId } from '../../../config/request';
13
- export type { RequestConfig } from '../../../types';
14
- export { errorEnum } from '../../../types';
15
- export { get } from '../../../util/get';
16
- export { device, isPC, queryParse, safeJson } from '../../../util';
17
- export type { Logger } from '../../../util/logger';
@@ -1,22 +0,0 @@
1
- import { IoptionsParams, PaymentContext, RequestConfig, SDKMetaData, Service } from './deps';
2
- /**
3
- * @author congle.zzq <congle.zzq@alipay.com>
4
- * @date 2024/9/18
5
- */
6
- export declare class RequesterService implements Service {
7
- private sandboxFlag?;
8
- private instanceId;
9
- init(initOptions: IoptionsParams, instanceId: string, sdkMetaData: SDKMetaData): void;
10
- /**
11
- *
12
- * @param requestData 请求参数
13
- * @param options 请求配置
14
- * @example request({ name: 'test' }, { operation-type: 'xxx.xxx.xxx' })
15
- */
16
- request<T>(requestData: Record<string, any> | undefined, options: RequestConfig): Promise<T>;
17
- getEnvInfo(options: RequestConfig): any;
18
- private reportRequestTimeCost;
19
- update(paymentSession: PaymentContext): void;
20
- destroy(): void;
21
- private createRequestInstance;
22
- }
@@ -1,28 +0,0 @@
1
- import { DeviceIdParameter, IoptionsParams } from '../../../types';
2
- import { PaymentContext, SDKMetaData, Service } from '../../index';
3
- import { Security } from './security';
4
- export declare class SecurityService implements Service {
5
- private logger;
6
- private productScene;
7
- static securitySdkMap: Map<string, Security>;
8
- init(initOptions: IoptionsParams, instanceId: string, sdkMetaData: SDKMetaData): void;
9
- update(paymentContext: PaymentContext): void;
10
- destroy(): void;
11
- getDeviceId(deviceIdParameter?: DeviceIdParameter, isPolling?: boolean): Promise<string>;
12
- preInitSecurity(timeout?: number): Promise<void>;
13
- initSecurity(timeout?: number): Promise<void>;
14
- private _initSecurity;
15
- private logDeviceId;
16
- /**
17
- * @description Obtain security SDK through scenario identification
18
- */
19
- private _getSecuritySDKByProductScene;
20
- /**
21
- * @description New security SDK through scenario identification
22
- */
23
- private _newSecuritySDKByScene;
24
- /**
25
- * @description Obtain risk control configuration in local storage
26
- */
27
- private _getSecurityConfigStorage;
28
- }
@@ -1,33 +0,0 @@
1
- import { IsecurityConfig, ProductSceneEnum, DeviceIdParameter } from '../../../types';
2
- export declare const getSecurityConfigStorageKey: (scene: ProductSceneEnum) => string;
3
- export declare enum SecurityRegionEnum {
4
- SG = "SG",
5
- US = "US",
6
- DE = "DE"
7
- }
8
- export declare const securityHost: {
9
- SG: string;
10
- US: string;
11
- DE: string;
12
- };
13
- export declare const sceneMap: {
14
- CASHIER_PAYMENT: string;
15
- AUTO_DEBIT: string;
16
- VAULTING: string;
17
- CARD_APPLE_PAY: string;
18
- EASYPAY: string;
19
- EASY_PAY: string;
20
- FLASH_BUY: string;
21
- ELEMENT_PAYMENT: string;
22
- };
23
- export declare const getSecurityHost: (region: string) => string;
24
- export declare const getSecurityScene: (product: string) => string;
25
- export declare class Security {
26
- scene: string;
27
- h5gateway: string;
28
- constructor(options: IsecurityConfig);
29
- initSecurity(successCallback: any, failCallback: any): void;
30
- private initToken;
31
- pollingGetApdidToken(config?: DeviceIdParameter): Promise<string>;
32
- getApdidToken(): Promise<string>;
33
- }
@@ -1,7 +0,0 @@
1
- import { WebAppMatchConfig } from './web_app_url_utils';
2
- /**
3
- * @author 谦彧 <zhangmian.zm@alipay.com>
4
- * @date 2024/9/18
5
- */
6
- export declare function getGrayscaleId(): number;
7
- export declare function isGreyscaleMatch(configEntry: WebAppMatchConfig, grayScaleId: number): boolean;
@@ -1,13 +0,0 @@
1
- import { IPaymentSessionMetaData } from '../../types';
2
- import { WebAppMatchConfig } from './web_app_url_utils';
3
- import { SDKMetaData } from '../index';
4
- /**
5
- * @author 谦彧 <zhangmian.zm@alipay.com>
6
- * @date 2024/9/17
7
- */
8
- export declare function convertPaymentSession(sessionData: string): {
9
- id: string;
10
- data: IPaymentSessionMetaData;
11
- };
12
- export declare const getWebAppVersion: (currentSDKMetaData: Pick<SDKMetaData, 'sdkVersion' | 'productScene' | 'greyscaleId'>, mid?: string, config?: WebAppMatchConfig[]) => string;
13
- export declare const saveWebAppVersion: (webAppVersion: string, currentSDKMetaData: Pick<SDKMetaData, 'sdkVersion' | 'productScene'>) => void;
@@ -1,13 +0,0 @@
1
- import { ProductSceneEnum } from "../../types";
2
- export declare class ProductInfoCacheUtil {
3
- static savePreviousProductInfo(productScene: ProductSceneEnum, info: {
4
- productSceneVersion: string;
5
- paymentMethodCategoryType: string;
6
- hostSign: string;
7
- }): void;
8
- static getPreviousProductInfo(productScene: ProductSceneEnum): {
9
- productSceneVersion: string;
10
- paymentMethodCategoryType: string;
11
- hostSign: string;
12
- } | null;
13
- }
@@ -1,21 +0,0 @@
1
- import { PaymentMethodCategoryTypeEnum, ProductSceneEnum } from "../../types";
2
- import { Security } from '../../util/security';
3
- export default class PreloadHelper {
4
- static isWebAppPreloaded: boolean;
5
- static isSecuritySDKPreloaded: boolean;
6
- private static securitySdkMap;
7
- static preloadWebApp(productScene: ProductSceneEnum, paymentMethodCategoryType: PaymentMethodCategoryTypeEnum, environment?: string, useV2?: boolean): void;
8
- static preloadSecuritySDK(product: ProductSceneEnum, securityRegion?: string): void;
9
- static getSecuritySdk(scene: any): Security;
10
- static buildWebAppPreloadUrl(productScene: ProductSceneEnum, paymentMethodCategoryType: PaymentMethodCategoryTypeEnum, environment: string, useV2?: boolean): {
11
- preloadUrl: string;
12
- containerId: string;
13
- };
14
- /**
15
- * @description Obtain risk control configuration in local storage
16
- */
17
- static getSecurityConfigStorage(product: ProductSceneEnum): {
18
- scene: string;
19
- h5gateway: string;
20
- };
21
- }
@@ -1,11 +0,0 @@
1
- import { RedirectBehaviorPayload } from '../index';
2
- import { LogService } from '../service/log';
3
- /**
4
- * @author 谦彧 <zhangmian.zm@alipay.com>
5
- * @date 2024/9/19
6
- */
7
- export declare const redirect: (payload: RedirectBehaviorPayload, instanceId: string) => void;
8
- /**
9
- * 通过配置规则检测 UA 和获得回跳 scheme
10
- */
11
- export declare function getBackScheme(mockUa?: string, logger?: LogService): any;
@@ -1,4 +0,0 @@
1
- import { EventCenter } from '../service/event-center';
2
- export declare const registerSystemEvents: (eventCenter: EventCenter) => void;
3
- export declare const unRegisterSystemEvents: (eventCenter: EventCenter) => void;
4
- export declare const getIframeOrigin: (iframe: HTMLIFrameElement) => string;
@@ -1,116 +0,0 @@
1
- import { ESP_PAGE_NAME } from '../../constant/easysafepay';
2
- import { DisplayTypeEnum, IPaymentSessionMetaData, PaymentMethodCategoryTypeEnum, ProductSceneEnum } from '../../types';
3
- import { SDKMetaData } from '../index';
4
- /**
5
- * Tell the SDK which version of the Web App to load.
6
- * Sent by server inside paymentSession.
7
- */
8
- export interface WebAppMatchConfig {
9
- /**
10
- * SDK support version range, '{minVer}|{maxVer}', such as '1.0.0' or '1.0.0|2.0.0' or '2.0.0'
11
- * If SDK version < maxVer and > minVer, then will use this config entry.
12
- */
13
- v: string;
14
- appVersion: string;
15
- productScene?: string;
16
- platform?: string;
17
- mid?: string;
18
- greyscale?: string;
19
- }
20
- /**
21
- * Tell the SDK which Web App URL to load.
22
- * Sent by server inside paymentSession.
23
- */
24
- export interface WebAppUrlMatchConfig {
25
- minSDKVersion: string;
26
- url: string;
27
- doubleFa: string;
28
- mids?: string[];
29
- }
30
- export interface QueryParams {
31
- displayType: DisplayTypeEnum;
32
- locale: string;
33
- instanceId: string;
34
- analyticsEnabled: boolean;
35
- isPreload?: string;
36
- hostSign?: string;
37
- }
38
- export declare const getWebAppUrlInfo: (params: {
39
- environment: string;
40
- sdkMetaData: SDKMetaData;
41
- productScene: ProductSceneEnum;
42
- productSceneVersion: string;
43
- paymentMethodCategoryType: PaymentMethodCategoryTypeEnum;
44
- isPreload?: boolean;
45
- query: QueryParams;
46
- v2Url?: string;
47
- }) => {
48
- path: string;
49
- locationSearch: string;
50
- };
51
- export declare const getWebAppV2Url: (params: {
52
- environment: string;
53
- sdkMetaData: SDKMetaData;
54
- productScene: ProductSceneEnum;
55
- productSceneVersion: string;
56
- paymentMethodCategoryType: PaymentMethodCategoryTypeEnum;
57
- isPreload?: boolean;
58
- query: QueryParams;
59
- mid?: string;
60
- extendInfo?: string;
61
- }) => string;
62
- export declare const getWebAppUrl: (params: {
63
- environment: string;
64
- sdkMetaData: SDKMetaData;
65
- productScene: ProductSceneEnum;
66
- productSceneVersion: string;
67
- paymentMethodCategoryType: PaymentMethodCategoryTypeEnum;
68
- isPreload?: boolean;
69
- query: QueryParams;
70
- v2Url?: string;
71
- }) => string;
72
- export declare const parseWebAppMatchConfig: (extendInfo: string) => WebAppMatchConfig[];
73
- export declare const parseWebAppUrlMatchConfig: (extendInfo: string) => WebAppUrlMatchConfig[];
74
- /**
75
- * Save the current checkout URL to localStorage for the specified product scene.
76
- *
77
- * @param productScene - The product scene for which the checkout URL should be saved.
78
- */
79
- export declare const saveLocalCheckoutUrl: (productScene: ProductSceneEnum, url: string) => void;
80
- /**
81
- * 获取从外部动态下发的V2AppUrl.
82
- *
83
- * @param config - sessionData解析来的checkoutInfo列表.
84
- */
85
- export declare const getMatchedWebAppV2Url: (productScene: ProductSceneEnum, mid: string, configs: WebAppUrlMatchConfig[], env: string) => string;
86
- /**
87
- * 获取ESP从sessionData.checkoutInfo内动态下发的Url.
88
- */
89
- export declare const matchEasySafePayV2Url: (params: {
90
- configs: WebAppUrlMatchConfig[];
91
- mid: string;
92
- env: string;
93
- pageName: ESP_PAGE_NAME;
94
- }) => string;
95
- /**
96
- * Retrieve the saved checkout URL from localStorage for the specified product scene.
97
- * If no url is found, a default checkout url string is returned.
98
- *
99
- * @param productScene - The product scene for which the checkout URL should be retrieved.
100
- */
101
- export declare const getLocalCheckoutUrl: (productScene: ProductSceneEnum, environment: string) => string;
102
- /**
103
- * Provide default checkout URL for the specified product scene.
104
- * Return URL for 'EASY_PAY' product scene, while for other product scenes, it returns an empty string as they are not currently in use
105
- *
106
- * @param productScene - The product scene for which the default checkout URL should be provided.
107
- */
108
- export declare const defaultCheckoutUrl: (productScene: ProductSceneEnum, environment?: string) => string;
109
- /**
110
- * V2应用EasySafePay 热更新兜底URL构建规则
111
- * 1. 兜底URL版本与sdk版本保持一致
112
- * 2. DEV环境下html新增版本前缀
113
- **/
114
- export declare const getDefaultEasySafePayPageUrl: (pageName: ESP_PAGE_NAME, env: string) => string;
115
- /**通过sessionData获取doubleFa,于createComponent时传递给WEB应用*/
116
- export declare const getDoubleFaUrlFromSession: (paymentSessionObj: IPaymentSessionMetaData, env?: string) => string;
package/esm/index.d.ts DELETED
@@ -1,54 +0,0 @@
1
- import { AddressComponent } from './core/component/address';
2
- import { ElementComponent } from './core/component/element';
3
- import { AMSComponent } from './core/component/index';
4
- import { ComponentSignEnum, IcreateComponent, IElementOptions, IoptionsAddressParams, IoptionsParams, IPreloadOptions, ValidationResult } from './types';
5
- export { AMSCheckoutPage } from './core/component/ckp';
6
- export * from './types';
7
- export declare class AMSCheckout extends AMSComponent {
8
- constructor(_options: IoptionsParams, channelType?: ComponentSignEnum[], productSceneVersion?: string);
9
- }
10
- export declare class AMSAutoDebitPay extends AMSCheckout {
11
- constructor(options: IoptionsParams);
12
- static preload(options?: IPreloadOptions): void;
13
- }
14
- export declare class AMSCashierPayment extends AMSCheckout {
15
- constructor(options: IoptionsParams);
16
- static preload(options?: IPreloadOptions): void;
17
- /**
18
- * Form validation function
19
- * If the form is currently displayed:
20
- * - Successful validation: isValid is true
21
- * - Failed validation: isValid is false, and error messages are displayed on the form page
22
- * If not on the form display page, isValid returns false
23
- * @returns {Promise<ValidationResult>} Returns a Promise containing the validation result
24
- */
25
- validateFields(): Promise<ValidationResult>;
26
- }
27
- export declare class AMSVaulting extends AMSCheckout {
28
- constructor(options: IoptionsParams);
29
- static preload(options?: IPreloadOptions): void;
30
- }
31
- export declare class AntomElement extends AMSCheckout {
32
- constructor(options: IoptionsParams);
33
- }
34
- export declare class AddressElement extends AddressComponent {
35
- constructor(options: IoptionsAddressParams);
36
- }
37
- export declare class AMSElement extends ElementComponent {
38
- constructor(options: IElementOptions);
39
- }
40
- export declare class AMSEasyPay {
41
- private core;
42
- constructor(options: IoptionsParams);
43
- static preload(options?: IPreloadOptions): void;
44
- createComponent(params: IcreateComponent): void;
45
- unmount(): void;
46
- }
47
- export declare class AMSAutoDebit {
48
- private core;
49
- constructor(options: IoptionsParams);
50
- createComponent(params: IcreateComponent): Promise<void>;
51
- unmount(): void;
52
- static preload(options?: IPreloadOptions): void;
53
- }
54
- export default AMSCheckout;
@@ -1,50 +0,0 @@
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;
@@ -1,17 +0,0 @@
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
- }