@alipay/ams-checkout 0.0.1748326942-dev.0 → 0.0.1749206034-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/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 +7 -0
- package/esm/constant/index.js +7 -0
- package/esm/core/component/ckp/index.d.ts +2 -0
- package/esm/core/component/ckp/index.js +39 -5
- package/esm/core/component/element/util.js +1 -1
- package/esm/foundation/core/index.d.ts +3 -0
- package/esm/foundation/core/index.js +103 -37
- package/esm/foundation/index.d.ts +6 -0
- package/esm/foundation/product-processor/easysafepay/deps.d.ts +1 -1
- package/esm/foundation/product-processor/easysafepay/index.d.ts +2 -0
- package/esm/foundation/product-processor/easysafepay/index.js +244 -121
- package/esm/foundation/service/container/index.d.ts +5 -0
- package/esm/foundation/service/container/index.js +96 -2
- package/esm/foundation/utils/preload_helper.d.ts +2 -2
- package/esm/foundation/utils/preload_helper.js +8 -4
- package/esm/foundation/utils/web_app_url_utils.d.ts +71 -1
- package/esm/foundation/utils/web_app_url_utils.js +215 -8
- package/esm/index.js +1 -1
- package/esm/plugin/component/cashierApp.js +4 -4
- package/esm/plugin/component/channel.d.ts +3 -1
- package/esm/plugin/component/channel.js +10 -12
- package/esm/plugin/component/index.js +45 -42
- package/esm/types/index.d.ts +17 -0
- package/esm/types/index.js +6 -0
- package/esm/util/redirect.d.ts +6 -0
- package/esm/util/redirect.js +54 -0
- package/package.json +3 -2
@@ -11,7 +11,7 @@ import { isEmpty } from "../../../util";
|
|
11
11
|
import { addInlineLoading, createInlineBaseElement } from "../../../component/component.inline.style";
|
12
12
|
import { addPopupLoading, createBaseElement } from "../../../component/component.popup.style";
|
13
13
|
import { insertStyleSheet } from "../../../component/popupWindow.style";
|
14
|
-
import { COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CLOSE_MASK_BLOCK_ID, COMPONENT_CONTAINER_ID, ERRORMESSAGE, EVENT, LOADING_ID, MOCKUP_ID, TIMEOUT_WEB_APP_HEART_BEAT, TIME_DELAY_SEND_HEART_BEAT } from "../../../constant";
|
14
|
+
import { COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CLOSE_MASK_BLOCK_ID, COMPONENT_CONTAINER_ID, ERRORMESSAGE, EVENT, LOADING_ID, MOCKUP_ID, TIMEOUT_WEB_APP_HEART_BEAT, TIME_DELAY_SEND_HEART_BEAT, closeImg, closeImgLight } from "../../../constant";
|
15
15
|
import { DisplayTypeEnum, ProductSceneEnum } from "../../../types";
|
16
16
|
import { ServiceProvider } from "../index";
|
17
17
|
import { PopupManager } from "./popup";
|
@@ -35,6 +35,7 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
35
35
|
_defineProperty(this, "displayInfo", void 0);
|
36
36
|
_defineProperty(this, "webApp", void 0);
|
37
37
|
_defineProperty(this, "_webAppHeartBeatTimeoutFn", void 0);
|
38
|
+
_defineProperty(this, "clientHeight", void 0);
|
38
39
|
// if this variable is true, SDK will invoke listener instead of showing loading
|
39
40
|
_defineProperty(this, "customizedLoadingListener", void 0);
|
40
41
|
}
|
@@ -46,6 +47,7 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
46
47
|
value: function init(initOptions, instanceId, sdkMetaData) {
|
47
48
|
this.instanceId = instanceId;
|
48
49
|
this.sdkMetaData = sdkMetaData;
|
50
|
+
this.clientHeight = Math.max(window.innerHeight, window.visualViewport.height);
|
49
51
|
this.eventCenter = ServiceProvider.getInstance(instanceId).getService('EventCenter');
|
50
52
|
this.logService = ServiceProvider.getInstance(instanceId).getService('Log');
|
51
53
|
this.popupManager = new PopupManager();
|
@@ -156,6 +158,22 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
156
158
|
container === null || container === void 0 || container.classList.add("".concat(COMPONENT_CONTAINER_ID, "-hidden-").concat(this.displayInfo.platform));
|
157
159
|
}
|
158
160
|
}
|
161
|
+
}, {
|
162
|
+
key: "handleAccountFocus",
|
163
|
+
value: function handleAccountFocus(focus) {
|
164
|
+
var _window$visualViewpor, _window;
|
165
|
+
// 失焦时v2会走默认的sizeChange还原高度,这里仅移除监听
|
166
|
+
(_window$visualViewpor = window.visualViewport) === null || _window$visualViewpor === void 0 || _window$visualViewpor.removeEventListener('resize', this.focusResizeChange.bind(this));
|
167
|
+
(_window = window) === null || _window === void 0 || _window.removeEventListener('resize', this.focusResizeChange.bind(this));
|
168
|
+
// 只有聚焦才监听,失焦后移除,避免影响别的场景
|
169
|
+
if (focus) {
|
170
|
+
var _window$visualViewpor2;
|
171
|
+
// 监听页面visualViewport的高度变化,适用于主流机型更精准获取当前页面高度
|
172
|
+
(_window$visualViewpor2 = window.visualViewport) === null || _window$visualViewpor2 === void 0 || _window$visualViewpor2.addEventListener('resize', this.focusResizeChange.bind(this));
|
173
|
+
// 兼容visualViewport处理不到的场景,一般存在于老版本浏览器
|
174
|
+
window.addEventListener('resize', this.focusResizeChange.bind(this));
|
175
|
+
}
|
176
|
+
}
|
159
177
|
}, {
|
160
178
|
key: "addCapabilityToEventCenter",
|
161
179
|
value: function addCapabilityToEventCenter() {
|
@@ -194,7 +212,8 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
194
212
|
this.eventCenter.listen(EVENT.sizeChanged.name, function (data) {
|
195
213
|
_this.handleSizeChanged(_objectSpread({}, data));
|
196
214
|
});
|
197
|
-
this.eventCenter.listen(EVENT.showCloseButton.name, function () {
|
215
|
+
this.eventCenter.listen(EVENT.showCloseButton.name, function (data) {
|
216
|
+
_this.handleCloseButtonTheme(data.theme);
|
198
217
|
_this.changeCloseBtnVisibility(true);
|
199
218
|
});
|
200
219
|
this.eventCenter.listen(EVENT.hideCloseButton.name, function () {
|
@@ -206,6 +225,22 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
206
225
|
this.eventCenter.listen(EVENT.appHeartBeat.name, function () {
|
207
226
|
_this.handleAppHeartBeat();
|
208
227
|
});
|
228
|
+
/**
|
229
|
+
* 目前仅用于ESP V2的 web sdk
|
230
|
+
* 原因: 在账户输入页和OTP页面的h5场景下键盘弹起页面会有问题,iframe有固定高度,键盘弹起时应用层不会触发大小变化
|
231
|
+
* account账号输入页需要在sdk监听键盘弹起后高度变化并修改iframe及iframe外层容器,account需要按钮置底的放在键盘上面,必须修改高度而不是让容器定位
|
232
|
+
* otp页面需要在聚焦时给iframe及外层容器设置fixed定位,让页面不被弹起
|
233
|
+
* 目的: esp页面输入框聚焦/失焦后给sdk发送消息
|
234
|
+
*/
|
235
|
+
this.eventCenter.listen(EVENT.inputFocus.name, function (data) {
|
236
|
+
// 账号输入页需要修改iframe高度
|
237
|
+
if (data.source === 'ESP_V2' && data.type === 'account') {
|
238
|
+
_this.handleAccountFocus(data.focus);
|
239
|
+
// otp页面需要定位元素
|
240
|
+
} else if (data.source === 'ESP_V2' && data.type === 'otp') {
|
241
|
+
_this.focusScrollFixed(data.focus);
|
242
|
+
}
|
243
|
+
});
|
209
244
|
}
|
210
245
|
}, {
|
211
246
|
key: "addCapabilityToApiBusManager",
|
@@ -266,6 +301,48 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
266
301
|
this.webApp.style.height = "".concat(data.height, "px");
|
267
302
|
}
|
268
303
|
}
|
304
|
+
|
305
|
+
// 目前仅用于esp账号输入页聚焦
|
306
|
+
}, {
|
307
|
+
key: "focusResizeChange",
|
308
|
+
value: function focusResizeChange() {
|
309
|
+
var _window2;
|
310
|
+
// 计算出当前iframe应有的高度,需要和顶部留有距离
|
311
|
+
var webPageHeightRatio = 0.9;
|
312
|
+
// sdk层才能拿到当前键盘弹起后页面的高度
|
313
|
+
var height = ((_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.visualViewport) === null || _window2 === void 0 ? void 0 : _window2.height) || window.innerHeight;
|
314
|
+
height = height * webPageHeightRatio;
|
315
|
+
// 调用handleSizeChanged修改iframe高度
|
316
|
+
this.handleSizeChanged({
|
317
|
+
width: 0,
|
318
|
+
height: height
|
319
|
+
});
|
320
|
+
}
|
321
|
+
|
322
|
+
// 目前仅用于esp otp页面账号聚焦
|
323
|
+
}, {
|
324
|
+
key: "focusScrollFixed",
|
325
|
+
value: function focusScrollFixed(focus) {
|
326
|
+
// 获取iframe dom元素
|
327
|
+
var _this$displayInfo4 = this.displayInfo,
|
328
|
+
appendAliasContainerId = _this$displayInfo4.appendAliasContainerId,
|
329
|
+
selector = _this$displayInfo4.selector;
|
330
|
+
var cashierId = appendAliasContainerId ? "".concat(COMPONENT_CONTAINER_ID, "-").concat((selector === null || selector === void 0 ? void 0 : selector.indexOf('#')) === -1 ? selector : selector.slice(1)) : COMPONENT_CONTAINER_ID;
|
331
|
+
if (!this.webApp || !this.displayInfo) {
|
332
|
+
return;
|
333
|
+
}
|
334
|
+
var cashier = document.getElementById(cashierId);
|
335
|
+
if (!cashier) return;
|
336
|
+
// 输入框聚焦时修改定位信息和top距离
|
337
|
+
if (focus) {
|
338
|
+
cashier.style.position = 'fixed';
|
339
|
+
cashier.style.top = "".concat(this.clientHeight - cashier.clientHeight, "px");
|
340
|
+
} else {
|
341
|
+
// 失焦时移除定位信息
|
342
|
+
cashier.style.position = '';
|
343
|
+
cashier.style.top = '';
|
344
|
+
}
|
345
|
+
}
|
269
346
|
}, {
|
270
347
|
key: "handleAppHeartBeat",
|
271
348
|
value: function handleAppHeartBeat() {
|
@@ -323,6 +400,23 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
323
400
|
closeBlock === null || closeBlock === void 0 || closeBlock.classList.add("".concat(COMPONENT_CLOSE_MASK_BLOCK_ID, "-hidden"));
|
324
401
|
}
|
325
402
|
}
|
403
|
+
}, {
|
404
|
+
key: "handleCloseButtonTheme",
|
405
|
+
value: function handleCloseButtonTheme(theme) {
|
406
|
+
if (!theme) return;
|
407
|
+
var closeBlock = document.getElementById(COMPONENT_CLOSE_BLOCK_ID);
|
408
|
+
var closeButtonImg = closeBlock === null || closeBlock === void 0 ? void 0 : closeBlock.querySelector('img');
|
409
|
+
var maskCloseBlock = document.getElementById(COMPONENT_CLOSE_MASK_BLOCK_ID);
|
410
|
+
if (theme === 'light') {
|
411
|
+
closeButtonImg === null || closeButtonImg === void 0 || closeButtonImg.setAttribute('src', closeImgLight);
|
412
|
+
closeBlock === null || closeBlock === void 0 || closeBlock.classList.add("".concat(COMPONENT_CLOSE_BLOCK_ID, "-light"));
|
413
|
+
maskCloseBlock === null || maskCloseBlock === void 0 || maskCloseBlock.classList.add("".concat(COMPONENT_CLOSE_MASK_BLOCK_ID, "-light"));
|
414
|
+
} else {
|
415
|
+
closeButtonImg === null || closeButtonImg === void 0 || closeButtonImg.setAttribute('src', closeImg);
|
416
|
+
closeBlock === null || closeBlock === void 0 || closeBlock.classList.remove("".concat(COMPONENT_CLOSE_BLOCK_ID, "-light"));
|
417
|
+
maskCloseBlock === null || maskCloseBlock === void 0 || maskCloseBlock.classList.remove("".concat(COMPONENT_CLOSE_MASK_BLOCK_ID, "-light"));
|
418
|
+
}
|
419
|
+
}
|
326
420
|
}, {
|
327
421
|
key: "getWebApp",
|
328
422
|
value: function getWebApp() {
|
@@ -4,10 +4,10 @@ export default class PreloadHelper {
|
|
4
4
|
static isWebAppPreloaded: boolean;
|
5
5
|
static isSecuritySDKPreloaded: boolean;
|
6
6
|
private static securitySdkMap;
|
7
|
-
static preloadWebApp(productScene: ProductSceneEnum, paymentMethodCategoryType: PaymentMethodCategoryTypeEnum, environment?: string): void;
|
7
|
+
static preloadWebApp(productScene: ProductSceneEnum, paymentMethodCategoryType: PaymentMethodCategoryTypeEnum, environment?: string, useV2?: boolean): void;
|
8
8
|
static preloadSecuritySDK(product: ProductSceneEnum, securityRegion?: string): void;
|
9
9
|
static getSecuritySdk(scene: any): Security;
|
10
|
-
static buildWebAppPreloadUrl(productScene: ProductSceneEnum, paymentMethodCategoryType: PaymentMethodCategoryTypeEnum, environment: string): {
|
10
|
+
static buildWebAppPreloadUrl(productScene: ProductSceneEnum, paymentMethodCategoryType: PaymentMethodCategoryTypeEnum, environment: string, useV2?: boolean): {
|
11
11
|
preloadUrl: string;
|
12
12
|
containerId: string;
|
13
13
|
};
|
@@ -8,7 +8,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
8
8
|
import { sdkVersion } from "../../config";
|
9
9
|
import { createPreloadIframe } from "../service/container/utils";
|
10
10
|
import { ProductSceneEnum } from "../../types";
|
11
|
-
import { getWebAppUrl } from "../utils/web_app_url_utils";
|
11
|
+
import { getWebAppUrl, getWebAppV2Url } from "../utils/web_app_url_utils";
|
12
12
|
import { ProductInfoCacheUtil } from "../utils/payment_product_utils";
|
13
13
|
import { getWebAppVersion } from "./payment_context_utils";
|
14
14
|
import { getSecurityConfigStorageKey, getSecurityHost, getSecurityScene, Security } from "../../util/security";
|
@@ -22,12 +22,13 @@ var PreloadHelper = /*#__PURE__*/function () {
|
|
22
22
|
key: "preloadWebApp",
|
23
23
|
value: function preloadWebApp(productScene, paymentMethodCategoryType) {
|
24
24
|
var environment = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'prod';
|
25
|
+
var useV2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
25
26
|
try {
|
26
27
|
if (this.isWebAppPreloaded) {
|
27
28
|
console.log('[web-sdk] web app already preloaded');
|
28
29
|
return;
|
29
30
|
}
|
30
|
-
var _this$buildWebAppPrel = this.buildWebAppPreloadUrl(productScene, paymentMethodCategoryType, environment),
|
31
|
+
var _this$buildWebAppPrel = this.buildWebAppPreloadUrl(productScene, paymentMethodCategoryType, environment, useV2),
|
31
32
|
preloadUrl = _this$buildWebAppPrel.preloadUrl,
|
32
33
|
containerId = _this$buildWebAppPrel.containerId;
|
33
34
|
var preloadIframe = createPreloadIframe(containerId);
|
@@ -89,6 +90,7 @@ var PreloadHelper = /*#__PURE__*/function () {
|
|
89
90
|
}, {
|
90
91
|
key: "buildWebAppPreloadUrl",
|
91
92
|
value: function buildWebAppPreloadUrl(productScene, paymentMethodCategoryType, environment) {
|
93
|
+
var useV2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
92
94
|
var productSceneVersion = productScene === ProductSceneEnum.EASY_PAY ? '2.0' : '1.0';
|
93
95
|
var previousProductInfo = ProductInfoCacheUtil.getPreviousProductInfo(productScene);
|
94
96
|
if (previousProductInfo) {
|
@@ -101,14 +103,16 @@ var PreloadHelper = /*#__PURE__*/function () {
|
|
101
103
|
webAppVersion: ''
|
102
104
|
};
|
103
105
|
sdkMetaData.webAppVersion = getWebAppVersion(sdkMetaData);
|
104
|
-
var
|
106
|
+
var preloadUrlParams = {
|
105
107
|
environment: environment,
|
106
108
|
sdkMetaData: sdkMetaData,
|
107
109
|
paymentMethodCategoryType: paymentMethodCategoryType,
|
108
110
|
isPreload: true,
|
111
|
+
productScene: productScene,
|
109
112
|
productSceneVersion: productSceneVersion,
|
110
113
|
query: undefined
|
111
|
-
}
|
114
|
+
};
|
115
|
+
var preloadUrl = useV2 ? getWebAppV2Url(preloadUrlParams) : getWebAppUrl(preloadUrlParams);
|
112
116
|
return {
|
113
117
|
preloadUrl: preloadUrl,
|
114
118
|
containerId: containerId
|
@@ -1,5 +1,6 @@
|
|
1
|
-
import { DisplayTypeEnum, PaymentMethodCategoryTypeEnum } from '../../types';
|
1
|
+
import { DisplayTypeEnum, PaymentMethodCategoryTypeEnum, ProductSceneEnum, IPaymentSessionMetaData } from '../../types';
|
2
2
|
import { SDKMetaData } from '../index';
|
3
|
+
import { ESP_PAGE_NAME } from "../../constant/easysafepay";
|
3
4
|
/**
|
4
5
|
* Tell the SDK which version of the Web App to load.
|
5
6
|
* Sent by server inside paymentSession.
|
@@ -16,6 +17,16 @@ export interface WebAppMatchConfig {
|
|
16
17
|
mid?: string;
|
17
18
|
greyscale?: string;
|
18
19
|
}
|
20
|
+
/**
|
21
|
+
* Tell the SDK which Web App URL to load.
|
22
|
+
* Sent by server inside paymentSession.
|
23
|
+
*/
|
24
|
+
export interface WebAppUrlMatchConfig {
|
25
|
+
minSDKVersion: string;
|
26
|
+
url: string;
|
27
|
+
doubleFa: string;
|
28
|
+
mids?: string[];
|
29
|
+
}
|
19
30
|
export interface QueryParams {
|
20
31
|
displayType: DisplayTypeEnum;
|
21
32
|
locale: string;
|
@@ -27,20 +38,79 @@ export interface QueryParams {
|
|
27
38
|
export declare const getWebAppUrlInfo: (params: {
|
28
39
|
environment: string;
|
29
40
|
sdkMetaData: SDKMetaData;
|
41
|
+
productScene: ProductSceneEnum;
|
30
42
|
productSceneVersion: string;
|
31
43
|
paymentMethodCategoryType: PaymentMethodCategoryTypeEnum;
|
32
44
|
isPreload?: boolean;
|
33
45
|
query: QueryParams;
|
46
|
+
v2Url?: string;
|
34
47
|
}) => {
|
35
48
|
path: string;
|
36
49
|
locationSearch: string;
|
37
50
|
};
|
51
|
+
export declare const getWebAppV2Url: (params: {
|
52
|
+
environment: string;
|
53
|
+
sdkMetaData: SDKMetaData;
|
54
|
+
productScene: ProductSceneEnum;
|
55
|
+
productSceneVersion: string;
|
56
|
+
paymentMethodCategoryType: PaymentMethodCategoryTypeEnum;
|
57
|
+
isPreload?: boolean;
|
58
|
+
query: QueryParams;
|
59
|
+
mid?: string;
|
60
|
+
extendInfo?: string;
|
61
|
+
}) => string;
|
38
62
|
export declare const getWebAppUrl: (params: {
|
39
63
|
environment: string;
|
40
64
|
sdkMetaData: SDKMetaData;
|
65
|
+
productScene: ProductSceneEnum;
|
41
66
|
productSceneVersion: string;
|
42
67
|
paymentMethodCategoryType: PaymentMethodCategoryTypeEnum;
|
43
68
|
isPreload?: boolean;
|
44
69
|
query: QueryParams;
|
70
|
+
v2Url?: string;
|
45
71
|
}) => string;
|
46
72
|
export declare const parseWebAppMatchConfig: (extendInfo: string) => WebAppMatchConfig[];
|
73
|
+
export declare const parseWebAppUrlMatchConfig: (extendInfo: string) => WebAppUrlMatchConfig[];
|
74
|
+
/**
|
75
|
+
* Save the current checkout URL to localStorage for the specified product scene.
|
76
|
+
*
|
77
|
+
* @param productScene - The product scene for which the checkout URL should be saved.
|
78
|
+
*/
|
79
|
+
export declare const saveLocalCheckoutUrl: (productScene: ProductSceneEnum, url: string) => void;
|
80
|
+
/**
|
81
|
+
* 获取从外部动态下发的V2AppUrl.
|
82
|
+
*
|
83
|
+
* @param config - sessionData解析来的checkoutInfo列表.
|
84
|
+
*/
|
85
|
+
export declare const getMatchedWebAppV2Url: (productScene: ProductSceneEnum, mid: string, configs: WebAppUrlMatchConfig[], env: string) => string;
|
86
|
+
/**
|
87
|
+
* 获取ESP从sessionData.checkoutInfo内动态下发的Url.
|
88
|
+
*/
|
89
|
+
export declare const matchEasySafePayV2Url: (params: {
|
90
|
+
configs: WebAppUrlMatchConfig[];
|
91
|
+
mid: string;
|
92
|
+
env: string;
|
93
|
+
pageName: ESP_PAGE_NAME;
|
94
|
+
}) => string;
|
95
|
+
/**
|
96
|
+
* Retrieve the saved checkout URL from localStorage for the specified product scene.
|
97
|
+
* If no url is found, a default checkout url string is returned.
|
98
|
+
*
|
99
|
+
* @param productScene - The product scene for which the checkout URL should be retrieved.
|
100
|
+
*/
|
101
|
+
export declare const getLocalCheckoutUrl: (productScene: ProductSceneEnum, environment: string) => string;
|
102
|
+
/**
|
103
|
+
* Provide default checkout URL for the specified product scene.
|
104
|
+
* Return URL for 'EASY_PAY' product scene, while for other product scenes, it returns an empty string as they are not currently in use
|
105
|
+
*
|
106
|
+
* @param productScene - The product scene for which the default checkout URL should be provided.
|
107
|
+
*/
|
108
|
+
export declare const defaultCheckoutUrl: (productScene: ProductSceneEnum, environment?: string) => string;
|
109
|
+
/**
|
110
|
+
* V2应用EasySafePay 热更新兜底URL构建规则
|
111
|
+
* 1. 兜底URL版本与sdk版本保持一致
|
112
|
+
* 2. DEV环境下html新增版本前缀
|
113
|
+
**/
|
114
|
+
export declare const getDefaultEasySafePayPageUrl: (pageName: ESP_PAGE_NAME, env: string) => string;
|
115
|
+
/**通过sessionData获取doubleFa,于createComponent时传递给WEB应用*/
|
116
|
+
export declare const getDoubleFaUrlFromSession: (paymentSessionObj: IPaymentSessionMetaData, env?: string) => string;
|
@@ -1,25 +1,35 @@
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
2
|
+
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; }
|
3
|
+
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; }
|
2
4
|
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; }
|
3
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
4
6
|
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); }
|
5
|
-
import { ComponentSignEnum } from "../../types";
|
6
|
-
import { marmotMap } from "../../config";
|
7
|
+
import { ComponentSignEnum, ProductSceneEnum } from "../../types";
|
8
|
+
import { marmotMap, v2AppMarmotMap, sdkVersion } from "../../config";
|
7
9
|
import { queryParse, serialize } from "../../util";
|
10
|
+
import { compareVersion } from "../../util/versionCompare";
|
8
11
|
import { isDebugLog } from "../../util/debug";
|
9
|
-
|
12
|
+
import { ESP_PAGE_NAME } from "../../constant/easysafepay";
|
10
13
|
/**
|
11
14
|
* Tell the SDK which version of the Web App to load.
|
12
15
|
* Sent by server inside paymentSession.
|
13
16
|
*/
|
14
17
|
|
18
|
+
/**
|
19
|
+
* Tell the SDK which Web App URL to load.
|
20
|
+
* Sent by server inside paymentSession.
|
21
|
+
*/
|
22
|
+
|
15
23
|
export var getWebAppUrlInfo = function getWebAppUrlInfo(params) {
|
16
24
|
var environment = params.environment,
|
17
25
|
sdkMetaData = params.sdkMetaData,
|
26
|
+
productScene = params.productScene,
|
18
27
|
productSceneVersion = params.productSceneVersion,
|
19
28
|
paymentMethodCategoryType = params.paymentMethodCategoryType,
|
20
29
|
query = params.query,
|
21
|
-
isPreload = params.isPreload
|
22
|
-
|
30
|
+
isPreload = params.isPreload,
|
31
|
+
v2Url = params.v2Url;
|
32
|
+
var path = getAppPath(environment, sdkMetaData, productScene, productSceneVersion, paymentMethodCategoryType, v2Url);
|
23
33
|
var _queryParse = queryParse(),
|
24
34
|
_sandbox = _queryParse._sandbox,
|
25
35
|
_light_sandbox = _queryParse._light_sandbox,
|
@@ -57,6 +67,30 @@ export var getWebAppUrlInfo = function getWebAppUrlInfo(params) {
|
|
57
67
|
locationSearch: locationSearch
|
58
68
|
};
|
59
69
|
};
|
70
|
+
export var getWebAppV2Url = function getWebAppV2Url(params) {
|
71
|
+
var productScene = params.productScene,
|
72
|
+
isPreload = params.isPreload,
|
73
|
+
mid = params.mid,
|
74
|
+
extendInfo = params.extendInfo,
|
75
|
+
environment = params.environment;
|
76
|
+
var webAppUrlMatchConfig = parseWebAppUrlMatchConfig(extendInfo);
|
77
|
+
var v2Url = isPreload ? getLocalCheckoutUrl(productScene, environment) : getMatchedWebAppV2Url(productScene, mid, webAppUrlMatchConfig, environment);
|
78
|
+
var info = getWebAppUrlInfo(_objectSpread(_objectSpread({}, params), {}, {
|
79
|
+
v2Url: v2Url
|
80
|
+
}));
|
81
|
+
if (!isPreload && v2Url && info.path) {
|
82
|
+
console.log('[web-sdk] save web app, url: ', info.path);
|
83
|
+
saveLocalCheckoutUrl(productScene, info.path);
|
84
|
+
}
|
85
|
+
var webAppUrl;
|
86
|
+
if (info.path.indexOf('?') !== -1) {
|
87
|
+
webAppUrl = "".concat(info.path, "&").concat(info.locationSearch);
|
88
|
+
} else {
|
89
|
+
webAppUrl = "".concat(info.path, "?").concat(info.locationSearch);
|
90
|
+
}
|
91
|
+
console.log('[web-sdk] web app, url: ', webAppUrl);
|
92
|
+
return webAppUrl;
|
93
|
+
};
|
60
94
|
export var getWebAppUrl = function getWebAppUrl(params) {
|
61
95
|
var info = getWebAppUrlInfo(params);
|
62
96
|
var webAppUrl;
|
@@ -70,8 +104,10 @@ export var getWebAppUrl = function getWebAppUrl(params) {
|
|
70
104
|
var getAppPath = function getAppPath() {
|
71
105
|
var environment = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'prod';
|
72
106
|
var sdkMetaData = arguments.length > 1 ? arguments[1] : undefined;
|
73
|
-
var
|
74
|
-
var
|
107
|
+
var productScene = arguments.length > 2 ? arguments[2] : undefined;
|
108
|
+
var productSceneVersion = arguments.length > 3 ? arguments[3] : undefined;
|
109
|
+
var paymentMethodCategoryType = arguments.length > 4 ? arguments[4] : undefined;
|
110
|
+
var v2Url = arguments.length > 5 ? arguments[5] : undefined;
|
75
111
|
var _ref = queryParse() || {},
|
76
112
|
urlTestHost = _ref.host;
|
77
113
|
// only for test while testurl?host=https://xxxxx.test.html
|
@@ -81,7 +117,12 @@ var getAppPath = function getAppPath() {
|
|
81
117
|
var validProductSceneVersion = getValidProductSceneVersion(sdkMetaData.productScene, productSceneVersion, paymentMethodCategoryType);
|
82
118
|
var productSceneWithPaymentMethodCategoryType = "".concat(sdkMetaData.productScene, "_").concat(paymentMethodCategoryType);
|
83
119
|
var webAppVersion = sdkMetaData.webAppVersion;
|
84
|
-
|
120
|
+
switch (productScene) {
|
121
|
+
case ProductSceneEnum.EASY_PAY:
|
122
|
+
return v2Url !== null && v2Url !== void 0 ? v2Url : defaultCheckoutUrl(productScene, environment);
|
123
|
+
default:
|
124
|
+
return "".concat(marmotMap[environment], "/").concat(productSceneWithPaymentMethodCategoryType, "/").concat(validProductSceneVersion, "/index.").concat(webAppVersion, ".html");
|
125
|
+
}
|
85
126
|
};
|
86
127
|
export var parseWebAppMatchConfig = function parseWebAppMatchConfig(extendInfo) {
|
87
128
|
if (!extendInfo) {
|
@@ -96,6 +137,18 @@ export var parseWebAppMatchConfig = function parseWebAppMatchConfig(extendInfo)
|
|
96
137
|
return [];
|
97
138
|
}
|
98
139
|
};
|
140
|
+
export var parseWebAppUrlMatchConfig = function parseWebAppUrlMatchConfig(extendInfo) {
|
141
|
+
if (!extendInfo) {
|
142
|
+
return [];
|
143
|
+
}
|
144
|
+
try {
|
145
|
+
var extendInfoJson = JSON.parse(extendInfo);
|
146
|
+
return extendInfoJson === null || extendInfoJson === void 0 ? void 0 : extendInfoJson.checkoutInfo;
|
147
|
+
} catch (error) {
|
148
|
+
console.error('Parse the url config for Web app failed#', error);
|
149
|
+
return [];
|
150
|
+
}
|
151
|
+
};
|
99
152
|
var getValidProductSceneVersion = function getValidProductSceneVersion(productScene, productSceneVer, paymentMethodCategoryType) {
|
100
153
|
var _supportMapping;
|
101
154
|
var supportMapping = (_supportMapping = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_supportMapping, ComponentSignEnum.NONE, ['']), ComponentSignEnum.AUTO_DEBIT_WALLET, ['1.0']), ComponentSignEnum.AUTO_DEBIT_PAY_WALLET, ['']), ComponentSignEnum.CASHIER_PAYMENT_BANK, ['1.0']), ComponentSignEnum.CASHIER_PAYMENT_CARD, ['1.0']), ComponentSignEnum.CASHIER_PAYMENT_APM, ['1.0']), ComponentSignEnum.EASY_PAY_WALLET, ['1.0', '2.0']), ComponentSignEnum.EASY_PAY_APM, ['2.0']), ComponentSignEnum.VAULTING_CARD, ['1.0']), ComponentSignEnum.ELEMENT_PAYMENT, ['1.0']), _defineProperty(_defineProperty(_supportMapping, ComponentSignEnum.ELEMENT_ADDRESS, ['1.0']), ComponentSignEnum.CHECKOUT_PAYMENT, ['1.0']));
|
@@ -109,4 +162,158 @@ var getValidProductSceneVersion = function getValidProductSceneVersion(productSc
|
|
109
162
|
});
|
110
163
|
var latestVersion = targetVersions[targetVersions.length - 1];
|
111
164
|
return isSupport ? productSceneVer : latestVersion;
|
165
|
+
};
|
166
|
+
var KEY_CHECKOUT_URL = "web_url_";
|
167
|
+
|
168
|
+
/**
|
169
|
+
* Save the current checkout URL to localStorage for the specified product scene.
|
170
|
+
*
|
171
|
+
* @param productScene - The product scene for which the checkout URL should be saved.
|
172
|
+
*/
|
173
|
+
export var saveLocalCheckoutUrl = function saveLocalCheckoutUrl(productScene, url) {
|
174
|
+
var key = KEY_CHECKOUT_URL + productScene;
|
175
|
+
localStorage.setItem(key, url);
|
176
|
+
};
|
177
|
+
|
178
|
+
/**
|
179
|
+
* 获取从外部动态下发的V2AppUrl.
|
180
|
+
*
|
181
|
+
* @param config - sessionData解析来的checkoutInfo列表.
|
182
|
+
*/
|
183
|
+
export var getMatchedWebAppV2Url = function getMatchedWebAppV2Url(productScene) {
|
184
|
+
var mid = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
185
|
+
var configs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
186
|
+
var env = arguments.length > 3 ? arguments[3] : undefined;
|
187
|
+
switch (productScene) {
|
188
|
+
case ProductSceneEnum.EASY_PAY:
|
189
|
+
return matchEasySafePayV2Url({
|
190
|
+
configs: configs,
|
191
|
+
mid: mid,
|
192
|
+
env: env,
|
193
|
+
pageName: ESP_PAGE_NAME.SDK_PORTAL
|
194
|
+
});
|
195
|
+
default:
|
196
|
+
return defaultCheckoutUrl(productScene, env);
|
197
|
+
}
|
198
|
+
};
|
199
|
+
|
200
|
+
/**
|
201
|
+
* 获取ESP从sessionData.checkoutInfo内动态下发的Url.
|
202
|
+
*/
|
203
|
+
export var matchEasySafePayV2Url = function matchEasySafePayV2Url(params) {
|
204
|
+
var _params$configs = params.configs,
|
205
|
+
configs = _params$configs === void 0 ? [] : _params$configs,
|
206
|
+
_params$mid = params.mid,
|
207
|
+
mid = _params$mid === void 0 ? '' : _params$mid,
|
208
|
+
env = params.env,
|
209
|
+
pageName = params.pageName;
|
210
|
+
var matchURLByMid = function matchURLByMid() {
|
211
|
+
var sortedConfigs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
212
|
+
var targetConfigEntry = sortedConfigs.find(function (configEntry) {
|
213
|
+
var _configEntry$mids;
|
214
|
+
var isMatchMid = !!(configEntry !== null && configEntry !== void 0 && (_configEntry$mids = configEntry.mids) !== null && _configEntry$mids !== void 0 && _configEntry$mids.includes(mid));
|
215
|
+
var isMatchVersion = compareVersion(sdkVersion, configEntry.minSDKVersion) >= 0;
|
216
|
+
if (isMatchMid && isMatchVersion) {
|
217
|
+
return configEntry;
|
218
|
+
}
|
219
|
+
});
|
220
|
+
return targetConfigEntry;
|
221
|
+
};
|
222
|
+
var matchURLBySDKVersion = function matchURLBySDKVersion() {
|
223
|
+
var sortedConfigs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
224
|
+
var targetConfigEntry = sortedConfigs.find(function (configEntry) {
|
225
|
+
var isCommonConfig = (configEntry === null || configEntry === void 0 ? void 0 : configEntry.mids) === undefined;
|
226
|
+
var isMatchVersion = compareVersion(sdkVersion, configEntry.minSDKVersion) >= 0;
|
227
|
+
if (isCommonConfig && isMatchVersion) {
|
228
|
+
return configEntry;
|
229
|
+
}
|
230
|
+
});
|
231
|
+
return targetConfigEntry;
|
232
|
+
};
|
233
|
+
var matchConfig = function matchConfig() {
|
234
|
+
// 按SDK版本降排序
|
235
|
+
var sortedConfig = configs.sort(function (a, b) {
|
236
|
+
return compareVersion(b.minSDKVersion, a.minSDKVersion);
|
237
|
+
});
|
238
|
+
|
239
|
+
// 匹配仅针对部分商户生效(mid),且符合版本号的URL
|
240
|
+
var matchedURLByMid = matchURLByMid(sortedConfig);
|
241
|
+
if (matchedURLByMid) return matchedURLByMid;
|
242
|
+
|
243
|
+
// 匹配对所有商户生效(无mid),且符合版本号的URL
|
244
|
+
var matchedURLBySDKVersion = matchURLBySDKVersion(sortedConfig);
|
245
|
+
if (matchedURLBySDKVersion) return matchedURLBySDKVersion;
|
246
|
+
};
|
247
|
+
var defaultEspUrl = getDefaultEasySafePayPageUrl(pageName, env);
|
248
|
+
|
249
|
+
// 匹配config
|
250
|
+
var config = matchConfig();
|
251
|
+
if (!config) return defaultEspUrl;
|
252
|
+
|
253
|
+
// 根据pageName匹配URL
|
254
|
+
if (pageName == ESP_PAGE_NAME.SDK_PORTAL) return (config === null || config === void 0 ? void 0 : config.url) || defaultEspUrl;
|
255
|
+
if (pageName == ESP_PAGE_NAME.DOUBLE_FA) return (config === null || config === void 0 ? void 0 : config.doubleFa) || defaultEspUrl;
|
256
|
+
return defaultEspUrl;
|
257
|
+
};
|
258
|
+
|
259
|
+
/**
|
260
|
+
* Retrieve the saved checkout URL from localStorage for the specified product scene.
|
261
|
+
* If no url is found, a default checkout url string is returned.
|
262
|
+
*
|
263
|
+
* @param productScene - The product scene for which the checkout URL should be retrieved.
|
264
|
+
*/
|
265
|
+
export var getLocalCheckoutUrl = function getLocalCheckoutUrl(productScene, environment) {
|
266
|
+
var key = KEY_CHECKOUT_URL + productScene;
|
267
|
+
var previousCheckoutUrl = localStorage.getItem(key);
|
268
|
+
return previousCheckoutUrl !== null && previousCheckoutUrl !== void 0 ? previousCheckoutUrl : defaultCheckoutUrl(productScene, environment);
|
269
|
+
};
|
270
|
+
|
271
|
+
/**
|
272
|
+
* Provide default checkout URL for the specified product scene.
|
273
|
+
* Return URL for 'EASY_PAY' product scene, while for other product scenes, it returns an empty string as they are not currently in use
|
274
|
+
*
|
275
|
+
* @param productScene - The product scene for which the default checkout URL should be provided.
|
276
|
+
*/
|
277
|
+
export var defaultCheckoutUrl = function defaultCheckoutUrl(productScene) {
|
278
|
+
var environment = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "prod";
|
279
|
+
switch (productScene) {
|
280
|
+
case ProductSceneEnum.EASY_PAY:
|
281
|
+
return getDefaultEasySafePayPageUrl(ESP_PAGE_NAME.SDK_PORTAL, environment);
|
282
|
+
default:
|
283
|
+
return '';
|
284
|
+
}
|
285
|
+
};
|
286
|
+
|
287
|
+
/**
|
288
|
+
* V2应用EasySafePay 热更新兜底URL构建规则
|
289
|
+
* 1. 兜底URL版本与sdk版本保持一致
|
290
|
+
* 2. DEV环境下html新增版本前缀
|
291
|
+
**/
|
292
|
+
export var getDefaultEasySafePayPageUrl = function getDefaultEasySafePayPageUrl(pageName, env) {
|
293
|
+
// 生成的URL EXAMPLE:
|
294
|
+
// const DEFAULT_DOUBLE_FA_URL_MAPPING = {
|
295
|
+
// local: 'http://page.alipay.net/page/antom-web-checkout-v2/easysafepay/1.36.0/pages/double-fa/index-1.36.0.html',
|
296
|
+
// dev: 'http://page.alipay.net/page/antom-web-checkout-v2/easysafepay/1.36.0/pages/double-fa/index-1.36.0.html',
|
297
|
+
// sit: 'http://page.test.alipay.net/page/antom-web-checkout-v2/easysafepay/1.36.0/pages/double-fa/index.html',
|
298
|
+
// pre: 'https://pre.ac.alipay.com/page/antom-web-checkout-v2/easysafepay/1.36.0/pages/double-fa/index.html',
|
299
|
+
// prod: 'https://checkout.antom.com/easysafepay/1.36.0/pages/double-fa/index.html',
|
300
|
+
// };
|
301
|
+
var environment = env || "prod";
|
302
|
+
if (environment === "dev") return "".concat(v2AppMarmotMap[environment], "/easysafepay/").concat(sdkVersion, "/pages/").concat(pageName, "/index-").concat(sdkVersion, ".html");else return "".concat(v2AppMarmotMap[environment], "/easysafepay/").concat(sdkVersion, "/pages/").concat(pageName, "/index.html");
|
303
|
+
};
|
304
|
+
|
305
|
+
/**通过sessionData获取doubleFa,于createComponent时传递给WEB应用*/
|
306
|
+
//TODO 后续需要构造一个类,专门用于构造&存储web应用url
|
307
|
+
export var getDoubleFaUrlFromSession = function getDoubleFaUrlFromSession(paymentSessionObj) {
|
308
|
+
var env = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "prod";
|
309
|
+
var mid = paymentSessionObj.clientId;
|
310
|
+
var extendInfo = paymentSessionObj.extendInfo;
|
311
|
+
var configs = parseWebAppUrlMatchConfig(extendInfo);
|
312
|
+
var url = matchEasySafePayV2Url({
|
313
|
+
configs: configs,
|
314
|
+
mid: mid,
|
315
|
+
env: env,
|
316
|
+
pageName: ESP_PAGE_NAME.DOUBLE_FA
|
317
|
+
});
|
318
|
+
return url;
|
112
319
|
};
|
package/esm/index.js
CHANGED
@@ -271,7 +271,7 @@ export var AMSEasyPay = /*#__PURE__*/function () {
|
|
271
271
|
securityRegion: 'SG',
|
272
272
|
environment: 'prod'
|
273
273
|
};
|
274
|
-
PreloadHelper.preloadWebApp(ProductSceneEnum.EASY_PAY, PaymentMethodCategoryTypeEnum.WALLET, options.environment);
|
274
|
+
PreloadHelper.preloadWebApp(ProductSceneEnum.EASY_PAY, PaymentMethodCategoryTypeEnum.WALLET, options.environment, true);
|
275
275
|
}
|
276
276
|
}]);
|
277
277
|
return AMSEasyPay;
|
@@ -15,7 +15,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
15
15
|
* 1. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE; and
|
16
16
|
* 2. If applicable, the use of the Software is also subject to the terms and conditions of any non-disclosure agreement signed by you and the relevant Ant Group entity.
|
17
17
|
*/
|
18
|
-
import {
|
18
|
+
import { v2AppMarmotMap, marmotMap, sdkVersion } from "../../config/index";
|
19
19
|
import { ComponentSignEnum, ComponentSignEnumV2 } from "../../types";
|
20
20
|
import { isDebugLog } from "../../util/debug";
|
21
21
|
import { queryParse, serialize } from "../../util/index";
|
@@ -103,7 +103,7 @@ export var getAppPath = function getAppPath() {
|
|
103
103
|
}
|
104
104
|
// 地址应用特殊处理
|
105
105
|
if (componentSign === ComponentSignEnum.ELEMENT_ADDRESS) {
|
106
|
-
return "".concat(
|
106
|
+
return "".concat(v2AppMarmotMap[environment], "/element-address/").concat(finalAppVersion, "/pages/address/index.html");
|
107
107
|
}
|
108
108
|
// element应用特殊处理
|
109
109
|
if (_toConsumableArray(Object.values(ComponentSignEnumV2)).includes(componentSign)) {
|
@@ -117,9 +117,9 @@ export var getAppPath = function getAppPath() {
|
|
117
117
|
}
|
118
118
|
if (isExpressCheckout) {
|
119
119
|
// express_checkout模式走单独映射
|
120
|
-
return "".concat(
|
120
|
+
return "".concat(v2AppMarmotMap[environment], "/elements/").concat(finalAppVersion, "/pages/express_checkout/index.html");
|
121
121
|
} else {
|
122
|
-
return "".concat(
|
122
|
+
return "".concat(v2AppMarmotMap[environment], "/elements/").concat(finalAppVersion, "/pages/").concat(productScene.toLowerCase(), "/index.html");
|
123
123
|
}
|
124
124
|
}
|
125
125
|
return "".concat(marmotMap[environment], "/").concat(componentSign, "/").concat(finalProductSceneVersion, "/index.").concat(finalAppVersion, ".html");
|
@@ -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 {
|