@alipay/ams-checkout 0.0.1782095417-dev.2 → 0.0.1782095417-dev.4

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.
@@ -20,7 +20,7 @@ export declare class AMSCheckoutPage {
20
20
  /**
21
21
  * 挂载组件
22
22
  */
23
- mountComponent(params: Pick<IcreateComponent, 'sessionData'>, selector: string): Promise<void>;
23
+ mountComponent(params: Pick<IcreateComponent, 'sessionData' | 'isDemoMode'>, selector: string): Promise<void>;
24
24
  /**
25
25
  * 卸载组件
26
26
  */
@@ -50,7 +50,7 @@ export var AMSCheckoutPage = /*#__PURE__*/function () {
50
50
  _defineProperty(this, "originOptions", void 0);
51
51
  _defineProperty(this, "APP_IFRAME_ID", 'antom-checkout-page-sub-page-iframe');
52
52
  _defineProperty(this, "eventListener", void 0);
53
- _defineProperty(this, "generateIframeSrc", function (sessionData) {
53
+ _defineProperty(this, "generateIframeSrc", function (sessionData, isDemoMode) {
54
54
  var env = _this.originOptions.environment || 'prod';
55
55
  var session = sessionData || '';
56
56
  var lang = _this.originOptions.locale || 'en_US';
@@ -66,6 +66,9 @@ export var AMSCheckoutPage = /*#__PURE__*/function () {
66
66
  if (env === 'sandbox') {
67
67
  queryObj.shadow = 'true';
68
68
  }
69
+ if (isDemoMode) {
70
+ queryObj.demoMode = 'true';
71
+ }
69
72
  Object.keys(queryObj).forEach(function (key) {
70
73
  url += "".concat(url.includes('?') ? '&' : '?').concat(key, "=").concat(encodeURIComponent(queryObj[key]));
71
74
  });
@@ -177,7 +180,7 @@ export var AMSCheckoutPage = /*#__PURE__*/function () {
177
180
  throw new Error('PARAMS_ERROR_ALREADY_MOUNTED');
178
181
  }
179
182
  this.addListener();
180
- var ckpPageAddress = this.generateIframeSrc(params.sessionData);
183
+ var ckpPageAddress = this.generateIframeSrc(params.sessionData, params.isDemoMode);
181
184
  var iframe = document.createElement('iframe');
182
185
  iframe.id = this.APP_IFRAME_ID;
183
186
  iframe.src = ckpPageAddress;
@@ -8,7 +8,7 @@
8
8
  import type { AxiosHeaderValue } from 'axios';
9
9
  import { IApplePayContactField } from '../plugin/applepay/interface';
10
10
  export type onChange = () => onCnageResult;
11
- export { type IElementOptions, ElementType, PaymentElementLayout, ThemeType } from '../core/component/element/type';
11
+ export { ElementType, PaymentElementLayout, ThemeType, type IElementOptions } from '../core/component/element/type';
12
12
  interface onCnageResult {
13
13
  complete: boolean;
14
14
  addressValue: AddressItem[];
@@ -127,6 +127,7 @@ export interface IcreateComponent {
127
127
  isAppWebview?: boolean;
128
128
  merchantAppointParam?: IMerchantAppointParam;
129
129
  isNativeAppWebview?: boolean;
130
+ isDemoMode?: boolean;
130
131
  }
131
132
  export interface IappendIframeNodesParams extends IcreateComponent {
132
133
  paymentSessionMetaData: IPaymentSessionMetaData;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/ams-checkout",
3
- "version": "0.0.1782095417-dev.2",
3
+ "version": "0.0.1782095417-dev.4",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "exports": {