@alipay/ams-checkout 0.0.1766664288-dev.2 → 0.0.1766664288-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.
|
@@ -23,8 +23,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
23
23
|
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; }
|
|
24
24
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
25
25
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
26
|
-
import {
|
|
27
|
-
import { ELEMENT_SPM_MAP } from "../../../../util/spm-map";
|
|
26
|
+
import { productEventScenarios, ProductScene } from "../config";
|
|
28
27
|
import { cleanMockup, removeRetentionPopup } from "../../../../component/component.popup.style";
|
|
29
28
|
import { destroyModal } from "../../../../component/popupWindow.style";
|
|
30
29
|
import { ERRORMESSAGE, EVENT, PROMISE_CALLBACK_CODE } from "../../../../constant";
|
|
@@ -34,15 +33,16 @@ import PaymentProcessor from "../../../../core/component/element/elementProcesso
|
|
|
34
33
|
import { IElementStatus } from "../../../../foundation";
|
|
35
34
|
import { AntomSDKCore } from "../../../../foundation/core";
|
|
36
35
|
import { ElementProcessor } from "../../../../foundation/product-processor/element";
|
|
36
|
+
import { ServiceProvider } from "../../../../foundation/service";
|
|
37
|
+
import { convertPaymentSession } from "../../../../foundation/utils/payment_context_utils";
|
|
37
38
|
import { ProductSceneEnum } from "../../../../types";
|
|
39
|
+
import { ELEMENT_SPM_MAP } from "../../../../util/spm-map";
|
|
38
40
|
import { ElementContainerService } from "../elementContainerService"; // 引入 ElementContainerService
|
|
39
41
|
import { IContainerStatus } from "../elementContainerService/containerService";
|
|
40
42
|
import { EventCenter as ElementEventCenter } from "../EventCenter/index";
|
|
41
43
|
import { oneAccountUpdate, sdkActionUpdate } from "../mock";
|
|
42
44
|
import { ElementPaymentEvent, ElementPaymentMethod, ElementType, EventCallbackCode, EXPOSURE_API_EVENT, MountElementType, PaymentStatus } from "../type";
|
|
43
45
|
import { checkCanMount, checkCanUpdate, handleRedirect, isLoadErrorPage, safeParse, safeStringify, showToast } from "../util";
|
|
44
|
-
import { convertPaymentSession } from "../../../../foundation/utils/payment_context_utils";
|
|
45
|
-
import { productEventScenarios, ProductScene } from "../config";
|
|
46
46
|
var TIMEOUT_DURATION = 10000;
|
|
47
47
|
var ElementController = /*#__PURE__*/function () {
|
|
48
48
|
function ElementController(options) {
|
|
@@ -446,24 +446,25 @@ var ElementController = /*#__PURE__*/function () {
|
|
|
446
446
|
return _context3.abrupt("return");
|
|
447
447
|
case 14:
|
|
448
448
|
if (!_this3.elementProcessors[ElementType.payment]) {
|
|
449
|
-
_context3.next =
|
|
449
|
+
_context3.next = 21;
|
|
450
450
|
break;
|
|
451
451
|
}
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
452
|
+
_context3.next = 17;
|
|
453
|
+
return _this3.onValidateAndSubmitPay(_this3.elementProcessors[ElementType.payment].eventCenter, ElementPaymentMethod.PAYMENT_ELEMENT, _objectSpread(_objectSpread({}, params), {}, {
|
|
454
|
+
handleActions: (_submitParams$handleA = submitParams === null || submitParams === void 0 ? void 0 : submitParams.handleActions) !== null && _submitParams$handleA !== void 0 ? _submitParams$handleA : true
|
|
455
|
+
}));
|
|
456
|
+
case 17:
|
|
456
457
|
_yield$_this3$onValid2 = _context3.sent;
|
|
457
458
|
_data = _yield$_this3$onValid2.data;
|
|
458
459
|
// TODO 先快速修复类型, 这里结构和标准返回不一致 @马杰
|
|
459
460
|
// TODO checkout 返回的错误未包含 status 和 message @马杰 @薛浩
|
|
460
461
|
recordResult = _data;
|
|
461
462
|
recordResultCallback(recordResult);
|
|
462
|
-
case
|
|
463
|
-
_context3.next =
|
|
463
|
+
case 21:
|
|
464
|
+
_context3.next = 29;
|
|
464
465
|
break;
|
|
465
|
-
case
|
|
466
|
-
_context3.prev =
|
|
466
|
+
case 23:
|
|
467
|
+
_context3.prev = 23;
|
|
467
468
|
_context3.t0 = _context3["catch"](2);
|
|
468
469
|
errorResult = {
|
|
469
470
|
error: _objectSpread(_objectSpread({}, ERRORMESSAGE.ERR_DATA_STRUCT_UNRECOGNIZED), {}, {
|
|
@@ -478,11 +479,11 @@ var ElementController = /*#__PURE__*/function () {
|
|
|
478
479
|
});
|
|
479
480
|
recordResult = errorResult;
|
|
480
481
|
recordResultCallback(errorResult);
|
|
481
|
-
case
|
|
482
|
+
case 29:
|
|
482
483
|
case "end":
|
|
483
484
|
return _context3.stop();
|
|
484
485
|
}
|
|
485
|
-
}, _callee3, null, [[2,
|
|
486
|
+
}, _callee3, null, [[2, 23]]);
|
|
486
487
|
}));
|
|
487
488
|
return function (_x2) {
|
|
488
489
|
return _ref3.apply(this, arguments);
|
|
@@ -261,20 +261,12 @@ export interface AddressSubmitData {
|
|
|
261
261
|
shippingId: string;
|
|
262
262
|
actionFlag?: 'I' | 'U' | 'D';
|
|
263
263
|
}
|
|
264
|
-
export interface HandleAction {
|
|
265
|
-
threeD?: boolean;
|
|
266
|
-
callApp?: boolean;
|
|
267
|
-
pageRedirect?: boolean;
|
|
268
|
-
qrCode?: boolean;
|
|
269
|
-
}
|
|
270
|
-
export type HandleActionType = boolean | HandleAction;
|
|
271
264
|
export interface SubmitFuncParams {
|
|
272
|
-
|
|
265
|
+
handleActions?: boolean;
|
|
273
266
|
}
|
|
274
267
|
export interface SubmitServiceParams extends PaymentSubmitData {
|
|
275
268
|
accountInfo: AuthSubmitData['accountInfo'];
|
|
276
269
|
shipping?: AddressSubmitData;
|
|
277
|
-
handleAction?: HandleActionType;
|
|
278
270
|
}
|
|
279
271
|
interface SubmitResultActionForm extends ActionForm {
|
|
280
272
|
paymentCodeExpireTime: string;
|