@alipay/ams-checkout 0.0.1755258862-dev.7 → 0.0.1756796178-dev.0
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 +3 -1
- package/esm/component/channel.js +26 -62
- package/esm/component/component.inline.style.js +2 -2
- package/esm/component/popupWindow.style.d.ts +4 -1
- package/esm/component/popupWindow.style.js +37 -2
- package/esm/config/index.d.ts +8 -8
- package/esm/config/index.js +8 -8
- package/esm/constant/easysafepay.d.ts +16 -0
- package/esm/constant/easysafepay.js +19 -0
- package/esm/constant/index.d.ts +41 -2
- package/esm/constant/index.js +43 -5
- package/esm/core/component/ckp/index.d.ts +2 -0
- package/esm/core/component/ckp/index.js +41 -5
- package/esm/core/component/element/elementContainerService/containerService.d.ts +33 -0
- package/esm/core/component/element/elementContainerService/containerService.js +123 -0
- package/esm/core/component/element/elementContainerService/index.d.ts +20 -0
- package/esm/core/component/element/elementContainerService/index.js +63 -0
- package/esm/core/component/element/elementController/index.d.ts +27 -0
- package/esm/core/component/element/elementController/index.js +493 -0
- package/esm/core/component/element/elementProcessor/addressProcessor.d.ts +20 -0
- package/esm/core/component/element/elementProcessor/addressProcessor.js +160 -0
- package/esm/core/component/element/elementProcessor/authProcessor.d.ts +20 -0
- package/esm/core/component/element/elementProcessor/authProcessor.js +125 -0
- package/esm/core/component/element/elementProcessor/baseElementProcessor.d.ts +41 -0
- package/esm/core/component/element/elementProcessor/baseElementProcessor.js +96 -0
- package/esm/core/component/element/elementProcessor/paymentProcessor.d.ts +20 -0
- package/esm/core/component/element/elementProcessor/paymentProcessor.js +380 -0
- package/esm/core/component/element/index.d.ts +7 -46
- package/esm/core/component/element/index.js +31 -923
- package/esm/core/component/element/mock.d.ts +4 -0
- package/esm/core/component/element/mock.js +365 -1
- package/esm/core/component/element/type.d.ts +74 -34
- package/esm/core/component/element/type.js +20 -12
- package/esm/core/component/element/util.d.ts +69 -0
- package/esm/core/component/element/util.js +477 -0
- package/esm/core/component/index.d.ts +5 -1
- package/esm/core/component/index.js +1 -2
- package/esm/core/component/oldElement/index.d.ts +59 -0
- package/esm/core/component/oldElement/index.js +956 -0
- package/esm/core/component/oldElement/mock.d.ts +6 -0
- package/esm/core/component/oldElement/mock.js +567 -0
- package/esm/core/component/oldElement/type.d.ts +354 -0
- package/esm/core/component/oldElement/type.js +81 -0
- package/esm/core/instance/index.d.ts +1 -1
- package/esm/core/instance/index.js +1 -1
- package/esm/foundation/core/index.d.ts +9 -1
- package/esm/foundation/core/index.js +153 -53
- package/esm/foundation/index.d.ts +20 -0
- package/esm/foundation/index.js +13 -2
- package/esm/foundation/product-processor/autoDebit/deps.d.ts +14 -0
- package/esm/foundation/product-processor/autoDebit/deps.js +12 -0
- package/esm/foundation/product-processor/autoDebit/index.d.ts +48 -0
- package/esm/foundation/product-processor/autoDebit/index.js +466 -0
- package/esm/foundation/product-processor/easysafepay/deps.d.ts +3 -1
- package/esm/foundation/product-processor/easysafepay/deps.js +3 -1
- package/esm/foundation/product-processor/easysafepay/index.d.ts +5 -0
- package/esm/foundation/product-processor/easysafepay/index.js +271 -169
- package/esm/foundation/product-processor/element/index.d.ts +7 -0
- package/esm/foundation/product-processor/element/index.js +24 -0
- package/esm/foundation/service/container/index.d.ts +14 -3
- package/esm/foundation/service/container/index.js +178 -25
- package/esm/foundation/service/container/popup.d.ts +10 -7
- package/esm/foundation/service/container/popup.js +3 -1
- package/esm/foundation/service/event-center.js +1 -0
- package/esm/foundation/service/log/keys.js +3 -1
- package/esm/foundation/service/log/types.d.ts +1 -0
- package/esm/foundation/service/requester/requester.js +20 -109
- package/esm/foundation/utils/preload_helper.d.ts +2 -2
- package/esm/foundation/utils/preload_helper.js +8 -6
- package/esm/foundation/utils/redirect_utils.js +34 -18
- package/esm/foundation/utils/web_app_url_utils.d.ts +71 -1
- package/esm/foundation/utils/web_app_url_utils.js +219 -8
- package/esm/index.d.ts +8 -5
- package/esm/index.js +103 -53
- package/esm/plugin/component/cashierApp.d.ts +1 -1
- package/esm/plugin/component/cashierApp.js +5 -5
- package/esm/plugin/component/channel.d.ts +3 -1
- package/esm/plugin/component/channel.js +10 -12
- package/esm/plugin/component/index.js +49 -45
- package/esm/plugin/type.d.ts +1 -1
- package/esm/request/index.js +2 -2
- package/esm/types/index.d.ts +37 -3
- package/esm/types/index.js +10 -2
- package/esm/util/index.d.ts +12 -1
- package/esm/util/index.js +39 -3
- package/esm/util/redirect.d.ts +6 -0
- package/esm/util/redirect.js +54 -0
- package/esm/util/spm-map.d.ts +18 -4
- package/esm/util/spm-map.js +20 -6
- package/package.json +27 -4
- /package/esm/core/component/{element → oldElement}/components/address.d.ts +0 -0
- /package/esm/core/component/{element → oldElement}/components/address.js +0 -0
- /package/esm/core/component/{element → oldElement}/components/auth.d.ts +0 -0
- /package/esm/core/component/{element → oldElement}/components/auth.js +0 -0
- /package/esm/core/component/{element → oldElement}/components/payment.d.ts +0 -0
- /package/esm/core/component/{element → oldElement}/components/payment.js +0 -0
- /package/esm/core/component/{element → oldElement}/utils.d.ts +0 -0
- /package/esm/core/component/{element → oldElement}/utils.js +0 -0
@@ -11,12 +11,14 @@ export type IChannelBehavior = {
|
|
11
11
|
type GetDoubleFaParams = {
|
12
12
|
instanceId: string;
|
13
13
|
paymentSessionData: string;
|
14
|
+
paymentSessionObj: IPaymentSessionMetaData;
|
14
15
|
locale: string;
|
15
16
|
paymentMethodType: string;
|
16
17
|
env: string;
|
17
18
|
sdkVersion: string;
|
19
|
+
notRedirectAfterComplete: boolean;
|
18
20
|
};
|
19
|
-
export declare function getChannelBehavior(paymentSessionMetaData?: IPaymentSessionMetaData): IChannelBehavior | undefined;
|
21
|
+
export declare function getChannelBehavior(paymentSessionMetaData?: IPaymentSessionMetaData, notRedirectAfterComplete?: boolean): IChannelBehavior | undefined;
|
20
22
|
export declare function getDoubleFaUrl(params: GetDoubleFaParams): string;
|
21
23
|
export declare const handleGooglePay: (data: EventPayload) => Promise<unknown>;
|
22
24
|
export declare class ApplePaySdk {
|
@@ -14,6 +14,8 @@ import { getApplePayPaymentSession, submitPayInfo } from "../../service";
|
|
14
14
|
import { EnvironmentEnum } from "../../types";
|
15
15
|
import { device, isEmpty } from "../../util";
|
16
16
|
import { APPLE_PAY_RECURRING_VERSION, APPLE_PAY_VERSION } from "../applepay/interface";
|
17
|
+
import { getDoubleFaUrlFromSession } from "../../foundation/utils/web_app_url_utils";
|
18
|
+
import { MODE } from "../../constant/easysafepay";
|
17
19
|
var APPLEPAYERRORENUM = /*#__PURE__*/function (APPLEPAYERRORENUM) {
|
18
20
|
APPLEPAYERRORENUM["APPLE_PAY_MISSING_DATA"] = "APPLE_PAY_MISSING_DATA";
|
19
21
|
APPLEPAYERRORENUM["APPLE_PAY_NOT_SUPPORTED"] = "APPLE_PAY_NOT_SUPPORTED";
|
@@ -27,7 +29,7 @@ var PAYMENT_STATUS = /*#__PURE__*/function (PAYMENT_STATUS) {
|
|
27
29
|
PAYMENT_STATUS["NORMAL"] = "NORMAL";
|
28
30
|
return PAYMENT_STATUS;
|
29
31
|
}(PAYMENT_STATUS || {});
|
30
|
-
export function getChannelBehavior(paymentSessionMetaData) {
|
32
|
+
export function getChannelBehavior(paymentSessionMetaData, notRedirectAfterComplete) {
|
31
33
|
var _paymentSessionMetaDa, _paymentSessionMetaDa2, _paymentSessionMetaDa3, _paymentSessionMetaDa4, _paymentSessionMetaDa5, _paymentSessionMetaDa6, _paymentSessionMetaDa7, _paymentSessionMetaDa8;
|
32
34
|
// TOSS EASYPAY 2.0
|
33
35
|
if ('BANKTRANSFER_QUICKPAY' === (paymentSessionMetaData === null || paymentSessionMetaData === void 0 || (_paymentSessionMetaDa = paymentSessionMetaData.paymentMethodInfoView) === null || _paymentSessionMetaDa === void 0 ? void 0 : _paymentSessionMetaDa.paymentMethodType) && (paymentSessionMetaData === null || paymentSessionMetaData === void 0 || (_paymentSessionMetaDa2 = paymentSessionMetaData.paymentSessionConfig) === null || _paymentSessionMetaDa2 === void 0 ? void 0 : _paymentSessionMetaDa2.productScene) === 'EASY_PAY' && (paymentSessionMetaData === null || paymentSessionMetaData === void 0 || (_paymentSessionMetaDa3 = paymentSessionMetaData.paymentSessionConfig) === null || _paymentSessionMetaDa3 === void 0 ? void 0 : _paymentSessionMetaDa3.paymentMethodCategoryType) === 'APM' && (paymentSessionMetaData === null || paymentSessionMetaData === void 0 || (_paymentSessionMetaDa4 = paymentSessionMetaData.paymentSessionConfig) === null || _paymentSessionMetaDa4 === void 0 ? void 0 : _paymentSessionMetaDa4.productSceneVersion) === '2.0') {
|
@@ -40,7 +42,8 @@ export function getChannelBehavior(paymentSessionMetaData) {
|
|
40
42
|
buildSubmitPayExtParams: function buildSubmitPayExtParams(params) {
|
41
43
|
var callBackUrl = getDoubleFaUrl(params);
|
42
44
|
return {
|
43
|
-
callBackUrl: callBackUrl
|
45
|
+
callBackUrl: callBackUrl,
|
46
|
+
notRedirectAfterComplete: notRedirectAfterComplete === true
|
44
47
|
};
|
45
48
|
}
|
46
49
|
};
|
@@ -65,20 +68,15 @@ export function getDoubleFaUrl(params) {
|
|
65
68
|
var instanceId = params.instanceId,
|
66
69
|
paymentMethodType = params.paymentMethodType,
|
67
70
|
paymentSessionData = params.paymentSessionData,
|
71
|
+
paymentSessionObj = params.paymentSessionObj,
|
68
72
|
locale = params.locale,
|
69
73
|
env = params.env,
|
70
|
-
sdkVersion = params.sdkVersion
|
74
|
+
sdkVersion = params.sdkVersion,
|
75
|
+
notRedirectAfterComplete = params.notRedirectAfterComplete;
|
71
76
|
var isLandscapeOrientation = false; // Web 不含横屏
|
72
77
|
|
73
|
-
var
|
74
|
-
|
75
|
-
dev: "http://page.alipay.net/page/antom-web-checkout/src/component-app/doubleFA/index.".concat(sdkVersion, ".html"),
|
76
|
-
sit: "http://page.test.alipay.net/page/antom-web-checkout/src/component-app/doubleFA/index.".concat(sdkVersion, ".html"),
|
77
|
-
pre: "https://pre.ac.alipay.com/page/antom-web-checkout/src/component-app/doubleFA/index.".concat(sdkVersion, ".html"),
|
78
|
-
prod: "https://ac.alipay.com/page/antom-web-checkout/src/component-app/doubleFA/index.".concat(sdkVersion, ".html")
|
79
|
-
};
|
80
|
-
var doubleFaBaseUrl = DOUBLE_FA_URL_MAPPING[env] || DOUBLE_FA_URL_MAPPING.prod;
|
81
|
-
return "".concat(doubleFaBaseUrl, "?scene=cashierResultPage&instanceId=").concat(instanceId, "&paymentSessionData=").concat(encodeURIComponent(paymentSessionData), "&isLandscape=").concat(isLandscapeOrientation ? 'true' : '', "&pmt=").concat(paymentMethodType, "&locale=").concat(locale, "&sdkVersion=").concat(sdkVersion);
|
78
|
+
var baseDoubleFaUrl = getDoubleFaUrlFromSession(paymentSessionObj, env);
|
79
|
+
return "".concat(baseDoubleFaUrl) + '?' + "scene=cashierResultPage" + '&' + "instanceId=".concat(instanceId) + '&' + "paymentSessionData=".concat(encodeURIComponent(paymentSessionData)) + '&' + "isLandscape=".concat(isLandscapeOrientation ? 'true' : '') + '&' + "pmt=".concat(paymentMethodType) + '&' + "locale=".concat(locale) + '&' + "mode=".concat(MODE.SDK) + '&' + "sdkVersion=".concat(sdkVersion) + '&' + "¬RedirectAfterComplete=".concat(notRedirectAfterComplete);
|
82
80
|
}
|
83
81
|
export var handleGooglePay = function handleGooglePay(data) {
|
84
82
|
return new Promise(function (resolve, reject) {
|
@@ -20,10 +20,10 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
20
20
|
import { v4 as uuid } from 'uuid';
|
21
21
|
import { sdkVersion } from "../../config";
|
22
22
|
import { COMPONENTPLUGINID, COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CLOSE_MASK_BLOCK_ID, COMPONENT_CONTAINER_ID, COMPONENT_RETENTION_ID, COMPONENT_SECTION_ID, ERRORMESSAGE, EVENT, LISTENER_PREFIX, LOADING_ID, LOADTIME_LIMIT, MOCKUP_ID, POPUP_LOADTIME_LOG_LIMIT, TIMEOUT_WEB_APP_HEART_BEAT, TIME_DELAY_SEND_HEART_BEAT } from "../../constant";
|
23
|
+
import { ElementPaymentMethod } from "../../core/component/oldElement/type";
|
23
24
|
import { queryPaymentInfo, submitPayInfo } from "../../service";
|
24
25
|
import { ComponentSignEnum, DisplayTypeEnum, eventCodeEnum, MessageName, PlatformEnum, ProductSceneEnum, RedirectType, TargetEnum } from "../../types";
|
25
26
|
import { getType, isJsonString, isPC } from "../../util";
|
26
|
-
import { ElementPaymentMethod } from "../../core/component/element/type";
|
27
27
|
import { getBackScheme } from "../../util/getBackScheme";
|
28
28
|
import { isLocalMock } from "../../util/mock";
|
29
29
|
import { matchVersion } from "../../util/versionCompare";
|
@@ -261,7 +261,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
261
261
|
_this$_renderParams6,
|
262
262
|
_this$_renderParams7,
|
263
263
|
_this$_renderParams8,
|
264
|
-
_this$
|
264
|
+
_this$_renderParams12,
|
265
265
|
_this3 = this;
|
266
266
|
if (this._isInitComponent) {
|
267
267
|
this.dispatchToSDK(EVENT.error.name, ERRORMESSAGE.CREATECOMPONENT_ERROR.SINGLETON_COMPONENT_ERROR);
|
@@ -350,10 +350,10 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
350
350
|
insertStyleSheet();
|
351
351
|
}
|
352
352
|
if (this._renderDisplayType === DisplayTypeEnum.popup) {
|
353
|
-
var _this$_renderParams10;
|
353
|
+
var _this$_renderParams10, _this$_renderParams11;
|
354
354
|
createBaseElement(this.platform, this.closeBtnFunc.bind(this));
|
355
355
|
createRetentionPopup(this.platform, this.hideRetentionPopupFunc.bind(this), this.retentionPopupLeaveFunc.bind(this));
|
356
|
-
var channelBehavior = getChannelBehavior((_this$_renderParams10 = this._renderParams) === null || _this$_renderParams10 === void 0 ? void 0 : _this$_renderParams10.paymentSessionMetaData);
|
356
|
+
var channelBehavior = getChannelBehavior((_this$_renderParams10 = this._renderParams) === null || _this$_renderParams10 === void 0 ? void 0 : _this$_renderParams10.paymentSessionMetaData, ((_this$_renderParams11 = this._renderParams) === null || _this$_renderParams11 === void 0 ? void 0 : _this$_renderParams11.notRedirectAfterComplete) === true);
|
357
357
|
var onClickOutside = function onClickOutside() {};
|
358
358
|
if (channelBehavior !== null && channelBehavior !== void 0 && channelBehavior.allowClickOutsideClose) {
|
359
359
|
onClickOutside = this.closeBtnFunc.bind(this);
|
@@ -367,7 +367,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
367
367
|
this.renderPopupLoading(renderParams);
|
368
368
|
}
|
369
369
|
this.createApp(renderParams);
|
370
|
-
if ((_this$
|
370
|
+
if ((_this$_renderParams12 = this._renderParams) !== null && _this$_renderParams12 !== void 0 && (_this$_renderParams12 = _this$_renderParams12.paymentSessionMetaData) !== null && _this$_renderParams12 !== void 0 && (_this$_renderParams12 = _this$_renderParams12.connectFactor) !== null && _this$_renderParams12 !== void 0 && _this$_renderParams12.enableConnect) {
|
371
371
|
this._createLoadAppPromise();
|
372
372
|
return this.createIframeNode(this, insertedNode, this._renderDisplayType).then(function () {
|
373
373
|
return Promise.resolve();
|
@@ -408,7 +408,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
408
408
|
}, {
|
409
409
|
key: "renderInlineLoading",
|
410
410
|
value: function renderInlineLoading(renderParams, selector) {
|
411
|
-
var _renderParams$appeara, _this$
|
411
|
+
var _renderParams$appeara, _this$_renderParams13;
|
412
412
|
var showLoading = renderParams === null || renderParams === void 0 || (_renderParams$appeara = renderParams.appearance) === null || _renderParams$appeara === void 0 ? void 0 : _renderParams$appeara.showLoading;
|
413
413
|
showLoading = typeof showLoading === 'boolean' ? showLoading : true;
|
414
414
|
var extendInfo = renderParams.paymentSessionMetaData.extendInfo;
|
@@ -421,7 +421,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
421
421
|
}
|
422
422
|
if (showLoading) addInlineLoading(selector, this.platform, {
|
423
423
|
componentSign: this._componentSign,
|
424
|
-
type: (_this$
|
424
|
+
type: (_this$_renderParams13 = this._renderParams) === null || _this$_renderParams13 === void 0 || (_this$_renderParams13 = _this$_renderParams13.appearance) === null || _this$_renderParams13 === void 0 || (_this$_renderParams13 = _this$_renderParams13.layout) === null || _this$_renderParams13 === void 0 ? void 0 : _this$_renderParams13.type,
|
425
425
|
isExpressCheckout: isExpressCheckout
|
426
426
|
});
|
427
427
|
}
|
@@ -447,6 +447,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
447
447
|
}, loadTimeLimit !== null && loadTimeLimit !== void 0 ? loadTimeLimit : LOADTIME_LIMIT);
|
448
448
|
}).catch(function (error) {
|
449
449
|
_this4.dispatchToSDK(EVENT.error.name, ERRORMESSAGE.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT);
|
450
|
+
_this4.dispatchToSDK(EVENT.eventCallback.name, ERRORMESSAGE.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT);
|
450
451
|
_this4.AMSSDK.logger.logError({
|
451
452
|
title: 'sdk_error_web_app_timeout'
|
452
453
|
}).send();
|
@@ -468,8 +469,8 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
468
469
|
// eslint-disable-next-line no-async-promise-executor
|
469
470
|
this._actionQueryPromise = new Promise( /*#__PURE__*/function () {
|
470
471
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(resolve, reject) {
|
471
|
-
var _this5$_renderParams, _this5$_renderParams2, _this5$_renderParams3, _this5$_renderParams4, _this5$_renderParams5, _this5$_renderParams6, _this5$_renderParams7;
|
472
|
-
var envInfo, params, _ref6, _ref6$extendInfo, extendInfo, actionData, enableVaultingApiOptimize, enableEasypayApiOptimize, _ref7, skipSdkQuery, skipSdkQueryForm, extendInfoData, ifSkip, channelBehavior, _this5$
|
472
|
+
var _this5$_renderParams, _this5$_renderParams2, _this5$_renderParams3, _this5$_renderParams4, _this5$_renderParams5, _this5$_renderParams6, _this5$_renderParams7, _this5$_renderParams8;
|
473
|
+
var envInfo, params, _ref6, _ref6$extendInfo, extendInfo, actionData, enableVaultingApiOptimize, enableEasypayApiOptimize, _ref7, skipSdkQuery, skipSdkQueryForm, extendInfoData, ifSkip, channelBehavior, _this5$_renderParams9, _ref8, _ref8$productSceneVer, productSceneVersion, _ref8$productScene, productScene, _this5$_renderParams10, _action$web2, _action$wap2, action, signType;
|
473
474
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
474
475
|
while (1) switch (_context2.prev = _context2.next) {
|
475
476
|
case 0:
|
@@ -563,7 +564,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
563
564
|
});
|
564
565
|
return _context2.abrupt("return");
|
565
566
|
case 26:
|
566
|
-
channelBehavior = getChannelBehavior((_this5$_renderParams7 = _this5._renderParams) === null || _this5$_renderParams7 === void 0 ? void 0 : _this5$_renderParams7.paymentSessionMetaData); // Easypay TOSS 渠道无需actionQuery
|
567
|
+
channelBehavior = getChannelBehavior((_this5$_renderParams7 = _this5._renderParams) === null || _this5$_renderParams7 === void 0 ? void 0 : _this5$_renderParams7.paymentSessionMetaData, ((_this5$_renderParams8 = _this5._renderParams) === null || _this5$_renderParams8 === void 0 ? void 0 : _this5$_renderParams8.notRedirectAfterComplete) === true); // Easypay TOSS 渠道无需actionQuery
|
567
568
|
if (!(channelBehavior !== null && channelBehavior !== void 0 && channelBehavior.usePaymentSessionAsQueryResult)) {
|
568
569
|
_context2.next = 29;
|
569
570
|
break;
|
@@ -594,7 +595,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
594
595
|
break;
|
595
596
|
}
|
596
597
|
_ref8 = params.paymentSessionConfig || {}, _ref8$productSceneVer = _ref8.productSceneVersion, productSceneVersion = _ref8$productSceneVer === void 0 ? '' : _ref8$productSceneVer, _ref8$productScene = _ref8.productScene, productScene = _ref8$productScene === void 0 ? '' : _ref8$productScene;
|
597
|
-
if (!((_this5$
|
598
|
+
if (!((_this5$_renderParams9 = _this5._renderParams) !== null && _this5$_renderParams9 !== void 0 && (_this5$_renderParams9 = _this5$_renderParams9.paymentSessionMetaData) !== null && _this5$_renderParams9 !== void 0 && (_this5$_renderParams9 = _this5$_renderParams9.action) !== null && _this5$_renderParams9 !== void 0 && _this5$_renderParams9.skipSdkQuery && enableEasypayApiOptimize)) {
|
598
599
|
_context2.next = 39;
|
599
600
|
break;
|
600
601
|
}
|
@@ -621,7 +622,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
621
622
|
_context2.next = 54;
|
622
623
|
break;
|
623
624
|
}
|
624
|
-
action = ((_this5$
|
625
|
+
action = ((_this5$_renderParams10 = _this5._renderParams) === null || _this5$_renderParams10 === void 0 || (_this5$_renderParams10 = _this5$_renderParams10.paymentSessionMetaData) === null || _this5$_renderParams10 === void 0 ? void 0 : _this5$_renderParams10.action) || {};
|
625
626
|
signType = isPC() ? action === null || action === void 0 || (_action$web2 = action.web) === null || _action$web2 === void 0 ? void 0 : _action$web2.signType : action === null || action === void 0 || (_action$wap2 = action.wap) === null || _action$wap2 === void 0 ? void 0 : _action$wap2.signType;
|
626
627
|
if (!(signType === 'SMS')) {
|
627
628
|
_context2.next = 49;
|
@@ -698,23 +699,24 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
698
699
|
}, {
|
699
700
|
key: "createSubmitPromise",
|
700
701
|
value: function createSubmitPromise() {
|
701
|
-
var _this$
|
702
|
-
_this$_renderParams14,
|
702
|
+
var _this$_renderParams14,
|
703
703
|
_this$_renderParams15,
|
704
|
+
_this$_renderParams16,
|
705
|
+
_this$_renderParams17,
|
704
706
|
_this6 = this;
|
705
707
|
this._performanceData.push({
|
706
708
|
key: 'sdk_submit_start',
|
707
709
|
value: Date.now()
|
708
710
|
});
|
709
711
|
var params = {
|
710
|
-
paymentSessionData: this._renderParams && ((_this$
|
711
|
-
paymentSessionConfig: (_this$
|
712
|
+
paymentSessionData: this._renderParams && ((_this$_renderParams14 = this._renderParams) === null || _this$_renderParams14 === void 0 ? void 0 : _this$_renderParams14.sessionData) || '',
|
713
|
+
paymentSessionConfig: (_this$_renderParams15 = this._renderParams) === null || _this$_renderParams15 === void 0 || (_this$_renderParams15 = _this$_renderParams15.paymentSessionMetaData) === null || _this$_renderParams15 === void 0 ? void 0 : _this$_renderParams15.paymentSessionConfig
|
712
714
|
};
|
713
|
-
var channelBehavior = getChannelBehavior((_this$
|
715
|
+
var channelBehavior = getChannelBehavior((_this$_renderParams16 = this._renderParams) === null || _this$_renderParams16 === void 0 ? void 0 : _this$_renderParams16.paymentSessionMetaData, ((_this$_renderParams17 = this._renderParams) === null || _this$_renderParams17 === void 0 ? void 0 : _this$_renderParams17.notRedirectAfterComplete) === true);
|
714
716
|
// eslint-disable-next-line no-async-promise-executor
|
715
717
|
this._actionSubmitPromise = new Promise( /*#__PURE__*/function () {
|
716
718
|
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(resolve) {
|
717
|
-
var _channelBehavior$buil, _this6$_renderParams
|
719
|
+
var _channelBehavior$buil, _this6$_renderParams$, _this6$_renderParams4;
|
718
720
|
var shouldSkipSubmitPayInSDK, _this6$_renderParams, _this6$_renderParams2, _this6$_renderParams3, _ref10, _ref10$productSceneVe, productSceneVersion, _ref10$productScene, productScene, _ref11, _ref11$action, _ref11$action2, _ref11$action2$enable, enableSignAgreement, _ref11$action2$autoDe, autoDebitWithToken, _ref12, _ref12$paymentMethodI, _ref12$paymentMethodI2, _ref12$paymentMethodI3, paymentMethodType, isAppWebview, backScheme, extParams;
|
719
721
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
720
722
|
while (1) switch (_context3.prev = _context3.next) {
|
@@ -771,8 +773,10 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
771
773
|
locale: _this6.AMSSDK.options.locale,
|
772
774
|
paymentMethodType: (_this6$_renderParams$ = _this6._renderParams.paymentSessionMetaData) === null || _this6$_renderParams$ === void 0 || (_this6$_renderParams$ = _this6$_renderParams$.paymentMethodInfoView) === null || _this6$_renderParams$ === void 0 ? void 0 : _this6$_renderParams$.paymentMethodType,
|
773
775
|
paymentSessionData: _this6._renderParams.sessionData,
|
776
|
+
paymentSessionObj: _this6._renderParams.paymentSessionMetaData,
|
774
777
|
env: _this6.AMSSDK.options.env.environment,
|
775
|
-
sdkVersion: _this6._appVersion
|
778
|
+
sdkVersion: _this6._appVersion,
|
779
|
+
notRedirectAfterComplete: ((_this6$_renderParams4 = _this6._renderParams) === null || _this6$_renderParams4 === void 0 ? void 0 : _this6$_renderParams4.notRedirectAfterComplete) === true
|
776
780
|
})) || {};
|
777
781
|
params.extParams = extParams;
|
778
782
|
_context3.t0 = submitPayInfo;
|
@@ -802,7 +806,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
802
806
|
paymentSessionConfig: JSON.stringify(params.paymentSessionConfig)
|
803
807
|
}).send();
|
804
808
|
resolve(res);
|
805
|
-
}).catch(function (
|
809
|
+
}).catch(function () {
|
806
810
|
_this6.AMSSDK.logger.logError({
|
807
811
|
title: 'sdk_event_submitPay_failed'
|
808
812
|
}, {
|
@@ -1355,10 +1359,10 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1355
1359
|
});
|
1356
1360
|
}
|
1357
1361
|
if ((data === null || data === void 0 || (_data$context6 = data.context) === null || _data$context6 === void 0 ? void 0 : _data$context6.event) === EVENT.getApplePayToken.name) {
|
1358
|
-
var _this$
|
1362
|
+
var _this$_renderParams18, _this$_renderParams19;
|
1359
1363
|
var applePayService = new ApplePaySdk({
|
1360
|
-
paymentSessionData: (_this$
|
1361
|
-
parseData: (_this$
|
1364
|
+
paymentSessionData: (_this$_renderParams18 = this._renderParams) === null || _this$_renderParams18 === void 0 ? void 0 : _this$_renderParams18.sessionData,
|
1365
|
+
parseData: (_this$_renderParams19 = this._renderParams) === null || _this$_renderParams19 === void 0 ? void 0 : _this$_renderParams19.paymentSessionMetaData,
|
1362
1366
|
logger: this.AMSSDK.logger
|
1363
1367
|
});
|
1364
1368
|
applePayService.startPay().then(function (res) {
|
@@ -1445,10 +1449,10 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1445
1449
|
}, {
|
1446
1450
|
key: "handleSizeChanged",
|
1447
1451
|
value: function handleSizeChanged(data) {
|
1448
|
-
var _this$
|
1449
|
-
var _selector = (this === null || this === void 0 || (_this$
|
1452
|
+
var _this$_renderParams20, _this$_renderParams21, _this$_renderParams22, _this$_renderParams23, _this$_renderParams24, _this$_renderParams25, _data$context$data4, _cashier$style;
|
1453
|
+
var _selector = (this === null || this === void 0 || (_this$_renderParams20 = this._renderParams) === null || _this$_renderParams20 === void 0 || (_this$_renderParams20 = _this$_renderParams20.selector) === null || _this$_renderParams20 === void 0 || (_this$_renderParams21 = _this$_renderParams20.indexOf) === null || _this$_renderParams21 === void 0 ? void 0 : _this$_renderParams21.call(_this$_renderParams20, '#')) === -1 ? this === null || this === void 0 || (_this$_renderParams22 = this._renderParams) === null || _this$_renderParams22 === void 0 ? void 0 : _this$_renderParams22.selector : this === null || this === void 0 || (_this$_renderParams23 = this._renderParams) === null || _this$_renderParams23 === void 0 || (_this$_renderParams23 = _this$_renderParams23.selector) === null || _this$_renderParams23 === void 0 || (_this$_renderParams24 = _this$_renderParams23.slice) === null || _this$_renderParams24 === void 0 ? void 0 : _this$_renderParams24.call(_this$_renderParams23, 1);
|
1450
1454
|
// 修改需当前文件搜索,这段注释appendAliasContainerId
|
1451
|
-
var appendAliasContainerId = this === null || this === void 0 || (_this$
|
1455
|
+
var appendAliasContainerId = this === null || this === void 0 || (_this$_renderParams25 = this._renderParams) === null || _this$_renderParams25 === void 0 ? void 0 : _this$_renderParams25.appendAliasContainerId;
|
1452
1456
|
var selectorId = appendAliasContainerId ? "".concat(COMPONENT_CONTAINER_ID, "-").concat(_selector) : COMPONENT_CONTAINER_ID;
|
1453
1457
|
var cashier = document.getElementById(selectorId);
|
1454
1458
|
if (((_data$context$data4 = data.context.data) === null || _data$context$data4 === void 0 ? void 0 : _data$context$data4.height) <= 1 || data.context.data.height === parseInt(cashier === null || cashier === void 0 || (_cashier$style = cashier.style) === null || _cashier$style === void 0 ? void 0 : _cashier$style.height)) return;
|
@@ -1570,7 +1574,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1570
1574
|
};
|
1571
1575
|
var failCallback = function failCallback(type, url, durationInSeconds) {
|
1572
1576
|
_this8.dispatchToSDK(EVENT.eventCallback.name, {
|
1573
|
-
code: eventCodeEnum.
|
1577
|
+
code: eventCodeEnum.SDK_LAUNCH_PAYMENT_APP_ERROR,
|
1574
1578
|
message: "Failed to open app,applinkUrl: ".concat(_data === null || _data === void 0 ? void 0 : _data.applinkUrl, " schemeUrl: ").concat(_data === null || _data === void 0 ? void 0 : _data.schemeUrl, " normalUrl: ").concat(_data === null || _data === void 0 ? void 0 : _data.normalUrl)
|
1575
1579
|
});
|
1576
1580
|
var extra = {
|
@@ -1799,7 +1803,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1799
1803
|
key: "sendRenderEvent",
|
1800
1804
|
value: (function () {
|
1801
1805
|
var _sendRenderEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
1802
|
-
var _this$
|
1806
|
+
var _this$_renderParams26, _this$_renderParams27, _this$_renderParams28, _this$_renderParams29, _this$_renderParams30, _this$_renderParams31, _this$_renderParams32, _this$_renderParams33, _this$_renderParams34, _this$AMSSDK$logger, _this$_renderParams35, _this$_renderParams36, _this$_renderParams37, _this$AMSSDK, _this$_renderParams38, _this$_renderParams39, isAddressElement, res, submitRes;
|
1803
1807
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
1804
1808
|
while (1) switch (_context8.prev = _context8.next) {
|
1805
1809
|
case 0:
|
@@ -1829,35 +1833,35 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1829
1833
|
data: {
|
1830
1834
|
queryResult: res,
|
1831
1835
|
submitResult: submitRes,
|
1832
|
-
sessionResult: (_this$
|
1833
|
-
paymentSessionData: (_this$
|
1836
|
+
sessionResult: (_this$_renderParams26 = this._renderParams) === null || _this$_renderParams26 === void 0 ? void 0 : _this$_renderParams26.paymentSessionMetaData,
|
1837
|
+
paymentSessionData: (_this$_renderParams27 = this._renderParams) === null || _this$_renderParams27 === void 0 ? void 0 : _this$_renderParams27.sessionData,
|
1834
1838
|
heightOfVisible: Math.max(window.changingPageHeight, window.innerHeight),
|
1835
|
-
renderDisplayType: (_this$
|
1836
|
-
appearance: (_this$
|
1837
|
-
notRedirectAfterComplete: ((_this$
|
1839
|
+
renderDisplayType: (_this$_renderParams28 = this._renderParams) === null || _this$_renderParams28 === void 0 ? void 0 : _this$_renderParams28.renderDisplayType,
|
1840
|
+
appearance: (_this$_renderParams29 = this._renderParams) === null || _this$_renderParams29 === void 0 ? void 0 : _this$_renderParams29.appearance,
|
1841
|
+
notRedirectAfterComplete: ((_this$_renderParams30 = this._renderParams) === null || _this$_renderParams30 === void 0 ? void 0 : _this$_renderParams30.notRedirectAfterComplete) === true,
|
1838
1842
|
isAppWebview: this._isAppWebview,
|
1839
1843
|
merchantAppointParam: this._merchantAppointParam,
|
1840
1844
|
allowSubmitPayCallAhead: this._allowSubmitPayCallAhead,
|
1841
1845
|
/** 地址组件集成的参数 */
|
1842
|
-
configParams: (_this$
|
1843
|
-
prefillValue: (_this$
|
1844
|
-
componentSession: (_this$
|
1846
|
+
configParams: (_this$_renderParams31 = this._renderParams) === null || _this$_renderParams31 === void 0 ? void 0 : _this$_renderParams31.configParams,
|
1847
|
+
prefillValue: (_this$_renderParams32 = this._renderParams) === null || _this$_renderParams32 === void 0 ? void 0 : _this$_renderParams32.prefillValue,
|
1848
|
+
componentSession: (_this$_renderParams33 = this._renderParams) === null || _this$_renderParams33 === void 0 ? void 0 : _this$_renderParams33.componentSession,
|
1845
1849
|
envInfo: {
|
1846
1850
|
screenHeight: screen.height,
|
1847
1851
|
screenWidth: screen.width
|
1848
1852
|
},
|
1849
1853
|
logMetaData: _objectSpread(_objectSpread({
|
1850
|
-
trackId: (_this$
|
1854
|
+
trackId: (_this$_renderParams34 = this._renderParams) === null || _this$_renderParams34 === void 0 ? void 0 : _this$_renderParams34.sessionData,
|
1851
1855
|
platform: this.platform,
|
1852
1856
|
firstLogTime: (_this$AMSSDK$logger = this.AMSSDK.logger) === null || _this$AMSSDK$logger === void 0 ? void 0 : _this$AMSSDK$logger.getComponentStartTime()
|
1853
|
-
}, ((_this$
|
1854
|
-
renderDisplayType: (_this$
|
1857
|
+
}, ((_this$_renderParams35 = this._renderParams) === null || _this$_renderParams35 === void 0 || (_this$_renderParams35 = _this$_renderParams35.paymentSessionMetaData) === null || _this$_renderParams35 === void 0 ? void 0 : _this$_renderParams35.paymentSessionConfig) || {}), {}, {
|
1858
|
+
renderDisplayType: (_this$_renderParams36 = this._renderParams) === null || _this$_renderParams36 === void 0 ? void 0 : _this$_renderParams36.renderDisplayType,
|
1855
1859
|
sdkVersion: this._appVersion,
|
1856
|
-
merchantId: (_this$
|
1860
|
+
merchantId: (_this$_renderParams37 = this._renderParams) === null || _this$_renderParams37 === void 0 || (_this$_renderParams37 = _this$_renderParams37.paymentSessionMetaData) === null || _this$_renderParams37 === void 0 ? void 0 : _this$_renderParams37.clientId,
|
1857
1861
|
instanceId: (_this$AMSSDK = this.AMSSDK) === null || _this$AMSSDK === void 0 ? void 0 : _this$AMSSDK._instanceId,
|
1858
1862
|
performanceData: this._performanceData,
|
1859
|
-
paymentMethodType: (_this$
|
1860
|
-
skipRenderPaymentMethod: (_this$
|
1863
|
+
paymentMethodType: (_this$_renderParams38 = this._renderParams) === null || _this$_renderParams38 === void 0 || (_this$_renderParams38 = _this$_renderParams38.paymentSessionMetaData) === null || _this$_renderParams38 === void 0 || (_this$_renderParams38 = _this$_renderParams38.paymentMethodInfoView) === null || _this$_renderParams38 === void 0 ? void 0 : _this$_renderParams38.paymentMethodType,
|
1864
|
+
skipRenderPaymentMethod: (_this$_renderParams39 = this._renderParams) === null || _this$_renderParams39 === void 0 || (_this$_renderParams39 = _this$_renderParams39.paymentSessionMetaData) === null || _this$_renderParams39 === void 0 ? void 0 : _this$_renderParams39.skipRenderPaymentMethod
|
1861
1865
|
})
|
1862
1866
|
}
|
1863
1867
|
}
|
@@ -1919,10 +1923,10 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1919
1923
|
}, {
|
1920
1924
|
key: "hideComponentAnimation",
|
1921
1925
|
value: function hideComponentAnimation() {
|
1922
|
-
var _this$
|
1926
|
+
var _this$_renderParams40, _this$_renderParams41, _this$_renderParams42, _this$_renderParams43, _this$_renderParams44, _this$_renderParams45, _container$style;
|
1923
1927
|
// 修改需当前文件搜索,这段注释appendAliasContainerId
|
1924
|
-
var _selector = (this === null || this === void 0 || (_this$
|
1925
|
-
var appendAliasContainerId = this !== null && this !== void 0 && (_this$
|
1928
|
+
var _selector = (this === null || this === void 0 || (_this$_renderParams40 = this._renderParams) === null || _this$_renderParams40 === void 0 || (_this$_renderParams40 = _this$_renderParams40.selector) === null || _this$_renderParams40 === void 0 || (_this$_renderParams41 = _this$_renderParams40.indexOf) === null || _this$_renderParams41 === void 0 ? void 0 : _this$_renderParams41.call(_this$_renderParams40, '#')) === -1 ? this === null || this === void 0 || (_this$_renderParams42 = this._renderParams) === null || _this$_renderParams42 === void 0 ? void 0 : _this$_renderParams42.selector : this === null || this === void 0 || (_this$_renderParams43 = this._renderParams) === null || _this$_renderParams43 === void 0 || (_this$_renderParams43 = _this$_renderParams43.selector) === null || _this$_renderParams43 === void 0 || (_this$_renderParams44 = _this$_renderParams43.slice) === null || _this$_renderParams44 === void 0 ? void 0 : _this$_renderParams44.call(_this$_renderParams43, 1);
|
1929
|
+
var appendAliasContainerId = this !== null && this !== void 0 && (_this$_renderParams45 = this._renderParams) !== null && _this$_renderParams45 !== void 0 && _this$_renderParams45.appendAliasContainerId ? "-".concat(_selector) : '';
|
1926
1930
|
var inlineId = "".concat(COMPONENT_CONTAINER_ID).concat(appendAliasContainerId);
|
1927
1931
|
var container = document.getElementById(inlineId);
|
1928
1932
|
if (this.app && container) this.app.style.height = container === null || container === void 0 || (_container$style = container.style) === null || _container$style === void 0 ? void 0 : _container$style.height;
|
package/esm/plugin/type.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { BusSubscriber } from '
|
1
|
+
import { BusSubscriber } from '../core/bus';
|
2
2
|
import { PaymentMethodCategoryTypeEnum, ProductSceneEnum, ProductSceneVersion } from '../types';
|
3
3
|
export type IExtendPlugin = IExtendPluginItem[];
|
4
4
|
export interface ComponentActionNamesType {
|
package/esm/request/index.js
CHANGED
@@ -20,7 +20,7 @@ import { sdkVersion } from "../config/index";
|
|
20
20
|
import { appId, hostSignMap, lightSandboxMap, requestHost, sofaId, tntInstId } from "../config/request";
|
21
21
|
import { errorEnum } from "../types";
|
22
22
|
import { get } from "../util/get";
|
23
|
-
import { device,
|
23
|
+
import { device, queryParse, safeJson } from "../util";
|
24
24
|
import { fomatGetwayError } from "./utils";
|
25
25
|
var _queryParse = queryParse(),
|
26
26
|
_sandbox = _queryParse._sandbox;
|
@@ -70,7 +70,7 @@ function _request() {
|
|
70
70
|
while (1) switch (_context.prev = _context.next) {
|
71
71
|
case 0:
|
72
72
|
envInfo = _objectSpread(_objectSpread({
|
73
|
-
terminalType:
|
73
|
+
terminalType: device.isMobile ? 'WAP' : 'WEB',
|
74
74
|
browserInfo: {
|
75
75
|
browserJavaScriptEnabled: true,
|
76
76
|
browserLanguage: navigator.language,
|
package/esm/types/index.d.ts
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
*/
|
8
8
|
import { IApplePayContactField } from '../plugin/applepay/interface';
|
9
9
|
export type onChange = () => onCnageResult;
|
10
|
-
export {
|
10
|
+
export { ElementType, PaymentElementLayout, ThemeType, type IElementOptions } from '../core/component/oldElement/type';
|
11
11
|
interface onCnageResult {
|
12
12
|
complete: boolean;
|
13
13
|
addressValue: AddressItem[];
|
@@ -76,7 +76,8 @@ export declare enum ComponentSignEnum {
|
|
76
76
|
'VAULTING_CARD' = "VAULTING_CARD",
|
77
77
|
'CHECKOUT_PAYMENT' = "CHECKOUT_PAYMENT",
|
78
78
|
'ELEMENT_PAYMENT' = "ELEMENT_PAYMENT_ALL",
|
79
|
-
'ELEMENT_ADDRESS' = "ELEMENT_ADDRESS_ALL"
|
79
|
+
'ELEMENT_ADDRESS' = "ELEMENT_ADDRESS_ALL",
|
80
|
+
'AUTO_DEBIT_APM' = "AUTO_DEBIT_APM"
|
80
81
|
}
|
81
82
|
export declare enum ProductSceneEnum {
|
82
83
|
'EASY_PAY' = "EASY_PAY",
|
@@ -235,6 +236,9 @@ export interface frontModulesToBeLoadedInterface {
|
|
235
236
|
acquirerName: string;
|
236
237
|
scriptUrl: string;
|
237
238
|
}
|
239
|
+
type ActionDeviceInfo = {
|
240
|
+
signType?: string;
|
241
|
+
};
|
238
242
|
export interface PaymentSessionActionData {
|
239
243
|
amountConfirmRequired?: boolean;
|
240
244
|
autoDebitWithToken: boolean;
|
@@ -243,11 +247,16 @@ export interface PaymentSessionActionData {
|
|
243
247
|
requireFastSdk: boolean;
|
244
248
|
nonCompliant?: boolean;
|
245
249
|
nonInitSecuritySDK?: boolean;
|
250
|
+
signButtonDisplay?: boolean;
|
251
|
+
userSignAgreement?: boolean;
|
246
252
|
skipSdkQueryForm?: {
|
247
253
|
value: boolean;
|
248
254
|
version: string;
|
249
255
|
platform: string;
|
250
256
|
};
|
257
|
+
web: ActionDeviceInfo;
|
258
|
+
wap: ActionDeviceInfo;
|
259
|
+
app: ActionDeviceInfo;
|
251
260
|
}
|
252
261
|
export interface IPaymentSessionMetaData {
|
253
262
|
clientId?: string;
|
@@ -335,6 +344,7 @@ export interface IPaymentSessionMetaData {
|
|
335
344
|
enableConnect?: boolean;
|
336
345
|
};
|
337
346
|
skipRenderPaymentMethod?: boolean;
|
347
|
+
needAccountConfirmPage?: boolean;
|
338
348
|
}
|
339
349
|
export interface IPaymentSessionFactor {
|
340
350
|
merchantInfo?: IMerchantInfo;
|
@@ -581,6 +591,14 @@ export interface CashierSdkActionQueryResult {
|
|
581
591
|
channelOrderId?: string;
|
582
592
|
};
|
583
593
|
}
|
594
|
+
export interface CashierSdkActionQuerySessionResult extends IPaymentSessionMetaData {
|
595
|
+
success: boolean;
|
596
|
+
errorCode?: string;
|
597
|
+
errorMessage?: string;
|
598
|
+
message?: string;
|
599
|
+
errorStatus?: string;
|
600
|
+
traceId?: string;
|
601
|
+
}
|
584
602
|
/**
|
585
603
|
* Get App Pay Payment Session Request.
|
586
604
|
*/
|
@@ -630,8 +648,18 @@ export declare enum eventCodeEnum {
|
|
630
648
|
SDK_CREATEPAYMENT_PARAMETER_ERROR = "SDK_CREATEPAYMENT_PARAMETER_ERROR",
|
631
649
|
SDK_INIT_PARAMETER_ERROR = "SDK_INIT_PARAMETER_ERROR",
|
632
650
|
SDK_CREATECOMPONENT_ERROR = "SDK_CREATECOMPONENT_ERROR",
|
633
|
-
|
651
|
+
/**
|
652
|
+
* 拉取WEB应用&收银台失败
|
653
|
+
*/
|
654
|
+
SDK_LAUNCH_PAYMENT_APP_ERROR = "SDK_LAUNCH_PAYMENT_APP_ERROR",
|
655
|
+
/**
|
656
|
+
* 拉取WEB应用&收银台成功
|
657
|
+
*/
|
634
658
|
SDK_CALL_URL_SUCCESS = "SDK_CALL_URL_SUCCESS",
|
659
|
+
/**
|
660
|
+
@deprecated 已废弃 请使用SDK_LAUNCH_PAYMENT_APP_ERROR
|
661
|
+
*/
|
662
|
+
SDK_CALL_URL_ERROR = "SDK_CALL_URL_ERROR",
|
635
663
|
SDK_PAYMENT_SUCCESSFUL = "SDK_PAYMENT_SUCCESSFUL",
|
636
664
|
SDK_PAYMENT_FAIL = "SDK_PAYMENT_FAIL",
|
637
665
|
SDK_PAYMENT_ERROR = "SDK_PAYMENT_ERROR",
|
@@ -794,3 +822,9 @@ export declare enum RiskSdkInfoEnum {
|
|
794
822
|
NEED = "need",
|
795
823
|
NO_NEED = "noneed"
|
796
824
|
}
|
825
|
+
export type HandleCloseSource = 'behavior' | 'retention';
|
826
|
+
export declare enum EventLoggingEventId {
|
827
|
+
OnlyClose = "OnlyClose",
|
828
|
+
LeaveAnyWay = "LeaveAnyWay",
|
829
|
+
ContinuePaying = "ContinuePaying"
|
830
|
+
}
|
package/esm/types/index.js
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
10
10
|
|
11
|
-
export { ElementType,
|
11
|
+
export { ElementType, PaymentElementLayout, ThemeType } from "../core/component/oldElement/type";
|
12
12
|
|
13
13
|
/**
|
14
14
|
* SDK options
|
@@ -37,6 +37,7 @@ export var ComponentSignEnum = /*#__PURE__*/function (ComponentSignEnum) {
|
|
37
37
|
ComponentSignEnum["CHECKOUT_PAYMENT"] = "CHECKOUT_PAYMENT";
|
38
38
|
ComponentSignEnum["ELEMENT_PAYMENT"] = "ELEMENT_PAYMENT_ALL";
|
39
39
|
ComponentSignEnum["ELEMENT_ADDRESS"] = "ELEMENT_ADDRESS_ALL";
|
40
|
+
ComponentSignEnum["AUTO_DEBIT_APM"] = "AUTO_DEBIT_APM";
|
40
41
|
return ComponentSignEnum;
|
41
42
|
}({});
|
42
43
|
export var ProductSceneEnum = /*#__PURE__*/function (ProductSceneEnum) {
|
@@ -182,8 +183,9 @@ export var eventCodeEnum = /*#__PURE__*/function (eventCodeEnum) {
|
|
182
183
|
eventCodeEnum["SDK_CREATEPAYMENT_PARAMETER_ERROR"] = "SDK_CREATEPAYMENT_PARAMETER_ERROR";
|
183
184
|
eventCodeEnum["SDK_INIT_PARAMETER_ERROR"] = "SDK_INIT_PARAMETER_ERROR";
|
184
185
|
eventCodeEnum["SDK_CREATECOMPONENT_ERROR"] = "SDK_CREATECOMPONENT_ERROR";
|
185
|
-
eventCodeEnum["
|
186
|
+
eventCodeEnum["SDK_LAUNCH_PAYMENT_APP_ERROR"] = "SDK_LAUNCH_PAYMENT_APP_ERROR";
|
186
187
|
eventCodeEnum["SDK_CALL_URL_SUCCESS"] = "SDK_CALL_URL_SUCCESS";
|
188
|
+
eventCodeEnum["SDK_CALL_URL_ERROR"] = "SDK_CALL_URL_ERROR";
|
187
189
|
eventCodeEnum["SDK_PAYMENT_SUCCESSFUL"] = "SDK_PAYMENT_SUCCESSFUL";
|
188
190
|
eventCodeEnum["SDK_PAYMENT_FAIL"] = "SDK_PAYMENT_FAIL";
|
189
191
|
eventCodeEnum["SDK_PAYMENT_ERROR"] = "SDK_PAYMENT_ERROR";
|
@@ -229,4 +231,10 @@ export var RiskSdkInfoEnum = /*#__PURE__*/function (RiskSdkInfoEnum) {
|
|
229
231
|
RiskSdkInfoEnum["NEED"] = "need";
|
230
232
|
RiskSdkInfoEnum["NO_NEED"] = "noneed";
|
231
233
|
return RiskSdkInfoEnum;
|
234
|
+
}({});
|
235
|
+
export var EventLoggingEventId = /*#__PURE__*/function (EventLoggingEventId) {
|
236
|
+
EventLoggingEventId["OnlyClose"] = "OnlyClose";
|
237
|
+
EventLoggingEventId["LeaveAnyWay"] = "LeaveAnyWay";
|
238
|
+
EventLoggingEventId["ContinuePaying"] = "ContinuePaying";
|
239
|
+
return EventLoggingEventId;
|
232
240
|
}({});
|
package/esm/util/index.d.ts
CHANGED
@@ -26,6 +26,7 @@ declare const device: {
|
|
26
26
|
macOS: boolean;
|
27
27
|
WindowsNT: boolean;
|
28
28
|
isMobile: boolean;
|
29
|
+
isOpenHarmonyMobile: boolean;
|
29
30
|
};
|
30
31
|
declare const safeJson: (data: any, obj: any) => any;
|
31
32
|
declare const isPC: () => boolean;
|
@@ -47,4 +48,14 @@ declare function loadSDKScript({ src, attrOptions, timeOut, loadCallback }: {
|
|
47
48
|
loadCallback?: any;
|
48
49
|
}, logger: any): Promise<unknown>;
|
49
50
|
declare const isEmpty: (value: any) => boolean;
|
50
|
-
|
51
|
+
/**
|
52
|
+
* 判断一个值是否为真
|
53
|
+
* @param value 要判断的值
|
54
|
+
* @returns 如果值为true或者字符串"true"(不区分大小写),则返回true,否则返回false
|
55
|
+
*/
|
56
|
+
declare const isTrue: (value: unknown) => boolean;
|
57
|
+
export declare const omit: <T extends {
|
58
|
+
[x: string]: any;
|
59
|
+
hasOwnProperty: (arg0: any) => any;
|
60
|
+
}>(obj: T, keys: Array<keyof T>) => T;
|
61
|
+
export { getType, EventCenter, getViewPort, getOrigin, serialize, isJsonString, isDom, isFunction, device, safeJson, isPC, queryParse, getDesignFontSize, amsSetSize, addSetFontSizeEvent, getOrSetStorageId, checkTimeElapsed, parseBase64ToString, loadSDKScript, isEmpty, isTrue, };
|
package/esm/util/index.js
CHANGED
@@ -148,14 +148,33 @@ var isAndroid = /Android/i.test(UA);
|
|
148
148
|
var isMacOS = /\bMacintosh\b/.test(UA);
|
149
149
|
var isWindowsNT = /Windows NT/.test(UA);
|
150
150
|
var isMobile = function isMobile() {
|
151
|
-
return /Android|iPhone|iPad|iPod|Mobile/.test(UA);
|
151
|
+
return /Android|iPhone|iPad|iPod|Mobile/.test(UA) || isOpenHarmonyMobile();
|
152
|
+
};
|
153
|
+
var isOpenHarmony = function isOpenHarmony() {
|
154
|
+
// 检查是否为鸿蒙操作系统
|
155
|
+
return /OpenHarmony/i.test(navigator.userAgent);
|
156
|
+
};
|
157
|
+
var isOpenHarmonyMobile = function isOpenHarmonyMobile() {
|
158
|
+
// 检查是否为鸿蒙操作系统
|
159
|
+
var isHarmonyOS = /OpenHarmony/i.test(navigator.userAgent);
|
160
|
+
// 检查是否为手机设备
|
161
|
+
var isPhone = /Phone/i.test(navigator.userAgent);
|
162
|
+
// 检查是否为平板设备
|
163
|
+
var isTablet = /Tablet/i.test(navigator.userAgent);
|
164
|
+
// 返回是否为鸿蒙手机或平板
|
165
|
+
return isHarmonyOS && (isPhone || isTablet);
|
166
|
+
};
|
167
|
+
var isOpenHarmonyPC = function isOpenHarmonyPC() {
|
168
|
+
// 检查是否为鸿蒙操作系统
|
169
|
+
return /OpenHarmony/i.test(navigator.userAgent) && /PC/i.test(navigator.userAgent);
|
152
170
|
};
|
153
171
|
var device = {
|
154
172
|
iOS: isIOS,
|
155
173
|
Android: isAndroid,
|
156
174
|
macOS: isMacOS,
|
157
175
|
WindowsNT: isWindowsNT,
|
158
|
-
isMobile: !!isMobile()
|
176
|
+
isMobile: !!isMobile(),
|
177
|
+
isOpenHarmonyMobile: !!isOpenHarmonyMobile()
|
159
178
|
};
|
160
179
|
var safeJson = function safeJson(data, obj) {
|
161
180
|
try {
|
@@ -343,4 +362,21 @@ var isEmpty = function isEmpty(value) {
|
|
343
362
|
}
|
344
363
|
return false;
|
345
364
|
};
|
346
|
-
|
365
|
+
|
366
|
+
/**
|
367
|
+
* 判断一个值是否为真
|
368
|
+
* @param value 要判断的值
|
369
|
+
* @returns 如果值为true或者字符串"true"(不区分大小写),则返回true,否则返回false
|
370
|
+
*/
|
371
|
+
var isTrue = function isTrue(value) {
|
372
|
+
return value === true || typeof value === 'string' && value.toLowerCase() === 'true';
|
373
|
+
};
|
374
|
+
export var omit = function omit(obj, keys) {
|
375
|
+
return Object.keys(obj).reduce(function (acc, key) {
|
376
|
+
if (!keys.includes(key)) {
|
377
|
+
acc[key] = obj[key];
|
378
|
+
}
|
379
|
+
return acc;
|
380
|
+
}, {});
|
381
|
+
};
|
382
|
+
export { getType, EventCenter, getViewPort, getOrigin, serialize, isJsonString, isDom, isFunction, device, safeJson, isPC, queryParse, getDesignFontSize, amsSetSize, addSetFontSizeEvent, getOrSetStorageId, checkTimeElapsed, parseBase64ToString, loadSDKScript, isEmpty, isTrue };
|