@alipay/ams-checkout 0.0.1713838058-dev.3 → 0.0.1713844123-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 (40) hide show
  1. package/dist/umd/ams-checkout.min.js +1 -1
  2. package/esm/core/bus/index.d.ts +1 -1
  3. package/esm/core/bus/interface.d.ts +1 -5
  4. package/esm/core/bus/interface.js +1 -6
  5. package/esm/core/component/index.js +9 -11
  6. package/esm/core/instance/index.d.ts +1 -8
  7. package/esm/core/instance/index.js +11 -18
  8. package/esm/plugin/applepay/component.d.ts +1 -1
  9. package/esm/plugin/applepay/component.js +5 -5
  10. package/esm/plugin/applepay/index.d.ts +1 -1
  11. package/esm/plugin/applepay/index.js +6 -6
  12. package/esm/plugin/component/cashierApp.d.ts +2 -6
  13. package/esm/plugin/component/cashierApp.js +13 -69
  14. package/esm/plugin/component/channel.d.ts +20 -0
  15. package/esm/plugin/component/channel.js +38 -0
  16. package/esm/plugin/component/component.popup.style.d.ts +4 -1
  17. package/esm/plugin/component/component.popup.style.js +7 -1
  18. package/esm/plugin/component/index.js +119 -110
  19. package/esm/plugin/const.js +4 -18
  20. package/esm/plugin/type.d.ts +2 -2
  21. package/esm/request/index.js +2 -2
  22. package/esm/types/index.d.ts +6 -53
  23. package/esm/types/index.js +1 -18
  24. package/esm/util/index.d.ts +1 -2
  25. package/esm/util/index.js +2 -4
  26. package/esm/util/logger.d.ts +0 -8
  27. package/esm/util/logger.js +3 -34
  28. package/esm/util/versionCompare.d.ts +1 -8
  29. package/esm/util/versionCompare.js +0 -22
  30. package/package.json +1 -1
  31. package/esm/plugin/paypal/index.d.ts +0 -20
  32. package/esm/plugin/paypal/index.js +0 -389
  33. package/esm/plugin/utils.d.ts +0 -6
  34. package/esm/plugin/utils.js +0 -21
  35. package/esm/util/debug.d.ts +0 -1
  36. package/esm/util/debug.js +0 -9
  37. package/esm/util/storage.d.ts +0 -2
  38. package/esm/util/storage.js +0 -23
  39. package/esm/util/upgrade.d.ts +0 -39
  40. package/esm/util/upgrade.js +0 -115
@@ -42,6 +42,7 @@ export interface IcreatePaymentParams {
42
42
  }
43
43
  export declare enum componentSignEnum {
44
44
  'EASY_PAY_WALLET' = "EASY_PAY_WALLET",
45
+ 'EASY_PAY_APM' = "EASY_PAY_APM",
45
46
  'CASHIER_PAYMENT_CARD' = "CASHIER_PAYMENT_CARD",
46
47
  'CASHIER_PAYMENT_BANK' = "CASHIER_PAYMENT_BANK",
47
48
  'CASHIER_PAYMENT_APM' = "CASHIER_PAYMENT_APM",
@@ -81,19 +82,6 @@ export interface IappendIframeNodesParams extends IcreateComponent {
81
82
  paymentSessionMetaData: IpaymentSessionMetaData;
82
83
  renderDisplayType: renderDisplayTypeEnum;
83
84
  selector?: Iselector;
84
- paypalConfiguration?: IPaypalConfiguration;
85
- }
86
- export interface IPaypalConfiguration {
87
- style?: Object;
88
- blockPayPalCreditButton?: boolean;
89
- blockPayPalPayLaterButton?: boolean;
90
- displayPayPalPayLaterButtonOnly?: boolean;
91
- enableMessages?: boolean;
92
- intent?: payPalConfigurationIntentEnum;
93
- }
94
- export declare enum payPalConfigurationIntentEnum {
95
- 'intent' = "intent",
96
- 'capture' = "capture"
97
85
  }
98
86
  export interface IMerchantAppointParam {
99
87
  storedCard?: IStoredCard;
@@ -112,7 +100,7 @@ export interface IbillingAddress {
112
100
  export interface Isubmit {
113
101
  billingAddress?: IbillingAddress;
114
102
  }
115
- export interface IpaymentSessionConfig {
103
+ interface IpaymentSessionConfig {
116
104
  productScene: productSceneEnum;
117
105
  paymentMethodCategoryType: paymentMethodCategoryTypeEnum;
118
106
  productSceneVersion: string;
@@ -144,6 +132,7 @@ export interface IpaymentSessionMetaData {
144
132
  extendInfo?: string;
145
133
  paymentMethodInfoView?: any;
146
134
  action?: {
135
+ amountConfirmRequired?: boolean;
147
136
  autoDebitWithToken: boolean;
148
137
  skipSdkQuery: boolean;
149
138
  skipSdkQueryForm?: {
@@ -214,33 +203,6 @@ export interface IpaymentSessionMetaData {
214
203
  };
215
204
  };
216
205
  }
217
- export interface IPaymentSessionFactor {
218
- merchantInfo?: IMerchantInfo;
219
- paymentMethodInfo: IPaymentMethodInfo;
220
- paymentAmount?: IPaymentAmount;
221
- paypal?: IPaypalConfig;
222
- }
223
- export interface IPaymentMethodInfo {
224
- paymentMethodMetaData?: IPaymentMethodMetaData;
225
- paymentMethodType?: PaypalMethodEnum;
226
- }
227
- export type IPaypalConfig = {
228
- accessToken: string;
229
- };
230
- export interface IPaymentMethodMetaData {
231
- bindPaymentMethod?: string;
232
- boundPaymentMethod?: string;
233
- }
234
- export interface IMerchantInfo {
235
- channelMerchantClientId?: string;
236
- }
237
- export interface IPaymentAmount {
238
- value?: string;
239
- currency?: PaymentAmountEnum;
240
- }
241
- export declare enum PaymentAmountEnum {
242
- USD = "USD"
243
- }
244
206
  export declare enum localeEnum {
245
207
  'en-US' = "en-US"
246
208
  }
@@ -425,6 +387,7 @@ export interface CashierSubmitPayRequest {
425
387
  verifyFactors?: Record<string, string>;
426
388
  paymentSessionData: string;
427
389
  paymentSessionConfig?: any;
390
+ extParams?: any;
428
391
  }
429
392
  export interface CashierSdkActionQueryResult {
430
393
  supportedLanguages?: any[];
@@ -442,9 +405,6 @@ export interface CashierSdkActionQueryResult {
442
405
  applinkUrl?: string;
443
406
  schemeUrl?: string;
444
407
  authUrl?: string;
445
- extendInfo?: {
446
- channelOrderId?: string;
447
- };
448
408
  }
449
409
  /**
450
410
  * Get App Pay Payment Session Request.
@@ -503,10 +463,7 @@ export declare enum eventCodeEnum {
503
463
  /**
504
464
  * 当前为Apple Pay发起了Pay请求,但是用户关闭了页面
505
465
  */
506
- SDK_PAYMENT_PROCESSING = "SDK_PAYMENT_PROCESSING",
507
- SDK_PAYMENT_WARN = "SDK_PAYMENT_WARN",
508
- SDK_PAYMENT_SHIPPINGCHANGE = "SDK_PAYMENT_SHIPPINGCHANGE",
509
- SDK_PAYMENT_APPROVE = "SDK_PAYMENT_APPROVE"
466
+ SDK_PAYMENT_PROCESSING = "SDK_PAYMENT_PROCESSING"
510
467
  }
511
468
  export declare enum RedirectType {
512
469
  ApplinkUrl = "ApplinkUrl",
@@ -527,11 +484,6 @@ export interface CallbackEventInfo {
527
484
  export interface MultipleCallbackEvents {
528
485
  [key: string]: CallbackEventInfo;
529
486
  }
530
- export declare enum PaypalMethodEnum {
531
- PAYPAL_CHECKOUT = "PAYPAL_CHECKOUT",
532
- PAYPAL_VAULT = "PAYPAL_VAULT",
533
- PAYPAL_PAYLATER = "PAYPAL_PAYLATER"
534
- }
535
487
  export type PaymentMethodTypeEnum = 'ApplePay';
536
488
  export type ApplePaySubTypeEnum = 'ApplePayRecurringPayment';
537
489
  export type SubPaymentMethodTypeEnum = ApplePaySubTypeEnum;
@@ -543,3 +495,4 @@ export type IAppendParams = {
543
495
  componentSign: componentSignEnum;
544
496
  iframeNodesParams: IappendIframeNodesParams;
545
497
  };
498
+ export {};
@@ -17,6 +17,7 @@ export var renderDisplayTypeEnum = /*#__PURE__*/function (renderDisplayTypeEnum)
17
17
  }({});
18
18
  export var componentSignEnum = /*#__PURE__*/function (componentSignEnum) {
19
19
  componentSignEnum["EASY_PAY_WALLET"] = "EASY_PAY_WALLET";
20
+ componentSignEnum["EASY_PAY_APM"] = "EASY_PAY_APM";
20
21
  componentSignEnum["CASHIER_PAYMENT_CARD"] = "CASHIER_PAYMENT_CARD";
21
22
  componentSignEnum["CASHIER_PAYMENT_BANK"] = "CASHIER_PAYMENT_BANK";
22
23
  componentSignEnum["CASHIER_PAYMENT_APM"] = "CASHIER_PAYMENT_APM";
@@ -41,15 +42,6 @@ export var paymentMethodCategoryTypeEnum = /*#__PURE__*/function (paymentMethodC
41
42
  paymentMethodCategoryTypeEnum["APM"] = "APM";
42
43
  return paymentMethodCategoryTypeEnum;
43
44
  }({});
44
- export var payPalConfigurationIntentEnum = /*#__PURE__*/function (payPalConfigurationIntentEnum) {
45
- payPalConfigurationIntentEnum["intent"] = "intent";
46
- payPalConfigurationIntentEnum["capture"] = "capture";
47
- return payPalConfigurationIntentEnum;
48
- }({});
49
- export var PaymentAmountEnum = /*#__PURE__*/function (PaymentAmountEnum) {
50
- PaymentAmountEnum["USD"] = "USD";
51
- return PaymentAmountEnum;
52
- }({});
53
45
  export var localeEnum = /*#__PURE__*/function (localeEnum) {
54
46
  localeEnum["en-US"] = "en-US";
55
47
  return localeEnum;
@@ -167,9 +159,6 @@ export var eventCodeEnum = /*#__PURE__*/function (eventCodeEnum) {
167
159
  eventCodeEnum["SDK_PAYMENT_ERROR"] = "SDK_PAYMENT_ERROR";
168
160
  eventCodeEnum["SDK_PAYMENT_CANCEL"] = "SDK_PAYMENT_CANCEL";
169
161
  eventCodeEnum["SDK_PAYMENT_PROCESSING"] = "SDK_PAYMENT_PROCESSING";
170
- eventCodeEnum["SDK_PAYMENT_WARN"] = "SDK_PAYMENT_WARN";
171
- eventCodeEnum["SDK_PAYMENT_SHIPPINGCHANGE"] = "SDK_PAYMENT_SHIPPINGCHANGE";
172
- eventCodeEnum["SDK_PAYMENT_APPROVE"] = "SDK_PAYMENT_APPROVE";
173
162
  return eventCodeEnum;
174
163
  }({});
175
164
  export var RedirectType = /*#__PURE__*/function (RedirectType) {
@@ -179,12 +168,6 @@ export var RedirectType = /*#__PURE__*/function (RedirectType) {
179
168
  RedirectType["Unknown"] = "Unknown";
180
169
  return RedirectType;
181
170
  }({});
182
- export var PaypalMethodEnum = /*#__PURE__*/function (PaypalMethodEnum) {
183
- PaypalMethodEnum["PAYPAL_CHECKOUT"] = "PAYPAL_CHECKOUT";
184
- PaypalMethodEnum["PAYPAL_VAULT"] = "PAYPAL_VAULT";
185
- PaypalMethodEnum["PAYPAL_PAYLATER"] = "PAYPAL_PAYLATER";
186
- return PaypalMethodEnum;
187
- }({});
188
171
  export var ProductSceneVersion = /*#__PURE__*/function (ProductSceneVersion) {
189
172
  ProductSceneVersion["V1"] = "1.0";
190
173
  ProductSceneVersion["V2"] = "2.0";
@@ -37,6 +37,5 @@ declare const addSetFontSizeEvent: () => void;
37
37
  */
38
38
  declare const getOrSetStorageId: (key: string, value?: string) => string;
39
39
  declare const checkTimeElapsed: () => boolean;
40
- declare const isFunction: (func: any) => boolean;
41
40
  declare function parseBase64ToString(base64: string): string;
42
- export { getType, EventCenter, getViewPort, getOrigin, serialize, isJsonString, isDom, isFunction, device, safeJson, isPC, queryParse, getDesignFontSize, amsSetSize, addSetFontSizeEvent, getOrSetStorageId, checkTimeElapsed, parseBase64ToString, };
41
+ export { getType, EventCenter, getViewPort, getOrigin, serialize, isJsonString, isDom, device, safeJson, isPC, queryParse, getDesignFontSize, amsSetSize, addSetFontSizeEvent, getOrSetStorageId, checkTimeElapsed, parseBase64ToString, };
package/esm/util/index.js CHANGED
@@ -246,9 +246,7 @@ var checkTimeElapsed = function checkTimeElapsed() {
246
246
  localStorage.setItem(key, currentTime.toString());
247
247
  return true;
248
248
  };
249
- var isFunction = function isFunction(func) {
250
- return typeof func === 'function';
251
- };
249
+
252
250
  // https://developer.mozilla.org/en-US/docs/Glossary/Base64
253
251
  function parseBase64ToString(base64) {
254
252
  try {
@@ -261,4 +259,4 @@ function parseBase64ToString(base64) {
261
259
  return null;
262
260
  }
263
261
  }
264
- export { getType, EventCenter, getViewPort, getOrigin, serialize, isJsonString, isDom, isFunction, device, safeJson, isPC, queryParse, getDesignFontSize, amsSetSize, addSetFontSizeEvent, getOrSetStorageId, checkTimeElapsed, parseBase64ToString };
262
+ export { getType, EventCenter, getViewPort, getOrigin, serialize, isJsonString, isDom, device, safeJson, isPC, queryParse, getDesignFontSize, amsSetSize, addSetFontSizeEvent, getOrSetStorageId, checkTimeElapsed, parseBase64ToString };
@@ -12,7 +12,6 @@ type Extra = Record<string, any>;
12
12
  export interface LogMetaData {
13
13
  platform?: string;
14
14
  sdkVersion?: string;
15
- webAppVersion?: string;
16
15
  fistLogTime?: number;
17
16
  fsDuration?: number;
18
17
  instanceId?: string;
@@ -24,7 +23,6 @@ export interface LogMetaData {
24
23
  paymentMethodType?: string;
25
24
  paymentMethodCategoryType?: string;
26
25
  requestSeq?: string;
27
- trackId?: string;
28
26
  }
29
27
  interface Config {
30
28
  scriptUrl: string;
@@ -43,11 +41,7 @@ export declare class Logger {
43
41
  private debug;
44
42
  private componentStartTime;
45
43
  private isLoaded;
46
- private static instance;
47
- private trackId;
48
44
  constructor(config: Config, debug: boolean);
49
- static setInstance(instance: Logger): Logger;
50
- static getInstance(): Logger;
51
45
  setMedta(mdata: LogMetaData): void;
52
46
  logError(error: LogPayload, extra?: Extra): Logger;
53
47
  logInfo(info: LogPayload, extra?: Extra): Logger;
@@ -57,8 +51,6 @@ export declare class Logger {
57
51
  initTracker(): void;
58
52
  send(): void;
59
53
  setComponentStartTime(val: number): void;
60
- setTrackId(trackId: string): void;
61
- getComponentStartTime(): number;
62
54
  }
63
55
  export declare const LogConfig: Config;
64
56
  export {};
@@ -15,7 +15,6 @@ export var Logger = /*#__PURE__*/function () {
15
15
  _defineProperty(this, "debug", void 0);
16
16
  _defineProperty(this, "componentStartTime", void 0);
17
17
  _defineProperty(this, "isLoaded", void 0);
18
- _defineProperty(this, "trackId", void 0);
19
18
  this.logs = [];
20
19
  this.config = config;
21
20
  this.debug = debug;
@@ -100,28 +99,19 @@ export var Logger = /*#__PURE__*/function () {
100
99
  try {
101
100
  var log = logs.pop();
102
101
  if (log.type === 'error') {
103
- var _log$logPayload;
104
102
  logError(log.logPayload, _objectSpread({
105
103
  fsDuration: fsDuration,
106
- timeStamp: now,
107
- trackId: this.trackId,
108
- title: (_log$logPayload = log.logPayload) === null || _log$logPayload === void 0 ? void 0 : _log$logPayload.title
104
+ timeStamp: now
109
105
  }, log === null || log === void 0 ? void 0 : log.extra));
110
106
  } else if (log.type === 'info') {
111
- var _log$logPayload2;
112
107
  logInfo(log.logPayload, _objectSpread({
113
108
  fsDuration: fsDuration,
114
- timeStamp: now,
115
- trackId: this.trackId,
116
- title: (_log$logPayload2 = log.logPayload) === null || _log$logPayload2 === void 0 ? void 0 : _log$logPayload2.title
109
+ timeStamp: now
117
110
  }, log === null || log === void 0 ? void 0 : log.extra));
118
111
  } else if (log.type === 'rpc') {
119
- var _log$logPayload3;
120
112
  reportRPC(log.logPayload, _objectSpread({
121
113
  fsDuration: fsDuration,
122
- timeStamp: now,
123
- trackId: this.trackId,
124
- title: (_log$logPayload3 = log.logPayload) === null || _log$logPayload3 === void 0 ? void 0 : _log$logPayload3.title
114
+ timeStamp: now
125
115
  }, log === null || log === void 0 ? void 0 : log.extra));
126
116
  }
127
117
  } catch (error) {
@@ -176,30 +166,9 @@ export var Logger = /*#__PURE__*/function () {
176
166
  value: function setComponentStartTime(val) {
177
167
  this.componentStartTime = val;
178
168
  }
179
- }, {
180
- key: "setTrackId",
181
- value: function setTrackId(trackId) {
182
- this.trackId = trackId;
183
- }
184
- }, {
185
- key: "getComponentStartTime",
186
- value: function getComponentStartTime() {
187
- return this.componentStartTime;
188
- }
189
- }], [{
190
- key: "setInstance",
191
- value: function setInstance(instance) {
192
- return this.instance = instance;
193
- }
194
- }, {
195
- key: "getInstance",
196
- value: function getInstance() {
197
- return this.instance;
198
- }
199
169
  }]);
200
170
  return Logger;
201
171
  }();
202
- _defineProperty(Logger, "instance", void 0);
203
172
  export var LogConfig = {
204
173
  scriptUrl: 'https://gw.alipayobjects.com/render/p/yuyan_npm/@alipay_intl-tracker/1.6.0/dist/common.min.js',
205
174
  spmConfig: {},
@@ -3,13 +3,6 @@
3
3
  * @param v1
4
4
  * @param v2
5
5
  */
6
- export declare function compareVersion(v1: string, v2: string): 0 | 1 | -1;
7
- /**
8
- * 判断version版本是否在range参数版本的范围内
9
- * @param version
10
- * @param range
11
- * @returns
12
- */
13
- export declare function isVersionInStringRange(version: string, range: string): boolean;
6
+ export declare function compareVersion(v1: string, v2: string): 1 | 0 | -1;
14
7
  export declare function isVersionInRange(currentVersion: any, minVersion: any, maxVersion: any): boolean;
15
8
  export declare function matchVersion(config: any, currentVersion: any): boolean;
@@ -49,28 +49,6 @@ export function compareVersion(v1, v2) {
49
49
  return 1;
50
50
  }
51
51
  }
52
- /**
53
- * 判断version版本是否在range参数版本的范围内
54
- * @param version
55
- * @param range
56
- * @returns
57
- */
58
- export function isVersionInStringRange(version, range) {
59
- if (!range) {
60
- // 未指定版本限制
61
- return true;
62
- }
63
- if (range.includes(',')) {
64
- return range.split(',').includes(version);
65
- }
66
- if (!range.includes('|')) {
67
- return version === range;
68
- }
69
- var minVersion = range.split('|')[0];
70
- var maxVersion = range.split('|')[1] || '999999.9.9';
71
- var matchVersion = compareVersion(version, minVersion) >= 0 && compareVersion(maxVersion, version) >= 0;
72
- return matchVersion;
73
- }
74
52
  export function isVersionInRange(currentVersion, minVersion, maxVersion) {
75
53
  function splitVersion(version) {
76
54
  return version.split('.').map(function (num) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/ams-checkout",
3
- "version": "0.0.1713838058-dev.3",
3
+ "version": "0.0.1713844123-dev.0",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "esm/index.js",
@@ -1,20 +0,0 @@
1
- import { BusContext, BusMessage, BusSubscriber } from '../../core/bus';
2
- import { Logger } from '../../util/logger';
3
- export declare class PaypalBusSubscriber extends BusSubscriber {
4
- logger: Logger;
5
- constructor(logger: Logger);
6
- actionNames(): string[];
7
- private onEventCallback;
8
- protected renderPaypalButton(context: BusContext, message: BusMessage): Promise<never>;
9
- private appendPaypalLoading;
10
- private removePaypalLoading;
11
- private preCheck;
12
- private loadPaypalResource;
13
- private createPaypalScript;
14
- private onShippingChange;
15
- private createOrder;
16
- private onApprove;
17
- private onCancel;
18
- private destroyComponent;
19
- onMessage(context: BusContext, message: BusMessage): void;
20
- }