@alipay/ams-checkout 1.45.0 → 1.47.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/config/index.d.ts +8 -8
- package/esm/config/index.js +8 -8
- package/esm/constant/index.d.ts +1 -1
- package/esm/constant/index.js +5 -5
- package/esm/core/component/element/elementController/index.js +2 -2
- package/esm/foundation/core/index.js +16 -6
- package/esm/foundation/index.d.ts +1 -0
- package/esm/foundation/product-processor/easysafepay/index.js +4 -2
- package/package.json +1 -1
package/esm/config/index.d.ts
CHANGED
|
@@ -6,11 +6,11 @@ export declare const sdkVersion: string;
|
|
|
6
6
|
* @description: 目前应用层分为v1和v2,会存在两个应用版本号不是同步发布的情况。所以需要把默认的应用版本号配置抽离出来。
|
|
7
7
|
* TODO 这里考虑直接换成packagejson.version
|
|
8
8
|
*/
|
|
9
|
-
export declare const AMSCheckoutAppVersion = "1.
|
|
10
|
-
export declare const AMSAutoDebitAppVersion = "1.
|
|
11
|
-
export declare const AMSEasyPayAppVersion = "1.
|
|
12
|
-
export declare const AMSCashierPaymentAppVersion = "1.
|
|
13
|
-
export declare const AMSVaultingAppVersion = "1.
|
|
14
|
-
export declare const AMSPaymentElementAppVersion = "1.
|
|
15
|
-
export declare const ADDRESSElementAppVersion = "1.
|
|
16
|
-
export declare const AUTHElementAppVersion = "1.
|
|
9
|
+
export declare const AMSCheckoutAppVersion = "1.47.0";
|
|
10
|
+
export declare const AMSAutoDebitAppVersion = "1.47.0";
|
|
11
|
+
export declare const AMSEasyPayAppVersion = "1.47.0";
|
|
12
|
+
export declare const AMSCashierPaymentAppVersion = "1.47.0";
|
|
13
|
+
export declare const AMSVaultingAppVersion = "1.47.0";
|
|
14
|
+
export declare const AMSPaymentElementAppVersion = "1.47.0";
|
|
15
|
+
export declare const ADDRESSElementAppVersion = "1.47.0";
|
|
16
|
+
export declare const AUTHElementAppVersion = "1.47.0";
|
package/esm/config/index.js
CHANGED
|
@@ -36,11 +36,11 @@ export var sdkVersion = json.version;
|
|
|
36
36
|
* @description: 目前应用层分为v1和v2,会存在两个应用版本号不是同步发布的情况。所以需要把默认的应用版本号配置抽离出来。
|
|
37
37
|
* TODO 这里考虑直接换成packagejson.version
|
|
38
38
|
*/
|
|
39
|
-
export var AMSCheckoutAppVersion = '1.
|
|
40
|
-
export var AMSAutoDebitAppVersion = '1.
|
|
41
|
-
export var AMSEasyPayAppVersion = '1.
|
|
42
|
-
export var AMSCashierPaymentAppVersion = '1.
|
|
43
|
-
export var AMSVaultingAppVersion = '1.
|
|
44
|
-
export var AMSPaymentElementAppVersion = '1.
|
|
45
|
-
export var ADDRESSElementAppVersion = '1.
|
|
46
|
-
export var AUTHElementAppVersion = '1.
|
|
39
|
+
export var AMSCheckoutAppVersion = '1.47.0'; // 兜底版本号
|
|
40
|
+
export var AMSAutoDebitAppVersion = '1.47.0'; // 代扣
|
|
41
|
+
export var AMSEasyPayAppVersion = '1.47.0'; // easypay
|
|
42
|
+
export var AMSCashierPaymentAppVersion = '1.47.0'; // 收银台(卡、apm)
|
|
43
|
+
export var AMSVaultingAppVersion = '1.47.0'; // 绑卡
|
|
44
|
+
export var AMSPaymentElementAppVersion = '1.47.0'; // payment element
|
|
45
|
+
export var ADDRESSElementAppVersion = '1.47.0'; // address element
|
|
46
|
+
export var AUTHElementAppVersion = '1.47.0'; // auth element
|
package/esm/constant/index.d.ts
CHANGED
package/esm/constant/index.js
CHANGED
|
@@ -98,14 +98,14 @@ export var ERRORMESSAGE = {
|
|
|
98
98
|
code: 'UI_STATE_ERROR',
|
|
99
99
|
message: 'An error occurred. The transaction cannot be initiated.'
|
|
100
100
|
},
|
|
101
|
-
|
|
102
|
-
code: '
|
|
101
|
+
INITIALIZE_TIMEOUT: {
|
|
102
|
+
code: 'INITIALIZE_TIMEOUT',
|
|
103
103
|
API: {
|
|
104
|
-
code: '
|
|
104
|
+
code: 'INITIALIZE_API_TIMEOUT',
|
|
105
105
|
message: 'An error occurred. The transaction cannot be initiated.'
|
|
106
106
|
},
|
|
107
107
|
WEB: {
|
|
108
|
-
code: '
|
|
108
|
+
code: 'INITIALIZE_WEB_TIMEOUT',
|
|
109
109
|
message: 'An error occurred; the transaction cannot be initiated.'
|
|
110
110
|
}
|
|
111
111
|
},
|
|
@@ -287,7 +287,7 @@ export var EVENT = {
|
|
|
287
287
|
},
|
|
288
288
|
// Element支付完成后事件
|
|
289
289
|
submitPromiseCallback: {
|
|
290
|
-
name: '
|
|
290
|
+
name: 'onSubmitPayCallback'
|
|
291
291
|
},
|
|
292
292
|
validateFieldsResult: {
|
|
293
293
|
name: 'validateFieldsResult',
|
|
@@ -195,7 +195,7 @@ var ElementController = /*#__PURE__*/function () {
|
|
|
195
195
|
title: 'sdk_event_web_app_timeout'
|
|
196
196
|
});
|
|
197
197
|
resolve({
|
|
198
|
-
error: ERRORMESSAGE.
|
|
198
|
+
error: ERRORMESSAGE.INITIALIZE_TIMEOUT.WEB
|
|
199
199
|
});
|
|
200
200
|
}, TIMEOUT_DURATION);
|
|
201
201
|
}
|
|
@@ -642,7 +642,7 @@ var ElementController = /*#__PURE__*/function () {
|
|
|
642
642
|
_context5.t0 = _context5["catch"](1);
|
|
643
643
|
this.handleInitializationError();
|
|
644
644
|
readyCallback({
|
|
645
|
-
error: _objectSpread(_objectSpread({}, ERRORMESSAGE.
|
|
645
|
+
error: _objectSpread(_objectSpread({}, ERRORMESSAGE.INITIALIZE_TIMEOUT.API), {}, {
|
|
646
646
|
traceId: _context5.t0 === null || _context5.t0 === void 0 ? void 0 : _context5.t0.traceId
|
|
647
647
|
})
|
|
648
648
|
});
|
|
@@ -242,7 +242,7 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
|
242
242
|
value: function () {
|
|
243
243
|
var _startBizFlow = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(options) {
|
|
244
244
|
var _this$paymentContext$, _this$paymentContext$2, _this$paymentContext$3;
|
|
245
|
-
var paymentSession, displayInfo, _convertPaymentSessio2, paymentSessionId, paymentSessionMetaData, mid, webAppMatchConfig, webAppVersion, productScene, paymentMethod, _this$bizFlowStartBeh, payload, eventCenter, data;
|
|
245
|
+
var paymentSession, displayInfo, _convertPaymentSessio2, paymentSessionId, paymentSessionMetaData, mid, webAppMatchConfig, webAppVersion, productScene, paymentMethod, _this$bizFlowStartBeh, payload, eventCenter, data, normalUrl;
|
|
246
246
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
247
247
|
while (1) switch (_context4.prev = _context4.next) {
|
|
248
248
|
case 0:
|
|
@@ -323,14 +323,18 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
|
323
323
|
return _context4.abrupt("return");
|
|
324
324
|
case 36:
|
|
325
325
|
if (!(this.bizFlowStartBehavior.behaviorType === 'REDIRECT')) {
|
|
326
|
-
_context4.next =
|
|
326
|
+
_context4.next = 49;
|
|
327
327
|
break;
|
|
328
328
|
}
|
|
329
329
|
payload = (_this$bizFlowStartBeh = this.bizFlowStartBehavior) === null || _this$bizFlowStartBeh === void 0 ? void 0 : _this$bizFlowStartBeh.payload;
|
|
330
|
-
|
|
331
|
-
|
|
330
|
+
console.log('sdk 打印', payload);
|
|
331
|
+
console.log('sdk 触发', options);
|
|
332
|
+
//Sessiondata中authUrlInfo的openInApp为true,说明端内打开,不需要处理isNativeAppWebview的外跳事件逻辑
|
|
333
|
+
if (!(options.isNativeAppWebview && !!!payload.openInApp)) {
|
|
334
|
+
_context4.next = 46;
|
|
332
335
|
break;
|
|
333
336
|
}
|
|
337
|
+
console.log('sdk 打印跳转', options);
|
|
334
338
|
eventCenter = ServiceProvider.getInstance(this.instanceId).getService('EventCenter');
|
|
335
339
|
data = {
|
|
336
340
|
normalUrl: (payload === null || payload === void 0 ? void 0 : payload.url) || '',
|
|
@@ -344,10 +348,16 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
|
344
348
|
}
|
|
345
349
|
});
|
|
346
350
|
return _context4.abrupt("return");
|
|
347
|
-
case
|
|
351
|
+
case 46:
|
|
352
|
+
if (payload.url && payload.openInApp && options.isNativeAppWebview) {
|
|
353
|
+
//Sessiondata中authUrlInfo的openInApp为true,normalUrl存在,isNativeAppWebview为true,拼接source=embedded
|
|
354
|
+
normalUrl = new URL(payload.url);
|
|
355
|
+
normalUrl.searchParams.set('source', 'embedded');
|
|
356
|
+
payload.url = normalUrl.toString();
|
|
357
|
+
}
|
|
348
358
|
redirect(payload, this.instanceId);
|
|
349
359
|
return _context4.abrupt("return");
|
|
350
|
-
case
|
|
360
|
+
case 49:
|
|
351
361
|
case "end":
|
|
352
362
|
return _context4.stop();
|
|
353
363
|
}
|
|
@@ -62,6 +62,7 @@ export interface RedirectBehaviorPayload {
|
|
|
62
62
|
browserLinkTarget?: TargetEnum;
|
|
63
63
|
isCallApp?: boolean;
|
|
64
64
|
callAppDetectSuccessDelay?: number;
|
|
65
|
+
openInApp?: boolean;
|
|
65
66
|
}
|
|
66
67
|
/**
|
|
67
68
|
* Provide some capability, such as MonitorService, EventBusService, SecurityService
|
|
@@ -153,13 +153,15 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
|
|
|
153
153
|
data = {
|
|
154
154
|
url: authUrlInfo === null || authUrlInfo === void 0 ? void 0 : authUrlInfo.authUrl,
|
|
155
155
|
schemeUrl: authUrlInfo === null || authUrlInfo === void 0 ? void 0 : authUrlInfo.authUrl,
|
|
156
|
-
applinkUrl: authUrlInfo === null || authUrlInfo === void 0 ? void 0 : authUrlInfo.authUrl
|
|
156
|
+
applinkUrl: authUrlInfo === null || authUrlInfo === void 0 ? void 0 : authUrlInfo.authUrl,
|
|
157
|
+
openInApp: (authUrlInfo === null || authUrlInfo === void 0 ? void 0 : authUrlInfo.openInApp) || false
|
|
157
158
|
};
|
|
158
159
|
} else {
|
|
159
160
|
data = {
|
|
160
161
|
url: authUrlInfo === null || authUrlInfo === void 0 ? void 0 : authUrlInfo.normalUrl,
|
|
161
162
|
schemeUrl: authUrlInfo === null || authUrlInfo === void 0 ? void 0 : authUrlInfo.schemeUrl,
|
|
162
|
-
applinkUrl: authUrlInfo === null || authUrlInfo === void 0 ? void 0 : authUrlInfo.applinkUrl
|
|
163
|
+
applinkUrl: authUrlInfo === null || authUrlInfo === void 0 ? void 0 : authUrlInfo.applinkUrl,
|
|
164
|
+
openInApp: (authUrlInfo === null || authUrlInfo === void 0 ? void 0 : authUrlInfo.openInApp) || false
|
|
163
165
|
};
|
|
164
166
|
}
|
|
165
167
|
var result = {
|