@alipay/ams-checkout 0.0.1744283958-dev.13 → 0.0.1744283958-dev.15
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.
- package/dist/umd/ams-checkout.min.js +1 -1
- package/esm/core/component/element/elementController/index.js +13 -1
- package/esm/core/component/element/elementProcessor/addressProcessor.js +20 -5
- package/esm/core/component/element/elementProcessor/paymentProcessor.js +2 -1
- package/esm/core/component/element/mock.d.ts +2 -0
- package/esm/core/component/element/mock.js +5 -1
- package/esm/foundation/service/log/keys.js +3 -1
- package/package.json +1 -1
@@ -349,8 +349,20 @@ var ElementController = /*#__PURE__*/function () {
|
|
349
349
|
}, {
|
350
350
|
key: "sendReady",
|
351
351
|
value: function sendReady(type, options) {
|
352
|
-
var _this$elementProcesso;
|
352
|
+
var _this$elementProcesso, _paymentResult$origin;
|
353
353
|
var paymentResult = (_this$elementProcesso = this.elementProcessors[ElementType.payment]) === null || _this$elementProcesso === void 0 ? void 0 : _this$elementProcesso.getObtainDataRes();
|
354
|
+
if (!(paymentResult !== null && paymentResult !== void 0 && (_paymentResult$origin = paymentResult.originActionQueryResult) !== null && _paymentResult$origin !== void 0 && _paymentResult$origin.success)) {
|
355
|
+
var _this$options$onEvent, _this$options;
|
356
|
+
clearTimeout(this.initTimeout);
|
357
|
+
this.changeLoading(false);
|
358
|
+
this.initTimeout = null;
|
359
|
+
(_this$options$onEvent = (_this$options = this.options).onEventCallback) === null || _this$options$onEvent === void 0 || _this$options$onEvent.call(_this$options, {
|
360
|
+
code: EventCallbackCode.SDK_CREATE_COMPONENT_ERROR,
|
361
|
+
message: 'Component initialization exception.'
|
362
|
+
});
|
363
|
+
this.destroy();
|
364
|
+
return;
|
365
|
+
}
|
354
366
|
var paymentContext = this.elementContainer.getPaymentContext();
|
355
367
|
var params = _objectSpread(_objectSpread({}, options), {}, {
|
356
368
|
originActionQueryResult: paymentResult === null || paymentResult === void 0 ? void 0 : paymentResult.originActionQueryResult,
|
@@ -5,6 +5,9 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
5
5
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
6
6
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
7
7
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
8
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
9
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
10
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
8
11
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
9
12
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
10
13
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
@@ -17,6 +20,7 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
|
|
17
20
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
18
21
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
19
22
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
23
|
+
import { ProductSceneEnum } from "../../../../types";
|
20
24
|
import { parseSessionData } from "../..";
|
21
25
|
import PackageJson from "../../../../../package.json";
|
22
26
|
import { generateIframeSrc as _generateIframeSrc } from "../util";
|
@@ -31,21 +35,32 @@ var AddressProcessor = /*#__PURE__*/function (_BaseElementProcessor) {
|
|
31
35
|
_createClass(AddressProcessor, [{
|
32
36
|
key: "onReady",
|
33
37
|
value: function onReady(extraParam) {
|
34
|
-
var
|
38
|
+
var _paymentSessionObj$pa, _extraParam$originOne;
|
39
|
+
var paymentContext = this.elementContainer.getPaymentContext();
|
40
|
+
var paymentSessionObj = paymentContext.paymentSessionObj,
|
41
|
+
paymentSessionId = paymentContext.paymentSessionId,
|
42
|
+
displayInfo = paymentContext.displayInfo;
|
43
|
+
var isConnect = paymentSessionObj.connectFactor.enableConnect && ((_paymentSessionObj$pa = paymentSessionObj.paymentSessionConfig) === null || _paymentSessionObj$pa === void 0 ? void 0 : _paymentSessionObj$pa.productScene) === ProductSceneEnum.ELEMENT_PAYMENT;
|
35
44
|
this.eventCenter.dispatchToApp({
|
36
45
|
event: 'renderComponent',
|
37
46
|
data: {
|
38
47
|
params: {
|
39
48
|
heightOfVisible: Math.max(window.changingPageHeight, window.innerHeight),
|
40
|
-
paymentSessionData:
|
49
|
+
paymentSessionData: paymentSessionId,
|
41
50
|
queryResult: extraParam.queryResult,
|
42
51
|
envInfo: {
|
43
52
|
screenHeight: screen.height,
|
44
53
|
screenWidth: screen.width
|
45
54
|
},
|
46
|
-
|
47
|
-
|
48
|
-
|
55
|
+
configParams: _objectSpread({
|
56
|
+
needEditBackBtn: isConnect,
|
57
|
+
autoSaveAsDefaultAddress: isConnect,
|
58
|
+
editingNeedShippingQuery: isConnect,
|
59
|
+
showTitle: isConnect
|
60
|
+
}, extraParam.configParams),
|
61
|
+
appearance: displayInfo.appearance,
|
62
|
+
sessionResult: paymentSessionObj,
|
63
|
+
prefillValue: extraParam !== null && extraParam !== void 0 && extraParam.originOneAccountQueryResult ? extraParam === null || extraParam === void 0 || (_extraParam$originOne = extraParam.originOneAccountQueryResult) === null || _extraParam$originOne === void 0 ? void 0 : _extraParam$originOne.shippings : extraParam.prefillValue
|
49
64
|
},
|
50
65
|
target: 'ADDRESS_ELEMENT'
|
51
66
|
}
|
@@ -73,7 +73,8 @@ var PaymentProcessor = /*#__PURE__*/function (_BaseElementProcessor) {
|
|
73
73
|
appearance: paymentContext === null || paymentContext === void 0 ? void 0 : paymentContext.displayInfo.appearance,
|
74
74
|
sessionResult: paymentContext === null || paymentContext === void 0 ? void 0 : paymentContext.paymentSessionObj,
|
75
75
|
notRedirectAfterComplete: (extraParam === null || extraParam === void 0 ? void 0 : extraParam.notRedirectAfterComplete) === true,
|
76
|
-
merchantAppointParam: extraParam === null || extraParam === void 0 ? void 0 : extraParam.merchantAppointParam
|
76
|
+
merchantAppointParam: extraParam === null || extraParam === void 0 ? void 0 : extraParam.merchantAppointParam,
|
77
|
+
originOneAccountQueryResult: extraParam === null || extraParam === void 0 ? void 0 : extraParam.originOneAccountQueryResult
|
77
78
|
}
|
78
79
|
});
|
79
80
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export var
|
1
|
+
export var sdkAction1 = {
|
2
2
|
accountInfo: {
|
3
3
|
accountStatus: 'EFFECTIVE',
|
4
4
|
email: 'test10@test.com'
|
@@ -361,6 +361,10 @@ export var sdkAction = {
|
|
361
361
|
},
|
362
362
|
success: true
|
363
363
|
};
|
364
|
+
export var sdkAction2 = {
|
365
|
+
success: false
|
366
|
+
};
|
367
|
+
export var sdkAction = sdkAction1;
|
364
368
|
export var oneAccount1 = {
|
365
369
|
accountInfo: {
|
366
370
|
accountStatus: 'EFFECTIVE',
|
@@ -89,7 +89,9 @@ _defineProperty(LogComplianceExtendKeys, "complianceExtParams", {
|
|
89
89
|
// M 数字类型
|
90
90
|
timeCost: 'M',
|
91
91
|
pageLoadProgress: 'M',
|
92
|
-
fsDuration: 'M'
|
92
|
+
fsDuration: 'M',
|
93
|
+
// 由于部分logerror参数是msg
|
94
|
+
msg: 'C'
|
93
95
|
});
|
94
96
|
export var KEYS = {
|
95
97
|
EVENT_SDK_ON_ABNORMAL_EVENT_NAME: {
|