@alipay/ams-checkout 0.0.1730107332-dev.23 → 0.0.1730107332-dev.25
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/component/channel.d.ts +1 -1
- package/esm/component/channel.js +12 -19
- package/esm/component/component.popup.style.d.ts +1 -3
- package/esm/component/component.popup.style.js +1 -3
- package/esm/foundation/core/index.js +4 -2
- package/esm/foundation/service/security/index.js +4 -20
- package/package.json +1 -1
package/esm/component/channel.js
CHANGED
@@ -6,7 +6,7 @@ export function getChannelBehavior(paymentSessionMetaData) {
|
|
6
6
|
|
7
7
|
// EASYPAY
|
8
8
|
if ((paymentSessionMetaData === null || paymentSessionMetaData === void 0 || (_paymentSessionMetaDa = paymentSessionMetaData.paymentSessionConfig) === null || _paymentSessionMetaDa === void 0 ? void 0 : _paymentSessionMetaDa.productScene) === 'EASY_PAY') {
|
9
|
-
var _paymentSessionMetaDa2, _paymentSessionMetaDa3, _paymentSessionMetaDa4, _paymentSessionMetaDa6;
|
9
|
+
var _paymentSessionMetaDa2, _paymentSessionMetaDa3, _paymentSessionMetaDa4, _paymentSessionMetaDa6, _paymentSessionMetaDa8;
|
10
10
|
var amountConfirmRequired = (_paymentSessionMetaDa2 = paymentSessionMetaData.action) === null || _paymentSessionMetaDa2 === void 0 ? void 0 : _paymentSessionMetaDa2.amountConfirmRequired;
|
11
11
|
var isFirstTimeToPay = !((_paymentSessionMetaDa3 = paymentSessionMetaData.action) !== null && _paymentSessionMetaDa3 !== void 0 && _paymentSessionMetaDa3.autoDebitWithToken);
|
12
12
|
// EASYPAY 1.0
|
@@ -23,32 +23,19 @@ export function getChannelBehavior(paymentSessionMetaData) {
|
|
23
23
|
allowSubmitPayCallAhead = true;
|
24
24
|
}
|
25
25
|
} else if ((paymentSessionMetaData === null || paymentSessionMetaData === void 0 || (_paymentSessionMetaDa6 = paymentSessionMetaData.paymentSessionConfig) === null || _paymentSessionMetaDa6 === void 0 ? void 0 : _paymentSessionMetaDa6.productSceneVersion) === '2.0') {
|
26
|
-
var
|
26
|
+
var _paymentSessionMetaDa7;
|
27
27
|
if (isFirstTimeToPay) {
|
28
|
-
|
29
|
-
if (
|
30
|
-
// AlipayCN、TOSS
|
31
|
-
['ALIPAY_CN', 'BANKTRANSFER_QUICKPAY'].includes(paymentSessionMetaData === null || paymentSessionMetaData === void 0 || (_paymentSessionMetaDa7 = paymentSessionMetaData.paymentMethodInfoView) === null || _paymentSessionMetaDa7 === void 0 ? void 0 : _paymentSessionMetaDa7.paymentMethodType)) {
|
32
|
-
allowSubmitPayCallAhead = true;
|
33
|
-
} else {
|
34
|
-
allowSubmitPayCallAhead = false;
|
35
|
-
}
|
28
|
+
allowSubmitPayCallAhead = false;
|
36
29
|
} else {
|
37
30
|
if (amountConfirmRequired) {
|
38
|
-
|
39
|
-
// TOSS
|
40
|
-
if (['BANKTRANSFER_QUICKPAY'].includes(paymentSessionMetaData === null || paymentSessionMetaData === void 0 || (_paymentSessionMetaDa8 = paymentSessionMetaData.paymentMethodInfoView) === null || _paymentSessionMetaDa8 === void 0 ? void 0 : _paymentSessionMetaDa8.paymentMethodType)) {
|
41
|
-
allowSubmitPayCallAhead = true;
|
42
|
-
} else {
|
43
|
-
allowSubmitPayCallAhead = false;
|
44
|
-
}
|
31
|
+
allowSubmitPayCallAhead = false;
|
45
32
|
} else {
|
46
33
|
allowSubmitPayCallAhead = true;
|
47
34
|
}
|
48
35
|
}
|
49
36
|
|
50
37
|
// TOSS
|
51
|
-
if (['BANKTRANSFER_QUICKPAY'].includes(paymentSessionMetaData === null || paymentSessionMetaData === void 0 || (
|
38
|
+
if (['BANKTRANSFER_QUICKPAY'].includes(paymentSessionMetaData === null || paymentSessionMetaData === void 0 || (_paymentSessionMetaDa7 = paymentSessionMetaData.paymentMethodInfoView) === null || _paymentSessionMetaDa7 === void 0 ? void 0 : _paymentSessionMetaDa7.paymentMethodType)) {
|
52
39
|
allowClickOutsideClose = true;
|
53
40
|
buildSubmitPayExtParams = function buildSubmitPayExtParams(params) {
|
54
41
|
var callBackUrl = getDoubleFaUrl(params);
|
@@ -58,6 +45,11 @@ export function getChannelBehavior(paymentSessionMetaData) {
|
|
58
45
|
};
|
59
46
|
}
|
60
47
|
}
|
48
|
+
|
49
|
+
// AlipayCN、TOSS 任何场景都提前发 SubmitPay
|
50
|
+
if (['ALIPAY_CN', 'BANKTRANSFER_QUICKPAY'].includes(paymentSessionMetaData === null || paymentSessionMetaData === void 0 || (_paymentSessionMetaDa8 = paymentSessionMetaData.paymentMethodInfoView) === null || _paymentSessionMetaDa8 === void 0 ? void 0 : _paymentSessionMetaDa8.paymentMethodType)) {
|
51
|
+
allowSubmitPayCallAhead = true;
|
52
|
+
}
|
61
53
|
}
|
62
54
|
return {
|
63
55
|
allowSubmitPayCallAhead: allowSubmitPayCallAhead,
|
@@ -83,5 +75,6 @@ export function getDoubleFaUrl(params) {
|
|
83
75
|
prod: "https://ac.alipay.com/page/antom-web-checkout/src/component-app/doubleFA/index.".concat(sdkVersion, ".html")
|
84
76
|
};
|
85
77
|
var doubleFaBaseUrl = DOUBLE_FA_URL_MAPPING[env] || DOUBLE_FA_URL_MAPPING.prod;
|
86
|
-
|
78
|
+
var shortSessionData = paymentSessionData.split('&&').slice(0, 3).join('&&');
|
79
|
+
return "".concat(doubleFaBaseUrl, "?scene=cashierResultPage&instanceId=").concat(instanceId, "&paymentSessionData=").concat(encodeURIComponent(shortSessionData), "&isLandscape=").concat(isLandscapeOrientation ? 'true' : '', "&pmt=").concat(paymentMethodType, "&locale=").concat(locale, "&sdkVersion=").concat(sdkVersion);
|
87
80
|
}
|
@@ -19,7 +19,5 @@ export declare const createMockup: (options: {
|
|
19
19
|
export declare const hideMockup: () => void;
|
20
20
|
export declare const cleanMockup: () => void;
|
21
21
|
export declare const addPopupLoading: () => void;
|
22
|
-
export declare const handleDeclareInfo: (
|
23
|
-
closeDialogData: any;
|
24
|
-
}) => void;
|
22
|
+
export declare const handleDeclareInfo: (closeDialogData: any) => void;
|
25
23
|
export declare const slideInAndOutKeyframes: (id: any, height: any) => string;
|
@@ -139,9 +139,7 @@ export var addPopupLoading = function addPopupLoading() {
|
|
139
139
|
};
|
140
140
|
|
141
141
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
142
|
-
export var handleDeclareInfo = function handleDeclareInfo(
|
143
|
-
var _ref$closeDialogData = _ref.closeDialogData,
|
144
|
-
closeDialogData = _ref$closeDialogData === void 0 ? {} : _ref$closeDialogData;
|
142
|
+
export var handleDeclareInfo = function handleDeclareInfo(closeDialogData) {
|
145
143
|
try {
|
146
144
|
if (closeDialogData) {
|
147
145
|
var retentionTitle = document.getElementById("".concat(COMPONENT_RETENTION_ID, "-title"));
|
@@ -20,7 +20,7 @@ import { sdkVersion } from "../../config";
|
|
20
20
|
import { parseWebAppMatchConfig } from "../utils/web_app_url_utils";
|
21
21
|
import { redirect } from "../utils/redirect_utils";
|
22
22
|
import { insertStyleSheet } from "../../component/popupWindow.style";
|
23
|
-
import { hideMockup, createMockup, createRetentionPopup, hideRetentionPopup, showRetentionPopup, cleanMockup, removeRetentionPopup } from "../../component/component.popup.style";
|
23
|
+
import { hideMockup, createMockup, createRetentionPopup, hideRetentionPopup, showRetentionPopup, cleanMockup, removeRetentionPopup, handleDeclareInfo } from "../../component/component.popup.style";
|
24
24
|
import { EVENT, LOADING_ID } from "../../constant";
|
25
25
|
/**
|
26
26
|
* @author 谦彧 <zhangmian.zm@alipay.com>
|
@@ -296,7 +296,6 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
296
296
|
event: EVENT.close.name,
|
297
297
|
data: {}
|
298
298
|
});
|
299
|
-
// this.handleDeclarePopWindowCallback();
|
300
299
|
}
|
301
300
|
};
|
302
301
|
|
@@ -310,6 +309,9 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
310
309
|
}
|
311
310
|
_this2.paymentContext.displayInfo.isRetention = data;
|
312
311
|
});
|
312
|
+
eventCenter.listen(EVENT.declareCheckoutInfo.name, function (data) {
|
313
|
+
handleDeclareInfo(data === null || data === void 0 ? void 0 : data.closeDialogData);
|
314
|
+
});
|
313
315
|
var container = containerService.load(this.paymentContext.displayInfo, payload.url, closeBtnCallbackForPopup);
|
314
316
|
if (displayType === DisplayTypeEnum.inline) {
|
315
317
|
containerService.showLoading(container, this.paymentContext.displayInfo);
|
@@ -9,7 +9,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
9
9
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
10
10
|
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); }
|
11
11
|
import { ProductSceneEnum } from "../../../types";
|
12
|
-
import { Security,
|
12
|
+
import { Security, getSecurityConfigStorageKey, getSecurityHost, getSecurityScene } from "./security";
|
13
13
|
import { getOrSetStorageId, safeJson } from "../../../util";
|
14
14
|
import { ServiceProvider } from '..';
|
15
15
|
export var SecurityService = /*#__PURE__*/function () {
|
@@ -175,26 +175,10 @@ export var SecurityService = /*#__PURE__*/function () {
|
|
175
175
|
reject();
|
176
176
|
}, timeout);
|
177
177
|
}
|
178
|
-
|
179
|
-
|
180
|
-
region: isPre ? SecurityRegionEnum.SG : undefined
|
181
|
-
}, function () {
|
182
|
-
_this2.logger.logInfo({
|
183
|
-
title: "sdk_event_securitySdk".concat(sdkAction, "Success")
|
184
|
-
}, isPre ? {
|
185
|
-
product: _this2.productScene
|
186
|
-
} : undefined).send();
|
187
|
-
resolve();
|
188
|
-
}, function (msg) {
|
189
|
-
_this2.logger.logError({
|
190
|
-
title: 'sdk_error_securitySdkInitFailed',
|
191
|
-
msg: msg || undefined
|
192
|
-
}, {
|
193
|
-
product: _this2.productScene,
|
194
|
-
sign: isPre ? 'Active initialization' : 'SDK internal initialization'
|
195
|
-
}).send();
|
178
|
+
console.log('[web-sdk][security-sdk] mock init timeout');
|
179
|
+
setTimeout(function () {
|
196
180
|
reject();
|
197
|
-
});
|
181
|
+
}, 5000);
|
198
182
|
}));
|
199
183
|
case 7:
|
200
184
|
case "end":
|