@alipay/ams-checkout 0.0.1730107332-dev.4 → 0.0.1730441340-dev.0

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 (127) hide show
  1. package/dist/umd/ams-checkout.min.js +1 -1
  2. package/esm/config/index.d.ts +7 -7
  3. package/esm/config/index.js +7 -7
  4. package/esm/constant/index.d.ts +6 -7
  5. package/esm/constant/index.js +80 -11
  6. package/esm/{foundation/service/api-bus → core/bus}/ability/callback.d.ts +2 -2
  7. package/esm/{foundation/service/api-bus → core/bus}/ability/callback.js +1 -1
  8. package/esm/{foundation/service/api-bus → core/bus}/ability/security.d.ts +4 -6
  9. package/esm/{foundation/service/api-bus → core/bus}/ability/security.js +35 -92
  10. package/esm/{foundation/service/api-bus → core/bus}/ability/tracker.d.ts +4 -4
  11. package/esm/{foundation/service/api-bus → core/bus}/ability/tracker.js +3 -6
  12. package/esm/{foundation/service/api-bus/busManager.d.ts → core/bus/index.d.ts} +15 -17
  13. package/esm/{foundation/service/api-bus/busManager.js → core/bus/index.js} +35 -67
  14. package/esm/{foundation/service/api-bus → core/bus}/interface.d.ts +0 -12
  15. package/esm/{foundation/service/api-bus → core/bus}/interface.js +2 -16
  16. package/esm/core/component/address.d.ts +8 -0
  17. package/esm/{foundation/service/api-bus/ability/globalData.js → core/component/address.js} +58 -75
  18. package/esm/core/component/appPreloadProcessing.d.ts +1 -0
  19. package/esm/{foundation/service/container/popup.js → core/component/appPreloadProcessing.js} +83 -97
  20. package/esm/core/component/ckp/index.d.ts +27 -0
  21. package/esm/core/component/ckp/index.js +166 -0
  22. package/esm/core/component/index.d.ts +51 -0
  23. package/esm/core/component/index.js +531 -0
  24. package/esm/core/drop-in/index.d.ts +22 -0
  25. package/esm/core/drop-in/index.js +104 -0
  26. package/esm/core/instance/index.d.ts +89 -0
  27. package/esm/core/instance/index.js +499 -0
  28. package/esm/index.d.ts +28 -5
  29. package/esm/index.js +158 -29
  30. package/esm/plugin/applepay/component.d.ts +50 -0
  31. package/esm/plugin/applepay/component.js +339 -0
  32. package/esm/plugin/applepay/index.d.ts +17 -0
  33. package/esm/plugin/applepay/index.js +117 -0
  34. package/esm/plugin/applepay/interface.d.ts +161 -0
  35. package/esm/plugin/applepay/interface.js +69 -0
  36. package/esm/plugin/applepay/service.d.ts +54 -0
  37. package/esm/plugin/applepay/service.js +289 -0
  38. package/esm/plugin/component/cashierApp.d.ts +34 -0
  39. package/esm/plugin/component/cashierApp.js +237 -0
  40. package/esm/{component → plugin/component}/channel.d.ts +4 -3
  41. package/esm/{component → plugin/component}/channel.js +37 -1
  42. package/esm/plugin/component/component.inline.style.d.ts +10 -0
  43. package/esm/{component → plugin/component}/component.inline.style.js +9 -11
  44. package/esm/{component → plugin/component}/component.popup.style.d.ts +6 -15
  45. package/esm/{component → plugin/component}/component.popup.style.js +18 -36
  46. package/esm/plugin/component/index.d.ts +126 -0
  47. package/esm/plugin/component/index.js +1839 -0
  48. package/esm/{component → plugin/component}/popupWindow.style.js +2 -2
  49. package/esm/plugin/const.d.ts +2 -0
  50. package/esm/plugin/const.js +33 -0
  51. package/esm/plugin/drop-in/index.d.ts +71 -0
  52. package/esm/plugin/drop-in/index.js +324 -0
  53. package/esm/plugin/payment-element/utils.d.ts +2 -0
  54. package/esm/plugin/payment-element/utils.js +6 -0
  55. package/esm/plugin/paypal/index.d.ts +20 -0
  56. package/esm/plugin/paypal/index.js +390 -0
  57. package/esm/plugin/type.d.ts +34 -0
  58. package/esm/plugin/utils.d.ts +6 -0
  59. package/esm/plugin/utils.js +21 -0
  60. package/esm/types/index.d.ts +55 -61
  61. package/esm/types/index.js +62 -63
  62. package/esm/util/createIframeNode.d.ts +6 -0
  63. package/esm/util/createIframeNode.js +48 -0
  64. package/esm/util/getBackScheme.d.ts +2 -2
  65. package/esm/util/getBackScheme.js +2 -94
  66. package/esm/util/index.d.ts +11 -1
  67. package/esm/util/index.js +84 -3
  68. package/esm/util/intl-callapp/es/index.js +0 -1
  69. package/esm/{foundation/service/security → util}/security.d.ts +2 -2
  70. package/esm/{foundation/service/security → util}/security.js +3 -3
  71. package/esm/util/ua/index.d.ts +2 -0
  72. package/esm/util/ua/index.js +2 -0
  73. package/esm/util/ua/isAndroid.d.ts +4 -0
  74. package/esm/util/ua/isAndroid.js +7 -0
  75. package/esm/util/ua/isIOS.d.ts +4 -0
  76. package/esm/util/ua/isIOS.js +7 -0
  77. package/package.json +2 -2
  78. package/esm/component/component.inline.style.d.ts +0 -10
  79. package/esm/foundation/core/index.d.ts +0 -26
  80. package/esm/foundation/core/index.js +0 -364
  81. package/esm/foundation/index.d.ts +0 -74
  82. package/esm/foundation/index.js +0 -42
  83. package/esm/foundation/product-processor/easysafepay/deps.d.ts +0 -18
  84. package/esm/foundation/product-processor/easysafepay/deps.js +0 -12
  85. package/esm/foundation/product-processor/easysafepay/index.d.ts +0 -27
  86. package/esm/foundation/product-processor/easysafepay/index.js +0 -596
  87. package/esm/foundation/service/api-bus/ability/globalData.d.ts +0 -10
  88. package/esm/foundation/service/api-bus/ability/request.d.ts +0 -10
  89. package/esm/foundation/service/api-bus/ability/request.js +0 -151
  90. package/esm/foundation/service/api-bus/index.d.ts +0 -20
  91. package/esm/foundation/service/api-bus/index.js +0 -88
  92. package/esm/foundation/service/container/index.d.ts +0 -28
  93. package/esm/foundation/service/container/index.js +0 -256
  94. package/esm/foundation/service/container/popup.d.ts +0 -17
  95. package/esm/foundation/service/container/utils.d.ts +0 -7
  96. package/esm/foundation/service/container/utils.js +0 -48
  97. package/esm/foundation/service/event-center.d.ts +0 -74
  98. package/esm/foundation/service/event-center.js +0 -213
  99. package/esm/foundation/service/global-data/index.d.ts +0 -11
  100. package/esm/foundation/service/global-data/index.js +0 -68
  101. package/esm/foundation/service/index.d.ts +0 -19
  102. package/esm/foundation/service/index.js +0 -82
  103. package/esm/foundation/service/log/index.d.ts +0 -43
  104. package/esm/foundation/service/log/index.js +0 -235
  105. package/esm/foundation/service/log/types.d.ts +0 -32
  106. package/esm/foundation/service/requester/deps.d.ts +0 -17
  107. package/esm/foundation/service/requester/deps.js +0 -11
  108. package/esm/foundation/service/requester/requester.d.ts +0 -22
  109. package/esm/foundation/service/requester/requester.js +0 -214
  110. package/esm/foundation/service/security/index.d.ts +0 -28
  111. package/esm/foundation/service/security/index.js +0 -285
  112. package/esm/foundation/types/index.d.ts +0 -4
  113. package/esm/foundation/types/index.js +0 -4
  114. package/esm/foundation/utils/gray_scale_utils.d.ts +0 -7
  115. package/esm/foundation/utils/gray_scale_utils.js +0 -40
  116. package/esm/foundation/utils/payment_context_utils.d.ts +0 -13
  117. package/esm/foundation/utils/payment_context_utils.js +0 -57
  118. package/esm/foundation/utils/payment_product_utils.d.ts +0 -13
  119. package/esm/foundation/utils/payment_product_utils.js +0 -38
  120. package/esm/foundation/utils/redirect_utils.d.ts +0 -6
  121. package/esm/foundation/utils/redirect_utils.js +0 -115
  122. package/esm/foundation/utils/system_events.d.ts +0 -4
  123. package/esm/foundation/utils/system_events.js +0 -71
  124. package/esm/foundation/utils/web_app_url_utils.d.ts +0 -46
  125. package/esm/foundation/utils/web_app_url_utils.js +0 -112
  126. /package/esm/{component → plugin/component}/popupWindow.style.d.ts +0 -0
  127. /package/esm/{foundation/service/log/types.js → plugin/type.js} +0 -0
@@ -1,74 +0,0 @@
1
- import { DisplayTypeEnum, IOptionsParams, IPaymentSessionMetaData, PlatformEnum, ProductSceneEnum, TargetEnum } from '../types';
2
- /**
3
- * @author 谦彧 <zhangmian.zm@alipay.com>
4
- * @date 2024/9/17
5
- */
6
- /**
7
- * Represent one transaction, each transaction has its own instance.
8
- */
9
- export interface PaymentContext {
10
- initOptions: IOptionsParams;
11
- startBizFlowOptions: StartBizFlowOptions;
12
- displayInfo: DisplayInfo;
13
- paymentSession: string;
14
- paymentSessionId: string;
15
- paymentSessionObj: IPaymentSessionMetaData;
16
- sdkMetaData: SDKMetaData;
17
- }
18
- export interface StartBizFlowOptions {
19
- paymentSession: string;
20
- displayInfo?: Partial<DisplayInfo>;
21
- submitPayRequestExtra?: any;
22
- isAppWebview?: boolean;
23
- }
24
- export declare class DisplayInfo {
25
- type: DisplayTypeEnum;
26
- platform: PlatformEnum;
27
- isRetention: boolean;
28
- selector: string;
29
- appearance?: Record<string, any>;
30
- appendAliasContainerId?: boolean;
31
- constructor();
32
- }
33
- /**
34
- * Provide unique logic for specified product, or specified product and its payment method.
35
- * Such as: EasySafePay, PayPal in Cashier
36
- */
37
- export interface ProductProcessor {
38
- init(config: IOptionsParams, instanceId: string, sdkMetaData: SDKMetaData): any;
39
- startBizFlow(paymentContext: PaymentContext): Promise<BizFlowStartBehavior>;
40
- }
41
- export interface BizFlowStartBehavior {
42
- behaviorType: 'RENDER' | 'REDIRECT' | 'NONE';
43
- payload: RenderBehaviorPayload | RedirectBehaviorPayload;
44
- }
45
- export interface RenderBehaviorPayload {
46
- url: string;
47
- allowClickPopupOutsideClose?: boolean;
48
- }
49
- export interface RedirectBehaviorPayload {
50
- url?: string;
51
- schemeUrl?: string;
52
- applinkUrl?: string;
53
- browserLinkTarget?: TargetEnum;
54
- isCallApp?: boolean;
55
- callAppDetectSuccessDelay?: number;
56
- }
57
- /**
58
- * Provide some capability, such as MonitorService, EventBusService, SecurityService
59
- */
60
- export interface Service {
61
- init(initOptions: IOptionsParams, instanceId: string, sdkMetaData: SDKMetaData): any;
62
- update(paymentContext: PaymentContext): any;
63
- destroy(): any;
64
- }
65
- export interface SDKMetaData {
66
- productScene: ProductSceneEnum;
67
- sdkVersion: string;
68
- webAppVersion: string;
69
- greyscaleId: number;
70
- }
71
- export interface InitContext {
72
- initOptions: IOptionsParams;
73
- sdkMetaData: SDKMetaData;
74
- }
@@ -1,42 +0,0 @@
1
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
3
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
4
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
5
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
- import { DisplayTypeEnum, PlatformEnum } from "../types";
9
- import { isPC } from "../util";
10
-
11
- /**
12
- * @author 谦彧 <zhangmian.zm@alipay.com>
13
- * @date 2024/9/17
14
- */
15
-
16
- /**
17
- * Represent one transaction, each transaction has its own instance.
18
- */
19
-
20
- export var DisplayInfo = /*#__PURE__*/_createClass(function DisplayInfo() {
21
- _classCallCheck(this, DisplayInfo);
22
- _defineProperty(this, "type", void 0);
23
- _defineProperty(this, "platform", void 0);
24
- // whether show retention popup when user leave cashier
25
- _defineProperty(this, "isRetention", void 0);
26
- _defineProperty(this, "selector", void 0);
27
- _defineProperty(this, "appearance", void 0);
28
- // append selector name to containerId
29
- _defineProperty(this, "appendAliasContainerId", void 0);
30
- this.platform = isPC() ? PlatformEnum.desktop : PlatformEnum.mobile;
31
- this.isRetention = true;
32
- this.type = DisplayTypeEnum.popup;
33
- this.selector = '';
34
- });
35
- /**
36
- * Provide unique logic for specified product, or specified product and its payment method.
37
- * Such as: EasySafePay, PayPal in Cashier
38
- */
39
-
40
- /**
41
- * Provide some capability, such as MonitorService, EventBusService, SecurityService
42
- */
@@ -1,18 +0,0 @@
1
- export type { SDKMetaData } from "../..";
2
- export * as ChannelCustomize from '../../../component/channel';
3
- export type { IChannelBehavior } from '../../../component/channel';
4
- export { DisplayTypeEnum, PaymentMethodCategoryTypeEnum, ProductSceneEnum } from '../../../types';
5
- export { ProductInfoCacheUtil } from '../../utils/payment_product_utils';
6
- export { v4 as uuid } from 'uuid';
7
- export type { CashierSdkActionQueryRequest, CashierSdkActionQueryResult, CashierSubmitPayRequest, CashierSubmitPayResult, IOptionsParams, } from '../../../types';
8
- export { isPC } from '../../../util';
9
- export { getBackScheme } from '../../../util/getBackScheme';
10
- export { isLocalMock } from '../../../util/mock';
11
- export type { BizFlowStartBehavior, PaymentContext, ProductProcessor, RedirectBehaviorPayload, RenderBehaviorPayload } from '../..';
12
- export { ServiceProvider } from '../../service';
13
- export type { ContainerService } from '../../service/container';
14
- export type { EventCenter } from '../../service/event-center';
15
- export { LogService } from '../../service/log';
16
- export type { RequesterService } from '../../service/requester/requester';
17
- export type { SecurityService } from '../../service/security';
18
- export * as WebAppUrlUtil from '../../utils/web_app_url_utils';
@@ -1,12 +0,0 @@
1
- import * as _ChannelCustomize from "../../../component/channel";
2
- export { _ChannelCustomize as ChannelCustomize };
3
- export { DisplayTypeEnum, PaymentMethodCategoryTypeEnum, ProductSceneEnum } from "../../../types";
4
- export { ProductInfoCacheUtil } from "../../utils/payment_product_utils";
5
- export { v4 as uuid } from 'uuid';
6
- export { isPC } from "../../../util";
7
- export { getBackScheme } from "../../../util/getBackScheme";
8
- export { isLocalMock } from "../../../util/mock";
9
- export { ServiceProvider } from "../../service";
10
- export { LogService } from "../../service/log";
11
- import * as _WebAppUrlUtil from "../../utils/web_app_url_utils";
12
- export { _WebAppUrlUtil as WebAppUrlUtil };
@@ -1,27 +0,0 @@
1
- import { BizFlowStartBehavior, IOptionsParams, PaymentContext, ProductProcessor, SDKMetaData } from './deps';
2
- export declare class EasySafePayProcessor implements ProductProcessor {
3
- private paymentContext?;
4
- private initConfig;
5
- private logger;
6
- private securityService;
7
- private instanceId;
8
- private hostSign;
9
- private allowSubmitPayCallAhead;
10
- private channelBehavior?;
11
- private SECURITY_SDK_INIT_TIMEOUT;
12
- init(config: IOptionsParams, instanceId: string, sdkMetaData: SDKMetaData): void;
13
- startBizFlow(paymentContext: PaymentContext): Promise<BizFlowStartBehavior>;
14
- private preloadWebApp;
15
- private buildWebAppPreloadUrl;
16
- private buildWebAppUrl;
17
- private buildRedirectResult;
18
- /**
19
- * 等待Web应用启动,然后发送renderComponent事件
20
- * start waiting web launch, then send renderComponent event
21
- * */
22
- private sendRequestAndWaitWebLaunch;
23
- private processPaymentQuery;
24
- private processSubmitPay;
25
- private acquireApdidToken;
26
- private initSecuritySDK;
27
- }