@alipay/ams-checkout 2.0.21 → 2.0.23
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/ams-checkout.js +3 -3
- package/dist/ams-checkout.min.js +1 -1
- package/esm/config/index.js +1 -1
- package/esm/core/component/element/elementProcessor/paymentProcessor.js +7 -5
- package/esm/core/component/element/modernElementController/adapter.js +1 -0
- package/esm/core/component/element/modernElementController/index.d.ts +3 -1
- package/esm/core/component/element/modernElementController/index.js +474 -262
- package/esm/core/utils/connectConfig.d.ts +11 -0
- package/esm/core/utils/connectConfig.js +28 -0
- package/esm/foundation/service/event-center.js +12 -9
- package/esm/modern/index.js +1 -1
- package/esm/modern/tools.js +1 -1
- package/esm/plugin/component/channel.d.ts +1 -1
- package/esm/plugin/component/channel.js +11 -2
- package/esm/tsdoc-metadata.json +1 -1
- package/esm/util/logger.js +1 -1
- package/package.json +1 -1
- package/types.d.ts +79 -10
- package/types.untrimmed.d.ts +88 -9
package/esm/config/index.js
CHANGED
|
@@ -30,7 +30,7 @@ export var v2AppMarmotMap = {
|
|
|
30
30
|
light_sandbox: 'https://checkout.antom.com',
|
|
31
31
|
prod: 'https://checkout.antom.com'
|
|
32
32
|
};
|
|
33
|
-
export var sdkVersion = "2.0.
|
|
33
|
+
export var sdkVersion = "2.0.23";
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* @description: 目前应用层分为v1和v2,会存在两个应用版本号不是同步发布的情况。所以需要把默认的应用版本号配置抽离出来。
|
|
@@ -36,6 +36,7 @@ import { convertPaymentMethods } from "../elementProcessor/convertPaymentMethods
|
|
|
36
36
|
import { generateIframeSrc as _generateIframeSrc, isElementPad, isElementPC, safeParse, safeStringify } from "../util";
|
|
37
37
|
import BaseElementProcessor from "./baseElementProcessor";
|
|
38
38
|
import { executeWithTimeout, BEFORE_CONFIRM_TIMEOUT_MS } from "../../../../util/beforeConfirm";
|
|
39
|
+
import { shouldQueryOneAccount } from "../../../utils/connectConfig";
|
|
39
40
|
var logger = new Logger(LogConfig, true);
|
|
40
41
|
var isExpressCheckout = function isExpressCheckout(extendInfo) {
|
|
41
42
|
try {
|
|
@@ -421,7 +422,7 @@ var PaymentProcessor = /*#__PURE__*/function (_BaseElementProcessor) {
|
|
|
421
422
|
var _paymentSessionObj$co,
|
|
422
423
|
_this$options5,
|
|
423
424
|
_this3 = this;
|
|
424
|
-
var requestService, _this$elementContaine7, paymentSession, paymentSessionObj, displayInfo, _displayInfo, debugProps, _this$options4, environment, locale, _ref6, paymentSessionConfig, hostSign, isConnect, LOCAL_MOCK, previewMode, IS_PREVIEW, SHOULD_USE_MOCK, _queryParse, appType, terminalType, generateActionQueryPromise, generateOneAccountQueryPromise, _yield$Promise$all, _yield$Promise$all2, originActionQueryResult, originOneAccountQueryResult;
|
|
425
|
+
var requestService, _this$elementContaine7, paymentSession, paymentSessionObj, displayInfo, _displayInfo, debugProps, _this$options4, environment, locale, _ref6, paymentSessionConfig, hostSign, isConnect, shouldQueryOneAccountFlag, LOCAL_MOCK, previewMode, IS_PREVIEW, SHOULD_USE_MOCK, _queryParse, appType, terminalType, generateActionQueryPromise, generateOneAccountQueryPromise, _yield$Promise$all, _yield$Promise$all2, originActionQueryResult, originOneAccountQueryResult;
|
|
425
426
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
426
427
|
while (1) switch (_context3.prev = _context3.next) {
|
|
427
428
|
case 0:
|
|
@@ -433,6 +434,7 @@ var PaymentProcessor = /*#__PURE__*/function (_BaseElementProcessor) {
|
|
|
433
434
|
_ref6 = paymentSessionObj || {}, paymentSessionConfig = _ref6.paymentSessionConfig;
|
|
434
435
|
hostSign = paymentSession.split('&&')[1] || '';
|
|
435
436
|
isConnect = paymentSessionObj === null || paymentSessionObj === void 0 || (_paymentSessionObj$co = paymentSessionObj.connectFactor) === null || _paymentSessionObj$co === void 0 ? void 0 : _paymentSessionObj$co.enableConnect;
|
|
437
|
+
shouldQueryOneAccountFlag = shouldQueryOneAccount(isConnect, paymentSessionObj === null || paymentSessionObj === void 0 ? void 0 : paymentSessionObj.extendInfo);
|
|
436
438
|
LOCAL_MOCK = (debugProps === null || debugProps === void 0 ? void 0 : debugProps.isDebug) && (debugProps === null || debugProps === void 0 ? void 0 : debugProps.local_mock); // 兼容三种预览开关取值:true / 'web' / 'mobile'
|
|
437
439
|
previewMode = (_this$options5 = this.options) === null || _this$options5 === void 0 ? void 0 : _this$options5.preview;
|
|
438
440
|
IS_PREVIEW = previewMode === true || previewMode === 'web' || previewMode === 'mobile';
|
|
@@ -579,9 +581,9 @@ var PaymentProcessor = /*#__PURE__*/function (_BaseElementProcessor) {
|
|
|
579
581
|
});
|
|
580
582
|
});
|
|
581
583
|
};
|
|
582
|
-
_context3.next =
|
|
583
|
-
return Promise.all(
|
|
584
|
-
case
|
|
584
|
+
_context3.next = 19;
|
|
585
|
+
return Promise.all(shouldQueryOneAccountFlag ? [generateActionQueryPromise(), generateOneAccountQueryPromise()] : [generateActionQueryPromise()]);
|
|
586
|
+
case 19:
|
|
585
587
|
_yield$Promise$all = _context3.sent;
|
|
586
588
|
_yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
|
|
587
589
|
originActionQueryResult = _yield$Promise$all2[0];
|
|
@@ -594,7 +596,7 @@ var PaymentProcessor = /*#__PURE__*/function (_BaseElementProcessor) {
|
|
|
594
596
|
originActionQueryResult: originActionQueryResult,
|
|
595
597
|
originOneAccountQueryResult: originOneAccountQueryResult
|
|
596
598
|
});
|
|
597
|
-
case
|
|
599
|
+
case 25:
|
|
598
600
|
case "end":
|
|
599
601
|
return _context3.stop();
|
|
600
602
|
}
|
|
@@ -11,6 +11,7 @@ export function adaptSubmitResult(result) {
|
|
|
11
11
|
error: result.error ? {
|
|
12
12
|
code: result.error.code,
|
|
13
13
|
message: result.error.message,
|
|
14
|
+
traceId: result.error.traceId,
|
|
14
15
|
needChangeSessionForRetry: result.error.needChangeSessionForRetry
|
|
15
16
|
} : undefined,
|
|
16
17
|
userCanceled3D: result.userCanceled3D,
|
|
@@ -28,7 +28,6 @@ export declare class ModernElementController implements IElementController {
|
|
|
28
28
|
private modalBridge;
|
|
29
29
|
private modalDestroy;
|
|
30
30
|
private modalIframe;
|
|
31
|
-
private _closeConfirmResolve;
|
|
32
31
|
private notRedirectAfterComplete;
|
|
33
32
|
private _sdkInitTime;
|
|
34
33
|
private _mountStartTime;
|
|
@@ -43,6 +42,7 @@ export declare class ModernElementController implements IElementController {
|
|
|
43
42
|
private isSubmitting;
|
|
44
43
|
constructor({ onStatusChange, ...options }: ModernElementControllerOptions);
|
|
45
44
|
mount(renderOptions: PaymentMountOptions, sdkSelector: string): Promise<ICommonApiResponse>;
|
|
45
|
+
private doMount;
|
|
46
46
|
/**
|
|
47
47
|
* setup() — 解析 sessionData 获取 metaData,发起 sdkQuery 获取渲染数据,准备 HANDSHAKE 配置
|
|
48
48
|
*
|
|
@@ -116,9 +116,11 @@ export declare class ModernElementController implements IElementController {
|
|
|
116
116
|
*/
|
|
117
117
|
private waitForHandshakeAck;
|
|
118
118
|
submitPayment(params: SubmitFuncParams): Promise<IPaymentApiResponse>;
|
|
119
|
+
private doSubmitPayment;
|
|
119
120
|
validateFields(): Promise<{
|
|
120
121
|
isValid: boolean;
|
|
121
122
|
}>;
|
|
123
|
+
private doValidateFields;
|
|
122
124
|
updatePayment(paymentSessionData: string): Promise<boolean>;
|
|
123
125
|
on<T extends EVENTNAME>(event: T, callback: (data: EventDataMap[T]) => void): void;
|
|
124
126
|
destroy(): void;
|