@alipay/ams-checkout 1.37.0 → 1.39.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/popupWindow.style.d.ts +4 -1
- package/esm/component/popupWindow.style.js +33 -1
- package/esm/config/index.d.ts +7 -7
- package/esm/config/index.js +7 -7
- package/esm/constant/index.d.ts +22 -2
- package/esm/constant/index.js +24 -5
- package/esm/core/component/element/elementController/index.d.ts +1 -1
- package/esm/core/component/element/elementController/index.js +29 -20
- package/esm/core/component/element/index.d.ts +0 -1
- package/esm/core/component/element/index.js +3 -6
- package/esm/core/component/element/type.d.ts +32 -33
- package/esm/core/component/element/type.js +20 -12
- package/esm/core/component/element/util.d.ts +9 -6
- package/esm/core/component/element/util.js +28 -29
- package/esm/core/component/oldElement/type.d.ts +3 -0
- package/esm/core/instance/index.js +1 -1
- package/esm/foundation/service/container/index.d.ts +2 -0
- package/esm/foundation/service/container/index.js +46 -23
- package/esm/foundation/service/container/popup.d.ts +9 -6
- package/esm/foundation/service/container/popup.js +3 -1
- package/esm/foundation/utils/redirect_utils.js +34 -18
- package/esm/plugin/component/index.js +1 -1
- package/esm/types/index.d.ts +11 -1
- package/esm/types/index.js +2 -1
- package/esm/util/redirect.js +1 -1
- package/package.json +25 -3
@@ -13,17 +13,28 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
13
13
|
import { ERRORMESSAGE } from "../../../constant";
|
14
14
|
import { IElementStatus } from "../../../foundation";
|
15
15
|
import { getIframeUrl } from "../../../plugin/component/cashierApp";
|
16
|
-
import { DisplayTypeEnum, RedirectType, TargetEnum, terminalTypeEnum } from "../../../types";
|
16
|
+
import { DisplayTypeEnum, eventCodeEnum, RedirectType, TargetEnum, terminalTypeEnum } from "../../../types";
|
17
17
|
import { device } from "../../../util/index";
|
18
18
|
import CallApp from "../../../util/intl-callapp/es/main";
|
19
19
|
import { getComponentSign, parseSessionData } from "../index";
|
20
|
-
import { ELEMENT_ENVIRONMENT } from "./type";
|
21
|
-
var formatElementOption = function formatElementOption(options) {
|
20
|
+
import { ELEMENT_ENVIRONMENT, EventCallbackCode } from "./type";
|
21
|
+
export var formatElementOption = function formatElementOption(options) {
|
22
22
|
var environment = options.environment;
|
23
23
|
return _objectSpread(_objectSpread({}, options), {}, {
|
24
24
|
environment: (environment || ELEMENT_ENVIRONMENT.PROD).toLocaleLowerCase()
|
25
25
|
});
|
26
26
|
};
|
27
|
+
export var validateElementOption = function validateElementOption(options) {
|
28
|
+
if (!options.sessionData) {
|
29
|
+
var _options$onEventCallb;
|
30
|
+
options === null || options === void 0 || (_options$onEventCallb = options.onEventCallback) === null || _options$onEventCallb === void 0 || _options$onEventCallb.call(options, {
|
31
|
+
code: EventCallbackCode.SDK_CREATE_COMPONENT_ERROR,
|
32
|
+
message: 'sessionData is empty'
|
33
|
+
});
|
34
|
+
return false;
|
35
|
+
}
|
36
|
+
return true;
|
37
|
+
};
|
27
38
|
|
28
39
|
/**
|
29
40
|
* 校验渲染条件
|
@@ -138,6 +149,7 @@ export function generateIframeSrc(_ref3) {
|
|
138
149
|
export function handleRedirect(data) {
|
139
150
|
var _data$isDestroy, _data$isCallApp, _data$callAppDetectSu;
|
140
151
|
var fromFastSdk = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
152
|
+
var eventCallback = arguments.length > 2 ? arguments[2] : undefined;
|
141
153
|
console.log('local payment sdk new element redirect arg ----', this);
|
142
154
|
var _data = typeof data === 'string' ? {
|
143
155
|
normalUrl: data
|
@@ -171,10 +183,10 @@ export function handleRedirect(data) {
|
|
171
183
|
// .send();
|
172
184
|
var successCallback = function successCallback(type, url, durationInSeconds) {
|
173
185
|
// TODO
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
186
|
+
eventCallback({
|
187
|
+
code: eventCodeEnum.SDK_CALL_URL_SUCCESS,
|
188
|
+
message: "Successfully opened the app,".concat(type, ": ").concat(url)
|
189
|
+
});
|
178
190
|
var extra = {
|
179
191
|
redirectInfo: JSON.stringify(_data),
|
180
192
|
openType: type,
|
@@ -194,10 +206,10 @@ export function handleRedirect(data) {
|
|
194
206
|
// .send();
|
195
207
|
};
|
196
208
|
var failCallback = function failCallback(type, url, durationInSeconds) {
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
209
|
+
eventCallback({
|
210
|
+
code: eventCodeEnum.SDK_LAUNCH_PAYMENT_APP_ERROR,
|
211
|
+
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)
|
212
|
+
});
|
201
213
|
var extra = {
|
202
214
|
redirectInfo: JSON.stringify(_data),
|
203
215
|
openType: type,
|
@@ -253,21 +265,9 @@ export function handleRedirect(data) {
|
|
253
265
|
return;
|
254
266
|
}
|
255
267
|
redirect({
|
256
|
-
applinkUrl: _data === null || _data === void 0 ? void 0 : _data.applinkUrl
|
257
|
-
|
258
|
-
|
259
|
-
}).catch(function () {
|
260
|
-
if (_data !== null && _data !== void 0 && _data.applinkUrl) failCallback(RedirectType.ApplinkUrl, _data === null || _data === void 0 ? void 0 : _data.applinkUrl);
|
261
|
-
return redirect({
|
262
|
-
schemeUrl: _data === null || _data === void 0 ? void 0 : _data.schemeUrl
|
263
|
-
});
|
264
|
-
}).then(function () {
|
265
|
-
successCallback(RedirectType.SchemeUrl, _data === null || _data === void 0 ? void 0 : _data.schemeUrl);
|
266
|
-
}).catch(function () {
|
267
|
-
if (_data !== null && _data !== void 0 && _data.schemeUrl) failCallback(RedirectType.SchemeUrl, _data === null || _data === void 0 ? void 0 : _data.schemeUrl);
|
268
|
-
return redirect({
|
269
|
-
normalUrl: _data === null || _data === void 0 ? void 0 : _data.normalUrl
|
270
|
-
});
|
268
|
+
applinkUrl: _data === null || _data === void 0 ? void 0 : _data.applinkUrl,
|
269
|
+
schemeUrl: _data === null || _data === void 0 ? void 0 : _data.schemeUrl,
|
270
|
+
normalUrl: _data === null || _data === void 0 ? void 0 : _data.normalUrl
|
271
271
|
}).then(function () {
|
272
272
|
successCallback(RedirectType.NormalUrl, _data === null || _data === void 0 ? void 0 : _data.normalUrl);
|
273
273
|
}).catch(function () {
|
@@ -288,7 +288,7 @@ export function redirect(data) {
|
|
288
288
|
window.location.href = normalUrl;
|
289
289
|
return;
|
290
290
|
}
|
291
|
-
reject(ERRORMESSAGE.
|
291
|
+
reject(ERRORMESSAGE.SDK_LAUNCH_PAYMENT_APP_ERROR.CALL_APP_URL_ERROR);
|
292
292
|
};
|
293
293
|
var callAppFunc = function callAppFunc() {
|
294
294
|
if (!schemeUrl && !applinkUrl) {
|
@@ -474,5 +474,4 @@ export var isElementPad = function isElementPad() {
|
|
474
474
|
};
|
475
475
|
export var isElementPC = function isElementPC() {
|
476
476
|
return !isElementMobile();
|
477
|
-
};
|
478
|
-
export { formatElementOption };
|
477
|
+
};
|
@@ -10,6 +10,9 @@ export declare enum ElementPaymentEvent {
|
|
10
10
|
SIZE_CHANGE = "onSizeChange",
|
11
11
|
LAUNCH = "onLaunch",
|
12
12
|
CALLBACK = "callback",
|
13
|
+
/**
|
14
|
+
* @deprecated 已废弃 请使用eventCallback
|
15
|
+
*/
|
13
16
|
SEND_MUITI_APP_EVENT_TO_SDK = "sendMuitiAppEventToSdk",
|
14
17
|
LOG = "log",
|
15
18
|
HANDLE_PAYMENT = "handlePayment"
|
@@ -435,7 +435,7 @@ var AMSSDK = /*#__PURE__*/function () {
|
|
435
435
|
window.location.href = normalUrl;
|
436
436
|
return;
|
437
437
|
}
|
438
|
-
reject(ERRORMESSAGE.
|
438
|
+
reject(ERRORMESSAGE.SDK_LAUNCH_PAYMENT_APP_ERROR.CALL_APP_URL_ERROR);
|
439
439
|
};
|
440
440
|
var callAppFunc = function callAppFunc() {
|
441
441
|
if (!schemeUrl && !applinkUrl) {
|
@@ -35,5 +35,7 @@ export declare class ContainerService implements Service {
|
|
35
35
|
private changeCloseBtnVisibility;
|
36
36
|
private handleMaskCloseBtnShow;
|
37
37
|
private handleCloseButtonTheme;
|
38
|
+
private handlePopupWindow;
|
39
|
+
private handlePopWindow;
|
38
40
|
getWebApp(): HTMLIFrameElement;
|
39
41
|
}
|
@@ -195,19 +195,7 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
195
195
|
});
|
196
196
|
});
|
197
197
|
this.eventCenter.listen(EVENT.popupWindow.name, function (data) {
|
198
|
-
|
199
|
-
if (data.paymentElementOldModel) return;
|
200
|
-
insertStyleSheet();
|
201
|
-
_this.popupManager.popup(_objectSpread({
|
202
|
-
platform: (_this$displayInfo2 = _this.displayInfo) === null || _this$displayInfo2 === void 0 ? void 0 : _this$displayInfo2.platform
|
203
|
-
}, data)).then(function () {
|
204
|
-
_this.eventCenter.addIFrame(_this.popupManager.popupApp);
|
205
|
-
}).catch(function (error) {
|
206
|
-
_this.logService.logError({
|
207
|
-
title: (error === null || error === void 0 ? void 0 : error.title) || 'sdk_error_create_pop_up'
|
208
|
-
}, error);
|
209
|
-
_this.eventCenter.emit(EVENT.error.name, ERRORMESSAGE.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT);
|
210
|
-
});
|
198
|
+
_this.handlePopupWindow(data);
|
211
199
|
});
|
212
200
|
this.eventCenter.listen(EVENT.popWindow.name, function () {
|
213
201
|
_this.popupManager.pop();
|
@@ -216,7 +204,7 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
216
204
|
_this.handleSizeChanged(_objectSpread({}, data));
|
217
205
|
});
|
218
206
|
this.eventCenter.listen(EVENT.showCloseButton.name, function (data) {
|
219
|
-
_this.handleCloseButtonTheme(data.
|
207
|
+
_this.handleCloseButtonTheme(data.style);
|
220
208
|
_this.changeCloseBtnVisibility(true);
|
221
209
|
});
|
222
210
|
this.eventCenter.listen(EVENT.hideCloseButton.name, function () {
|
@@ -266,9 +254,9 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
266
254
|
}, {
|
267
255
|
key: "handleSizeChanged",
|
268
256
|
value: function handleSizeChanged(data) {
|
269
|
-
var _this$
|
270
|
-
appendAliasContainerId = _this$
|
271
|
-
selector = _this$
|
257
|
+
var _this$displayInfo2 = this.displayInfo,
|
258
|
+
appendAliasContainerId = _this$displayInfo2.appendAliasContainerId,
|
259
|
+
selector = _this$displayInfo2.selector;
|
272
260
|
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;
|
273
261
|
if (!this.webApp || !this.displayInfo) {
|
274
262
|
return;
|
@@ -329,9 +317,9 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
329
317
|
key: "focusScrollFixed",
|
330
318
|
value: function focusScrollFixed(focus) {
|
331
319
|
// 获取iframe dom元素
|
332
|
-
var _this$
|
333
|
-
appendAliasContainerId = _this$
|
334
|
-
selector = _this$
|
320
|
+
var _this$displayInfo3 = this.displayInfo,
|
321
|
+
appendAliasContainerId = _this$displayInfo3.appendAliasContainerId,
|
322
|
+
selector = _this$displayInfo3.selector;
|
335
323
|
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;
|
336
324
|
if (!this.webApp || !this.displayInfo) {
|
337
325
|
return;
|
@@ -407,12 +395,12 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
407
395
|
}
|
408
396
|
}, {
|
409
397
|
key: "handleCloseButtonTheme",
|
410
|
-
value: function handleCloseButtonTheme(
|
411
|
-
if (!
|
398
|
+
value: function handleCloseButtonTheme(style) {
|
399
|
+
if (!style) return;
|
412
400
|
var closeBlock = document.getElementById(COMPONENT_CLOSE_BLOCK_ID);
|
413
401
|
var closeButtonImg = closeBlock === null || closeBlock === void 0 ? void 0 : closeBlock.querySelector('img');
|
414
402
|
var maskCloseBlock = document.getElementById(COMPONENT_CLOSE_MASK_BLOCK_ID);
|
415
|
-
if (
|
403
|
+
if (style === 'light') {
|
416
404
|
closeButtonImg === null || closeButtonImg === void 0 || closeButtonImg.setAttribute('src', closeImgLight);
|
417
405
|
closeBlock === null || closeBlock === void 0 || closeBlock.classList.add("".concat(COMPONENT_CLOSE_BLOCK_ID, "-light"));
|
418
406
|
maskCloseBlock === null || maskCloseBlock === void 0 || maskCloseBlock.classList.add("".concat(COMPONENT_CLOSE_MASK_BLOCK_ID, "-light"));
|
@@ -422,6 +410,41 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
422
410
|
maskCloseBlock === null || maskCloseBlock === void 0 || maskCloseBlock.classList.remove("".concat(COMPONENT_CLOSE_MASK_BLOCK_ID, "-light"));
|
423
411
|
}
|
424
412
|
}
|
413
|
+
|
414
|
+
// SDK主动打开弹框
|
415
|
+
}, {
|
416
|
+
key: "handlePopupWindow",
|
417
|
+
value: function handlePopupWindow(data) {
|
418
|
+
var _this$displayInfo4,
|
419
|
+
_this3 = this;
|
420
|
+
if (data.paymentElementOldModel) return;
|
421
|
+
insertStyleSheet();
|
422
|
+
this.popupManager.popup(_objectSpread({
|
423
|
+
platform: (_this$displayInfo4 = this.displayInfo) === null || _this$displayInfo4 === void 0 ? void 0 : _this$displayInfo4.platform,
|
424
|
+
showCloseOnLoading: data.showCloseOnLoading,
|
425
|
+
onCloseOnLoading: function onCloseOnLoading() {
|
426
|
+
return _this3.handlePopWindow(data);
|
427
|
+
}
|
428
|
+
}, data)).then(function () {
|
429
|
+
_this3.eventCenter.addIFrame(_this3.popupManager.popupApp);
|
430
|
+
}).catch(function (error) {
|
431
|
+
_this3.logService.logError({
|
432
|
+
title: (error === null || error === void 0 ? void 0 : error.title) || 'sdk_error_create_pop_up'
|
433
|
+
}, error);
|
434
|
+
_this3.eventCenter.emit(EVENT.error.name, ERRORMESSAGE.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT);
|
435
|
+
});
|
436
|
+
}
|
437
|
+
|
438
|
+
// SDK主动关闭弹框
|
439
|
+
}, {
|
440
|
+
key: "handlePopWindow",
|
441
|
+
value: function handlePopWindow(data) {
|
442
|
+
this.popupManager.pop();
|
443
|
+
this.eventCenter.dispatchToApp({
|
444
|
+
event: EVENT.popWindow.name,
|
445
|
+
data: data
|
446
|
+
});
|
447
|
+
}
|
425
448
|
}, {
|
426
449
|
key: "getWebApp",
|
427
450
|
value: function getWebApp() {
|
@@ -1,4 +1,12 @@
|
|
1
1
|
import { PlatformEnum } from '../../../types';
|
2
|
+
export type IPopUpParams = {
|
3
|
+
url: string;
|
4
|
+
widthPadding: number;
|
5
|
+
heightPadding: number;
|
6
|
+
platform: PlatformEnum;
|
7
|
+
showCloseOnLoading: boolean;
|
8
|
+
onCloseOnLoading: () => void;
|
9
|
+
};
|
2
10
|
/**
|
3
11
|
* @author 谦彧 <zhangmian.zm@alipay.com>
|
4
12
|
* @date 2024/9/22
|
@@ -7,11 +15,6 @@ export declare class PopupManager {
|
|
7
15
|
private popupUrlQuery;
|
8
16
|
popupApp: HTMLIFrameElement;
|
9
17
|
setPopupUrlQuery(queryParams: string): void;
|
10
|
-
popup(data:
|
11
|
-
url: string;
|
12
|
-
widthPadding: number;
|
13
|
-
heightPadding: number;
|
14
|
-
platform: PlatformEnum;
|
15
|
-
}): Promise<void>;
|
18
|
+
popup(data: IPopUpParams): Promise<void>;
|
16
19
|
pop(): void;
|
17
20
|
}
|
@@ -53,7 +53,9 @@ export var PopupManager = /*#__PURE__*/function () {
|
|
53
53
|
widthPadding: data === null || data === void 0 ? void 0 : data.widthPadding,
|
54
54
|
device: data === null || data === void 0 ? void 0 : data.platform,
|
55
55
|
url: pageUrl,
|
56
|
-
loadingConfig: undefined
|
56
|
+
loadingConfig: undefined,
|
57
|
+
showCloseOnLoading: data.showCloseOnLoading,
|
58
|
+
onCloseOnLoading: data.onCloseOnLoading
|
57
59
|
});
|
58
60
|
case 11:
|
59
61
|
this.popupApp = _context.sent;
|
@@ -69,26 +69,42 @@ export var redirect = function redirect(payload, instanceId) {
|
|
69
69
|
successCallback(payload, type, evokeAppBy.url, serviceProvider);
|
70
70
|
}
|
71
71
|
});
|
72
|
+
var callApplinkUrl = function callApplinkUrl() {
|
73
|
+
try {
|
74
|
+
callAppLib.open({
|
75
|
+
link: payload.applinkUrl,
|
76
|
+
fallback: function fallback() {
|
77
|
+
failCallback(payload, RedirectType.ApplinkUrl, payload.applinkUrl, serviceProvider);
|
78
|
+
// Applink evoke failed, try to use scheme url
|
79
|
+
callSchemeUrl();
|
80
|
+
}
|
81
|
+
});
|
82
|
+
} catch (error) {
|
83
|
+
failCallback(payload, RedirectType.ApplinkUrl, payload.applinkUrl, serviceProvider);
|
84
|
+
// Applink evoke failed, try to use scheme url
|
85
|
+
callSchemeUrl();
|
86
|
+
}
|
87
|
+
};
|
72
88
|
var callSchemeUrl = function callSchemeUrl() {
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
89
|
+
try {
|
90
|
+
callAppLib.open({
|
91
|
+
scheme: payload.schemeUrl,
|
92
|
+
fallback: function fallback() {
|
93
|
+
failCallback(payload, RedirectType.SchemeUrl, payload.schemeUrl, serviceProvider);
|
94
|
+
if (!payload.url) return failCallback(payload, RedirectType.NormalUrl, '', serviceProvider);
|
95
|
+
successCallback(payload, RedirectType.NormalUrl, payload.url, serviceProvider);
|
96
|
+
window.location.href = payload.url;
|
97
|
+
}
|
98
|
+
});
|
99
|
+
} catch (error) {
|
100
|
+
failCallback(payload, RedirectType.SchemeUrl, payload.schemeUrl, serviceProvider);
|
101
|
+
if (!payload.url) return failCallback(payload, RedirectType.NormalUrl, '', serviceProvider);
|
102
|
+
successCallback(payload, RedirectType.NormalUrl, payload.url, serviceProvider);
|
103
|
+
window.location.href = payload.url;
|
104
|
+
}
|
82
105
|
};
|
83
106
|
if (payload.applinkUrl) {
|
84
|
-
|
85
|
-
link: payload.applinkUrl,
|
86
|
-
fallback: function fallback() {
|
87
|
-
failCallback(payload, RedirectType.ApplinkUrl, payload.applinkUrl, serviceProvider);
|
88
|
-
// Applink evoke failed, try to use scheme url
|
89
|
-
callSchemeUrl();
|
90
|
-
}
|
91
|
-
});
|
107
|
+
callApplinkUrl();
|
92
108
|
} else if (payload.schemeUrl) {
|
93
109
|
callSchemeUrl();
|
94
110
|
}
|
@@ -116,7 +132,7 @@ var successCallback = function successCallback(payload, type, url, serviceProvid
|
|
116
132
|
};
|
117
133
|
var failCallback = function failCallback(payload, type, url, serviceProvider) {
|
118
134
|
serviceProvider.getService('EventCenter').emit(EVENT.eventCallback.name, {
|
119
|
-
code: eventCodeEnum.
|
135
|
+
code: eventCodeEnum.SDK_LAUNCH_PAYMENT_APP_ERROR,
|
120
136
|
message: "Failed to open app,applinkUrl: ".concat(payload === null || payload === void 0 ? void 0 : payload.applinkUrl, " schemeUrl: ").concat(payload === null || payload === void 0 ? void 0 : payload.schemeUrl, " normalUrl: ").concat(payload === null || payload === void 0 ? void 0 : payload.url)
|
121
137
|
});
|
122
138
|
serviceProvider.getService('Log').logInfo({
|
@@ -1573,7 +1573,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1573
1573
|
};
|
1574
1574
|
var failCallback = function failCallback(type, url, durationInSeconds) {
|
1575
1575
|
_this8.dispatchToSDK(EVENT.eventCallback.name, {
|
1576
|
-
code: eventCodeEnum.
|
1576
|
+
code: eventCodeEnum.SDK_LAUNCH_PAYMENT_APP_ERROR,
|
1577
1577
|
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)
|
1578
1578
|
});
|
1579
1579
|
var extra = {
|
package/esm/types/index.d.ts
CHANGED
@@ -641,8 +641,18 @@ export declare enum eventCodeEnum {
|
|
641
641
|
SDK_CREATEPAYMENT_PARAMETER_ERROR = "SDK_CREATEPAYMENT_PARAMETER_ERROR",
|
642
642
|
SDK_INIT_PARAMETER_ERROR = "SDK_INIT_PARAMETER_ERROR",
|
643
643
|
SDK_CREATECOMPONENT_ERROR = "SDK_CREATECOMPONENT_ERROR",
|
644
|
-
|
644
|
+
/**
|
645
|
+
* 拉取WEB应用&收银台失败
|
646
|
+
*/
|
647
|
+
SDK_LAUNCH_PAYMENT_APP_ERROR = "SDK_LAUNCH_PAYMENT_APP_ERROR",
|
648
|
+
/**
|
649
|
+
* 拉取WEB应用&收银台成功
|
650
|
+
*/
|
645
651
|
SDK_CALL_URL_SUCCESS = "SDK_CALL_URL_SUCCESS",
|
652
|
+
/**
|
653
|
+
@deprecated 已废弃 请使用SDK_LAUNCH_PAYMENT_APP_ERROR
|
654
|
+
*/
|
655
|
+
SDK_CALL_URL_ERROR = "SDK_CALL_URL_ERROR",
|
646
656
|
SDK_PAYMENT_SUCCESSFUL = "SDK_PAYMENT_SUCCESSFUL",
|
647
657
|
SDK_PAYMENT_FAIL = "SDK_PAYMENT_FAIL",
|
648
658
|
SDK_PAYMENT_ERROR = "SDK_PAYMENT_ERROR",
|
package/esm/types/index.js
CHANGED
@@ -182,8 +182,9 @@ export var eventCodeEnum = /*#__PURE__*/function (eventCodeEnum) {
|
|
182
182
|
eventCodeEnum["SDK_CREATEPAYMENT_PARAMETER_ERROR"] = "SDK_CREATEPAYMENT_PARAMETER_ERROR";
|
183
183
|
eventCodeEnum["SDK_INIT_PARAMETER_ERROR"] = "SDK_INIT_PARAMETER_ERROR";
|
184
184
|
eventCodeEnum["SDK_CREATECOMPONENT_ERROR"] = "SDK_CREATECOMPONENT_ERROR";
|
185
|
-
eventCodeEnum["
|
185
|
+
eventCodeEnum["SDK_LAUNCH_PAYMENT_APP_ERROR"] = "SDK_LAUNCH_PAYMENT_APP_ERROR";
|
186
186
|
eventCodeEnum["SDK_CALL_URL_SUCCESS"] = "SDK_CALL_URL_SUCCESS";
|
187
|
+
eventCodeEnum["SDK_CALL_URL_ERROR"] = "SDK_CALL_URL_ERROR";
|
187
188
|
eventCodeEnum["SDK_PAYMENT_SUCCESSFUL"] = "SDK_PAYMENT_SUCCESSFUL";
|
188
189
|
eventCodeEnum["SDK_PAYMENT_FAIL"] = "SDK_PAYMENT_FAIL";
|
189
190
|
eventCodeEnum["SDK_PAYMENT_ERROR"] = "SDK_PAYMENT_ERROR";
|
package/esm/util/redirect.js
CHANGED
@@ -16,7 +16,7 @@ export function redirect(data) {
|
|
16
16
|
window.location.href = normalUrl;
|
17
17
|
return;
|
18
18
|
}
|
19
|
-
reject(ERRORMESSAGE.
|
19
|
+
reject(ERRORMESSAGE.SDK_LAUNCH_PAYMENT_APP_ERROR.CALL_APP_URL_ERROR);
|
20
20
|
};
|
21
21
|
var callAppFunc = function callAppFunc() {
|
22
22
|
if (!schemeUrl && !applinkUrl) {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@alipay/ams-checkout",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.39.0",
|
4
4
|
"description": "",
|
5
5
|
"author": "",
|
6
6
|
"main": "esm/index.js",
|
@@ -16,14 +16,32 @@
|
|
16
16
|
"scripts": {
|
17
17
|
"build": "father build",
|
18
18
|
"build:w": "father dev",
|
19
|
-
"dev": "father dev",
|
20
19
|
"ci": "npm run lint",
|
21
20
|
"cov": "jest --coverage",
|
21
|
+
"dev": "father dev",
|
22
22
|
"format": "prettier --write --no-error-on-unmatched-pattern \"**/*.{js,jsx,ts,tsx,md,json,css,less}\"",
|
23
23
|
"lint": "eslint ./src",
|
24
24
|
"test": "jest --silent",
|
25
25
|
"tsc": "tsc --noEmit"
|
26
26
|
},
|
27
|
+
"commitlint": {
|
28
|
+
"extends": [
|
29
|
+
"@commitlint/config-conventional"
|
30
|
+
]
|
31
|
+
},
|
32
|
+
"lint-staged": {
|
33
|
+
"*.{js,jsx}": [
|
34
|
+
"eslint --fix",
|
35
|
+
"prettier --write"
|
36
|
+
],
|
37
|
+
"*.{ts,tsx}": [
|
38
|
+
"eslint --fix",
|
39
|
+
"prettier --parser=typescript --write"
|
40
|
+
],
|
41
|
+
"*.{md,json}": [
|
42
|
+
"prettier --write"
|
43
|
+
]
|
44
|
+
},
|
27
45
|
"dependencies": {
|
28
46
|
"axios": "^1.3.4",
|
29
47
|
"uuid": "^9.0.0"
|
@@ -31,6 +49,8 @@
|
|
31
49
|
"devDependencies": {
|
32
50
|
"@babel/core": "^7.20.7",
|
33
51
|
"@babel/preset-env": "^7.20.2",
|
52
|
+
"@commitlint/cli": "^17.3.0",
|
53
|
+
"@commitlint/config-conventional": "^17.3.0",
|
34
54
|
"@testing-library/jest-dom": "^5.1.1",
|
35
55
|
"@testing-library/react": "^9.5.0",
|
36
56
|
"@types/jest": "^29.2.4",
|
@@ -52,7 +72,9 @@
|
|
52
72
|
"ts-node": "^10.9.1",
|
53
73
|
"typescript": "^4.9.5"
|
54
74
|
},
|
55
|
-
"engines": {
|
75
|
+
"engines": {
|
76
|
+
"install-node": "18"
|
77
|
+
},
|
56
78
|
"publishConfig": {
|
57
79
|
"access": "public"
|
58
80
|
}
|