@alipay/ams-checkout 0.0.1691743027-dev.8 → 0.0.1691743027-dev.9

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.
@@ -5,15 +5,15 @@
5
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
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
7
  */
8
- import { createPaymentParams } from '../../types';
9
- export declare const mixinDropInConstructor: (options: optionsParams, context: any) => void;
8
+ import { IcreatePaymentParams, IoptionsParams } from '../../types';
9
+ export declare const mixinDropInConstructor: (options: IoptionsParams, context: any) => void;
10
10
  /**
11
11
  * @description Create checkout application
12
12
  * @description drop-in
13
13
  */
14
- export declare const createPayment: (params: createPaymentParams) => Promise<void>;
14
+ export declare const createPayment: (params: IcreatePaymentParams) => Promise<void>;
15
15
  export interface IcreatePaymentFunc {
16
- (params: createPaymentParams): Promise<void>;
16
+ (params: IcreatePaymentParams): Promise<void>;
17
17
  }
18
18
  /**
19
19
  * @description Take action on the interface result of payment submission
@@ -11,7 +11,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
11
11
 
12
12
  import { BASEPLUGINID, ERRORMESSAGE, EVENT } from "../../constant";
13
13
  import CheckoutApp from "../../plugin/drop-in";
14
- import { messageName, networkMode } from "../../types";
14
+ import { messageName, networkModeEnum } from "../../types";
15
15
  import { createIframeNode } from "../../util/createIframeNode";
16
16
  export var mixinDropInConstructor = function mixinDropInConstructor(options, context) {
17
17
  // Instantiate the plug-in and set render
@@ -28,7 +28,7 @@ export var mixinDropInConstructor = function mixinDropInConstructor(options, con
28
28
  */
29
29
  export var createPayment = function createPayment(params) {
30
30
  var _this = this;
31
- if (this.options.networkMode === networkMode.proxy) {
31
+ if (this.options.networkMode === networkModeEnum.proxy) {
32
32
  return new Promise(function (resolve, reject) {
33
33
  try {
34
34
  var checkoutApp = _this._getPlugin(BASEPLUGINID);
@@ -38,7 +38,7 @@ export var createPayment = function createPayment(params) {
38
38
  }
39
39
  });
40
40
  } else {
41
- console.warn(ERRORMESSAGE.INIT_PARAMETER_ERROR.NET_MODE_NOT_SUPPORT.errorMessage);
41
+ console.warn(ERRORMESSAGE.INIT_PARAMETER_ERROR.NET_MODE_NOT_SUPPORT.message);
42
42
  return Promise.reject(ERRORMESSAGE.INIT_PARAMETER_ERROR.NET_MODE_NOT_SUPPORT);
43
43
  }
44
44
  };
@@ -1,5 +1,5 @@
1
1
  import type AMSCheckout from '../../core/instance';
2
- import type { createPaymentParams, eventPlayload } from '../../types';
2
+ import type { IcreatePaymentParams, eventPlayload } from '../../types';
3
3
  export default class CheckoutApp {
4
4
  app: any;
5
5
  paymentMethodsResult: any;
@@ -16,13 +16,11 @@ export default class CheckoutApp {
16
16
  /**
17
17
  * @description Set the rendering capability of the cashier plug-in. Different technology stacks have some differences in the packaging and use of rendering functions
18
18
  */
19
- setRender(createIframeNode: (context: CheckoutApp, renderParams: {
20
- selector: string | HTMLElement;
21
- }) => Promise<void>): void;
19
+ setRender(createIframeNode: any): void;
22
20
  /**
23
21
  * @description High order function of rendering capability
24
22
  */
25
- render(renderParams: createPaymentParams): Promise<void>;
23
+ render(renderParams: IcreatePaymentParams): Promise<void>;
26
24
  /**
27
25
  * @description Cancel listening and destroy the dom
28
26
  */
@@ -264,7 +264,7 @@ var CheckoutApp = /*#__PURE__*/function () {
264
264
  appId: BASEPLUGINID,
265
265
  instanceId: this.AMSSDK._instanceId
266
266
  }, data);
267
- this.AMSSDK.eventCenter.emit("".concat(BASEPLUGINID, "-").concat(data.context.event), _data);
267
+ this.AMSSDK._eventCenter.emit("".concat(BASEPLUGINID, "-").concat(data.context.event), _data);
268
268
  }
269
269
  /**
270
270
  * @description Send message to iframe
@@ -288,7 +288,7 @@ var CheckoutApp = /*#__PURE__*/function () {
288
288
  for (var key in eventKeyMap) {
289
289
  // eslint-disable-next-line no-prototype-builtins
290
290
  if (eventKeyMap.hasOwnProperty(key)) {
291
- this.AMSSDK.eventCenter.on("".concat(BASEPLUGINID, "-").concat(key), eventKeyMap[key].bind(this));
291
+ this.AMSSDK._eventCenter.on("".concat(BASEPLUGINID, "-").concat(key), eventKeyMap[key].bind(this));
292
292
  }
293
293
  }
294
294
  }
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@alipay/ams-checkout","version":"0.0.1691743027-dev.8","description":"","author":"","main":"esm/index.js","module":"esm/index.js","typings":"esm/index.d.ts","files":["dist","esm","LEGAL.md","LICENSE","README.md"],"scripts":{"build":"father build","ci":"npm run lint","cov":"jest --coverage","format":"prettier --write --no-error-on-unmatched-pattern \"**/*.{js,jsx,ts,tsx,md,json,css,less}\"","lint":"eslint ./src","test":"jest"},"dependencies":{"axios":"^1.3.4","uuid":"^9.0.0"},"devDependencies":{"@babel/core":"^7.20.7","@babel/preset-env":"^7.20.2","@testing-library/jest-dom":"^5.1.1","@testing-library/react":"^9.5.0","@types/jest":"^29.2.4","@types/uuid":"^9.0.0","@typescript-eslint/parser":"^5.60.0","babel-jest":"^29.3.1","babel-loader":"^9.1.0","babel-plugin-import":"^1.13.0","eslint":"^8.36.0","father":"^4.2.3","jest":"^29.5.0","jest-environment-jsdom":"^29.3.1","prettier":"^2.8.4","prettier-plugin-organize-imports":"^3.2.3","prettier-plugin-packagejson":"^2.4.5","ts-jest":"^29.0.3","ts-node":"^10.9.1","typescript":"^4.9.5"},"engines":{},"publishConfig":{"access":"public"}}
1
+ {"name":"@alipay/ams-checkout","version":"0.0.1691743027-dev.9","description":"","author":"","main":"esm/index.js","module":"esm/index.js","typings":"esm/index.d.ts","files":["dist","esm","LEGAL.md","LICENSE","README.md"],"scripts":{"build":"father build","ci":"npm run lint","cov":"jest --coverage","format":"prettier --write --no-error-on-unmatched-pattern \"**/*.{js,jsx,ts,tsx,md,json,css,less}\"","lint":"eslint ./src","test":"jest"},"dependencies":{"axios":"^1.3.4","uuid":"^9.0.0"},"devDependencies":{"@babel/core":"^7.20.7","@babel/preset-env":"^7.20.2","@testing-library/jest-dom":"^5.1.1","@testing-library/react":"^9.5.0","@types/jest":"^29.2.4","@types/uuid":"^9.0.0","@typescript-eslint/parser":"^5.60.0","babel-jest":"^29.3.1","babel-loader":"^9.1.0","babel-plugin-import":"^1.13.0","eslint":"^8.36.0","father":"^4.2.3","jest":"^29.5.0","jest-environment-jsdom":"^29.3.1","prettier":"^2.8.4","prettier-plugin-organize-imports":"^3.2.3","prettier-plugin-packagejson":"^2.4.5","ts-jest":"^29.0.3","ts-node":"^10.9.1","typescript":"^4.9.5"},"engines":{},"publishConfig":{"access":"public"}}