@alipay/ams-checkout 0.0.1699863258-dev.3 → 0.0.1699863258-dev.5

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.
@@ -163,6 +163,16 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
163
163
  _this2._eventCenter.emit(EVENT.error.name, error);
164
164
  return Promise.reject(error);
165
165
  }).then(function (appendParams) {
166
+ var _appendParams$iframeN, _appendParams$iframeN2;
167
+ // This version, easypay2.0 only supports alipayhk
168
+ var productSceneVersion = appendParams === null || appendParams === void 0 || (_appendParams$iframeN = appendParams.iframeNodesParams) === null || _appendParams$iframeN === void 0 || (_appendParams$iframeN = _appendParams$iframeN.paymentSessionMetaData) === null || _appendParams$iframeN === void 0 || (_appendParams$iframeN = _appendParams$iframeN.paymentSessionConfig) === null || _appendParams$iframeN === void 0 ? void 0 : _appendParams$iframeN.productSceneVersion;
169
+ var paymentMethodType = appendParams === null || appendParams === void 0 || (_appendParams$iframeN2 = appendParams.iframeNodesParams) === null || _appendParams$iframeN2 === void 0 || (_appendParams$iframeN2 = _appendParams$iframeN2.paymentSessionMetaData) === null || _appendParams$iframeN2 === void 0 || (_appendParams$iframeN2 = _appendParams$iframeN2.paymentMethodInfoView) === null || _appendParams$iframeN2 === void 0 ? void 0 : _appendParams$iframeN2.paymentMethodType;
170
+ if ((appendParams === null || appendParams === void 0 ? void 0 : appendParams.componentSign) === componentSignEnum.EASY_PAY_WALLET && productSceneVersion === '2.0' && paymentMethodType !== 'ALIPAY_HK') {
171
+ return Promise.reject({
172
+ code: ERRORMESSAGE.CREATEPAYMENT_PARAMETER_ERROR.code,
173
+ message: "Abnormal response data, interface failure, or unsupported payment method"
174
+ });
175
+ }
166
176
  return _this2.pluginAppendIframe(appendParams);
167
177
  });
168
178
  }
package/esm/index.d.ts CHANGED
@@ -1,10 +1,3 @@
1
- /**
2
- * Copyright (c) 2022 International Business Group, Ant Group. All rights reserved.
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), the rights to use, copy, modify, merge, and/or distribute the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
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
- * 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
- */
8
1
  import { AMSComponent } from './core/component/index';
9
2
  import { IoptionsParams } from './types';
10
3
  export * from './types';
package/esm/index.js CHANGED
@@ -18,6 +18,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
18
18
  * 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
19
19
  * 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.
20
20
  */
21
+ import { productSceneEnum } from "./types/index";
21
22
  import { AMSComponent } from "./core/component/index";
22
23
  export * from "./types";
23
24
  export var AMSCheckout = /*#__PURE__*/function (_AMSComponent) {
@@ -34,7 +35,10 @@ export var AMSAutoDebit = /*#__PURE__*/function (_AMSCheckout) {
34
35
  var _super2 = _createSuper(AMSAutoDebit);
35
36
  function AMSAutoDebit(options) {
36
37
  _classCallCheck(this, AMSAutoDebit);
37
- return _super2.call(this, options);
38
+ var _options = Object.assign({}, options, {
39
+ product: productSceneEnum.AUTO_DEBIT
40
+ });
41
+ return _super2.call(this, _options);
38
42
  }
39
43
  return _createClass(AMSAutoDebit);
40
44
  }(AMSCheckout);
@@ -43,7 +47,10 @@ export var AMSEasyPay = /*#__PURE__*/function (_AMSCheckout2) {
43
47
  var _super3 = _createSuper(AMSEasyPay);
44
48
  function AMSEasyPay(options) {
45
49
  _classCallCheck(this, AMSEasyPay);
46
- return _super3.call(this, options);
50
+ var _options = Object.assign({}, options, {
51
+ product: productSceneEnum.EASY_PAY
52
+ });
53
+ return _super3.call(this, _options);
47
54
  }
48
55
  return _createClass(AMSEasyPay);
49
56
  }(AMSCheckout);
@@ -52,7 +59,10 @@ export var AMSCashierPayment = /*#__PURE__*/function (_AMSCheckout3) {
52
59
  var _super4 = _createSuper(AMSCashierPayment);
53
60
  function AMSCashierPayment(options) {
54
61
  _classCallCheck(this, AMSCashierPayment);
55
- return _super4.call(this, options);
62
+ var _options = Object.assign({}, options, {
63
+ product: productSceneEnum.CASHIER_PAYMENT
64
+ });
65
+ return _super4.call(this, _options);
56
66
  }
57
67
  return _createClass(AMSCashierPayment);
58
68
  }(AMSCheckout);
@@ -61,7 +71,10 @@ export var AMSVaulting = /*#__PURE__*/function (_AMSCheckout4) {
61
71
  var _super5 = _createSuper(AMSVaulting);
62
72
  function AMSVaulting(options) {
63
73
  _classCallCheck(this, AMSVaulting);
64
- return _super5.call(this, options);
74
+ var _options = Object.assign({}, options, {
75
+ product: productSceneEnum.VAULTING
76
+ });
77
+ return _super5.call(this, _options);
65
78
  }
66
79
  return _createClass(AMSVaulting);
67
80
  }(AMSCheckout);
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@alipay/ams-checkout","version":"0.0.1699863258-dev.3","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/eslint-plugin":"latest","@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","eslint-plugin-prettier":"latest","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.1699863258-dev.5","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/eslint-plugin":"latest","@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","eslint-plugin-prettier":"latest","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"}}