@alipay/ams-checkout 0.0.1732700846-dev.1 → 0.0.1732700846-dev.11

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 (63) hide show
  1. package/dist/umd/ams-checkout.min.js +1 -1
  2. package/esm/component/channel.js +1 -1
  3. package/esm/component/component.popup.style.d.ts +2 -0
  4. package/esm/component/component.popup.style.js +15 -2
  5. package/esm/config/index.d.ts +7 -7
  6. package/esm/config/index.js +7 -7
  7. package/esm/constant/index.d.ts +17 -0
  8. package/esm/constant/index.js +18 -0
  9. package/esm/core/bus/index.d.ts +3 -3
  10. package/esm/core/bus/index.js +14 -14
  11. package/esm/core/component/appPreloadProcessing.js +2 -2
  12. package/esm/core/component/ckp/index.js +6 -3
  13. package/esm/core/component/element/index.d.ts +1 -0
  14. package/esm/core/component/element/index.js +79 -70
  15. package/esm/core/component/element/mock.d.ts +2 -0
  16. package/esm/core/component/element/mock.js +129 -53
  17. package/esm/core/component/element/type.d.ts +5 -4
  18. package/esm/core/component/element/type.js +3 -2
  19. package/esm/core/component/index.js +8 -12
  20. package/esm/core/instance/index.js +3 -3
  21. package/esm/foundation/core/index.d.ts +2 -0
  22. package/esm/foundation/core/index.js +50 -20
  23. package/esm/foundation/product-processor/easysafepay/index.js +17 -16
  24. package/esm/foundation/service/api-bus/busManager.d.ts +3 -3
  25. package/esm/foundation/service/api-bus/busManager.js +14 -14
  26. package/esm/foundation/service/container/index.d.ts +2 -0
  27. package/esm/foundation/service/container/index.js +33 -1
  28. package/esm/foundation/service/event-center.d.ts +9 -3
  29. package/esm/foundation/service/event-center.js +41 -10
  30. package/esm/foundation/service/log/index.d.ts +2 -2
  31. package/esm/foundation/service/log/index.js +23 -8
  32. package/esm/foundation/service/log/keys.d.ts +13 -0
  33. package/esm/foundation/service/log/keys.js +103 -0
  34. package/esm/foundation/service/log/processor.d.ts +9 -0
  35. package/esm/foundation/service/log/processor.js +148 -0
  36. package/esm/foundation/service/log/types.d.ts +1 -1
  37. package/esm/foundation/service/requester/requester.js +3 -0
  38. package/esm/foundation/service/security/index.js +6 -8
  39. package/esm/foundation/utils/redirect_utils.js +1 -2
  40. package/esm/index.d.ts +1 -0
  41. package/esm/index.js +6 -1
  42. package/esm/plugin/applepay/component.js +10 -8
  43. package/esm/plugin/applepay/index.js +10 -6
  44. package/esm/plugin/applepay/interface.d.ts +2 -2
  45. package/esm/plugin/applepay/service.js +24 -16
  46. package/esm/plugin/component/cashierApp.js +3 -3
  47. package/esm/plugin/component/channel.d.ts +41 -1
  48. package/esm/plugin/component/channel.js +590 -2
  49. package/esm/plugin/component/component.popup.style.d.ts +8 -0
  50. package/esm/plugin/component/component.popup.style.js +22 -2
  51. package/esm/plugin/component/index.d.ts +3 -1
  52. package/esm/plugin/component/index.js +136 -68
  53. package/esm/plugin/paypal/index.js +1 -1
  54. package/esm/service/index.js +4 -2
  55. package/esm/types/index.d.ts +32 -2
  56. package/esm/types/index.js +3 -2
  57. package/esm/util/getBackScheme.js +1 -2
  58. package/esm/util/index.js +4 -8
  59. package/esm/util/logger.d.ts +3 -3
  60. package/esm/util/logger.js +49 -13
  61. package/esm/util/spm-map.d.ts +172 -0
  62. package/esm/util/spm-map.js +172 -0
  63. package/package.json +1 -1
@@ -57,10 +57,12 @@ export var ApplePayBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
57
57
  name: 'APPLE_PAY',
58
58
  title: ApplePayComponentEvent.sdk_event_appleAvailable
59
59
  }, {
60
- biz: 'sdk',
61
- type: 'funnel',
62
- success: canMakePayments,
63
- recurring: subPaymentMethod === 'ApplePayRecurringPayment'
60
+ eventSource: 'sdk',
61
+ processResult: canMakePayments,
62
+ eventMessage: JSON.stringify({
63
+ type: 'funnel',
64
+ recurring: subPaymentMethod === 'ApplePayRecurringPayment'
65
+ })
64
66
  }).send();
65
67
  }
66
68
  }, {
@@ -88,8 +90,10 @@ export var ApplePayBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
88
90
  name: 'APPLE_PAY',
89
91
  title: ApplePayComponentEvent.sdk_event_appleDestroyComponent
90
92
  }, {
91
- biz: 'sdk',
92
- type: 'funnel'
93
+ eventSource: 'sdk',
94
+ eventMessage: JSON.stringify({
95
+ type: 'funnel'
96
+ })
93
97
  }).send();
94
98
  }
95
99
  }, {
@@ -37,8 +37,8 @@ export interface IApplePayPaymentContact {
37
37
  countryCode: string;
38
38
  }
39
39
  export type IApplePayLineItemType = 'final' | 'pending';
40
- export type ApplePayPaymentTiming = "immediate" | "recurring" | "deferred" | "automaticReload";
41
- export type ApplePayRecurringPaymentDateUnit = "year" | "month" | "day" | "hour" | "minute";
40
+ export type ApplePayPaymentTiming = 'immediate' | 'recurring' | 'deferred' | 'automaticReload';
41
+ export type ApplePayRecurringPaymentDateUnit = 'year' | 'month' | 'day' | 'hour' | 'minute';
42
42
  /**
43
43
  *
44
44
  {
@@ -62,10 +62,12 @@ var ApplePayService = /*#__PURE__*/function () {
62
62
  name: 'APPLE_PAY',
63
63
  title: ApplePayComponentEvent.sdk_event_appleCreateComponent
64
64
  }, {
65
- biz: 'sdk',
66
- type: 'funnel',
67
- success: success,
68
- recurring: _this.isRecurring
65
+ eventSource: 'sdk',
66
+ processResult: success,
67
+ eventMessage: JSON.stringify({
68
+ type: 'funnel',
69
+ recurring: _this.isRecurring
70
+ })
69
71
  }).send();
70
72
  });
71
73
  _defineProperty(this, "onpaymentauthorized", function (event) {
@@ -98,10 +100,12 @@ var ApplePayService = /*#__PURE__*/function () {
98
100
  name: 'APPLE_PAY',
99
101
  title: ApplePayComponentEvent.sdk_event_appleSubmitToken
100
102
  }, {
101
- biz: 'sdk',
102
- type: 'funnel',
103
- success: success,
104
- recurring: _this.isRecurring
103
+ eventSource: 'sdk',
104
+ processResult: success,
105
+ eventMessage: JSON.stringify({
106
+ type: 'funnel',
107
+ recurring: _this.isRecurring
108
+ })
105
109
  }).send();
106
110
  });
107
111
  /**
@@ -122,10 +126,12 @@ var ApplePayService = /*#__PURE__*/function () {
122
126
  name: 'APPLE_PAY',
123
127
  title: ApplePayComponentEvent.sdk_event_appleCreateComponent
124
128
  }, {
125
- biz: 'sdk',
126
- type: 'funnel',
127
- success: ApplePaySession !== null,
128
- recurring: _this.isRecurring
129
+ eventSource: 'sdk',
130
+ processResult: ApplePaySession !== null,
131
+ eventMessage: JSON.stringify({
132
+ type: 'funnel',
133
+ recurring: _this.isRecurring
134
+ })
129
135
  }).send();
130
136
  if (!ApplePaySession) {
131
137
  _this.logError(eventCodeEnum.SDK_PAYMENT_ERROR, "ApplePaySession is only support in Safari");
@@ -200,10 +206,12 @@ var ApplePayService = /*#__PURE__*/function () {
200
206
  name: 'APPLE_PAY',
201
207
  title: ApplePayComponentEvent.sdk_event_appleShowPaymentSheet
202
208
  }, {
203
- biz: 'sdk',
204
- type: 'funnel',
205
- success: true,
206
- recurring: recurringInfo !== null
209
+ eventSource: 'sdk',
210
+ processResult: true,
211
+ eventMessage: JSON.stringify({
212
+ type: 'funnel',
213
+ recurring: recurringInfo !== null
214
+ })
207
215
  }).send();
208
216
  });
209
217
  this.logger = logger;
@@ -35,11 +35,11 @@ var getAppVersion = function getAppVersion(_extendInfo, productScene, mid) {
35
35
  title: 'sdk_event_appUpgradeInfo'
36
36
  }, {
37
37
  appUpgradeVersion: appVersion,
38
- appUpgraded: appVersion ? true : false,
38
+ processResult: appVersion ? true : false,
39
39
  isPreload: _extendInfo ? false : true,
40
- extendInfo: _extendInfo,
40
+ config: _extendInfo,
41
41
  productScene: productScene,
42
- mid: mid
42
+ merchantId: mid
43
43
  });
44
44
  }
45
45
 
@@ -1,4 +1,5 @@
1
- import type { EventPayload, IPaymentSessionMetaData } from '../../types';
1
+ import { EventPayloadContext, type EventPayload, type IPaymentMethod, type IPaymentSessionMetaData } from '../../types';
2
+ import { Logger } from '../../util/logger';
2
3
  export type IChannelBehavior = {
3
4
  usePaymentSessionAsQueryResult: boolean;
4
5
  submitPayInSdk: boolean;
@@ -18,4 +19,43 @@ type GetDoubleFaParams = {
18
19
  export declare function getChannelBehavior(paymentSessionMetaData?: IPaymentSessionMetaData): IChannelBehavior | undefined;
19
20
  export declare function getDoubleFaUrl(params: GetDoubleFaParams): string;
20
21
  export declare const handleGooglePay: (data: EventPayload) => Promise<unknown>;
22
+ export declare class ApplePayService {
23
+ private APPLESDKURL;
24
+ private applePaySession;
25
+ private paymentSessionData;
26
+ private sessionResult;
27
+ /**
28
+ * @description 支付状态,pending:支付中,normal:正常
29
+ */
30
+ private paymentStatus;
31
+ /**
32
+ * @description paymentRequest
33
+ */
34
+ private paymentRequest;
35
+ private logger;
36
+ private dispatchToApp;
37
+ private paymentMethod;
38
+ constructor({ sessionData, paymentSessionMetaData, paymentMethod, logger, dispatchToApp, }: {
39
+ sessionData: string;
40
+ paymentSessionMetaData: IPaymentSessionMetaData;
41
+ paymentMethod: IPaymentMethod;
42
+ logger: Logger;
43
+ dispatchToApp: (payload: {
44
+ context: EventPayloadContext;
45
+ }) => void;
46
+ });
47
+ private startPay;
48
+ private setApplePayStatus;
49
+ private submitPay;
50
+ submit(): Promise<void>;
51
+ private getDeviceId;
52
+ private initApplePaySession;
53
+ private isCanMakePayments;
54
+ private loadApplePaySdk;
55
+ private abortPaySession;
56
+ private addEventListener;
57
+ private get initSessionParams();
58
+ private get isRequiredParameters();
59
+ private get checkScriptIsLoaded();
60
+ }
21
61
  export {};