@alipay/ams-checkout 0.0.1730107332-dev.1 → 0.0.1730107332-dev.3
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.
@@ -84,7 +84,8 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
84
84
|
});
|
85
85
|
eventCenter.listen(EVENT.initSecuritySDK.name, /*#__PURE__*/function () {
|
86
86
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data, payload) {
|
87
|
-
var
|
87
|
+
var _payload$context;
|
88
|
+
var securityService, success;
|
88
89
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
89
90
|
while (1) switch (_context.prev = _context.next) {
|
90
91
|
case 0:
|
@@ -93,26 +94,22 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
93
94
|
_context.next = 4;
|
94
95
|
return securityService.initSecurity();
|
95
96
|
case 4:
|
96
|
-
|
97
|
-
event: 'appEventCallback',
|
98
|
-
eventCallbackId: (_payload$context = payload.context) === null || _payload$context === void 0 ? void 0 : _payload$context.eventCallbackId,
|
99
|
-
data: {
|
100
|
-
success: true
|
101
|
-
}
|
102
|
-
});
|
97
|
+
success = true;
|
103
98
|
_context.next = 10;
|
104
99
|
break;
|
105
100
|
case 7:
|
106
101
|
_context.prev = 7;
|
107
102
|
_context.t0 = _context["catch"](1);
|
103
|
+
success = false;
|
104
|
+
case 10:
|
108
105
|
eventCenter.dispatchToApp({
|
109
106
|
event: 'appEventCallback',
|
110
|
-
eventCallbackId: (_payload$
|
107
|
+
eventCallbackId: (_payload$context = payload.context) === null || _payload$context === void 0 ? void 0 : _payload$context.eventCallbackId,
|
111
108
|
data: {
|
112
|
-
success:
|
109
|
+
success: success
|
113
110
|
}
|
114
111
|
});
|
115
|
-
case
|
112
|
+
case 11:
|
116
113
|
case "end":
|
117
114
|
return _context.stop();
|
118
115
|
}
|
@@ -122,6 +119,35 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
122
119
|
return _ref.apply(this, arguments);
|
123
120
|
};
|
124
121
|
}());
|
122
|
+
eventCenter.listen(EVENT.getDeviceId.name, /*#__PURE__*/function () {
|
123
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(data, payload) {
|
124
|
+
var _payload$context2;
|
125
|
+
var securityService, deviceId;
|
126
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
127
|
+
while (1) switch (_context2.prev = _context2.next) {
|
128
|
+
case 0:
|
129
|
+
securityService = ServiceProvider.getInstance(_this.instanceId).getService('Security');
|
130
|
+
_context2.next = 3;
|
131
|
+
return securityService.getDeviceId(data);
|
132
|
+
case 3:
|
133
|
+
deviceId = _context2.sent;
|
134
|
+
eventCenter.dispatchToApp({
|
135
|
+
event: 'appEventCallback',
|
136
|
+
eventCallbackId: (_payload$context2 = payload.context) === null || _payload$context2 === void 0 ? void 0 : _payload$context2.eventCallbackId,
|
137
|
+
data: {
|
138
|
+
deviceId: deviceId
|
139
|
+
}
|
140
|
+
});
|
141
|
+
case 5:
|
142
|
+
case "end":
|
143
|
+
return _context2.stop();
|
144
|
+
}
|
145
|
+
}, _callee2);
|
146
|
+
}));
|
147
|
+
return function (_x3, _x4) {
|
148
|
+
return _ref2.apply(this, arguments);
|
149
|
+
};
|
150
|
+
}());
|
125
151
|
|
126
152
|
// execute additional logic from specified product
|
127
153
|
if (this.productProcessors[sdkMetaData.productScene]) {
|
@@ -131,13 +157,14 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
131
157
|
}, {
|
132
158
|
key: "startBizFlow",
|
133
159
|
value: function () {
|
134
|
-
var _startBizFlow = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
160
|
+
var _startBizFlow = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(options) {
|
161
|
+
var _this$paymentContext$;
|
135
162
|
var paymentSession, displayInfo, _convertPaymentSessio, paymentSessionId, paymentSessionMetaData, mid, webAppMatchConfig, webAppVersion, productScene, paymentMethod, _this$bizFlowStartBeh, payload;
|
136
|
-
return _regeneratorRuntime().wrap(function
|
137
|
-
while (1) switch (
|
163
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
164
|
+
while (1) switch (_context3.prev = _context3.next) {
|
138
165
|
case 0:
|
139
166
|
if (!(!options || !options.paymentSession)) {
|
140
|
-
|
167
|
+
_context3.next = 2;
|
141
168
|
break;
|
142
169
|
}
|
143
170
|
throw new Error('paymentSession is empty');
|
@@ -165,62 +192,62 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
165
192
|
|
166
193
|
// Invoke processor
|
167
194
|
productScene = this.paymentContext.paymentSessionObj.paymentSessionConfig.productScene;
|
168
|
-
paymentMethod = this.paymentContext.paymentSessionObj.paymentMethodInfoView
|
169
|
-
|
195
|
+
paymentMethod = (_this$paymentContext$ = this.paymentContext.paymentSessionObj.paymentMethodInfoView) === null || _this$paymentContext$ === void 0 ? void 0 : _this$paymentContext$.paymentMethodType;
|
196
|
+
_context3.prev = 13;
|
170
197
|
if (!this.productProcessors["".concat(productScene, "|").concat(paymentMethod)]) {
|
171
|
-
|
198
|
+
_context3.next = 20;
|
172
199
|
break;
|
173
200
|
}
|
174
|
-
|
201
|
+
_context3.next = 17;
|
175
202
|
return this.productProcessors["".concat(productScene, "|").concat(paymentMethod)].startBizFlow(this.paymentContext);
|
176
203
|
case 17:
|
177
|
-
this.bizFlowStartBehavior =
|
178
|
-
|
204
|
+
this.bizFlowStartBehavior = _context3.sent;
|
205
|
+
_context3.next = 24;
|
179
206
|
break;
|
180
207
|
case 20:
|
181
208
|
if (!this.productProcessors["".concat(productScene)]) {
|
182
|
-
|
209
|
+
_context3.next = 24;
|
183
210
|
break;
|
184
211
|
}
|
185
|
-
|
212
|
+
_context3.next = 23;
|
186
213
|
return this.productProcessors["".concat(productScene)].startBizFlow(this.paymentContext);
|
187
214
|
case 23:
|
188
|
-
this.bizFlowStartBehavior =
|
215
|
+
this.bizFlowStartBehavior = _context3.sent;
|
189
216
|
case 24:
|
190
|
-
|
217
|
+
_context3.next = 29;
|
191
218
|
break;
|
192
219
|
case 26:
|
193
|
-
|
194
|
-
|
195
|
-
console.error('Invoke processor failed',
|
220
|
+
_context3.prev = 26;
|
221
|
+
_context3.t0 = _context3["catch"](13);
|
222
|
+
console.error('Invoke processor failed', _context3.t0);
|
196
223
|
case 29:
|
197
224
|
if (!(!this.bizFlowStartBehavior || this.bizFlowStartBehavior.behaviorType === 'NONE' || !this.bizFlowStartBehavior.payload)) {
|
198
|
-
|
225
|
+
_context3.next = 31;
|
199
226
|
break;
|
200
227
|
}
|
201
|
-
return
|
228
|
+
return _context3.abrupt("return");
|
202
229
|
case 31:
|
203
230
|
if (!(this.bizFlowStartBehavior.behaviorType === 'RENDER')) {
|
204
|
-
|
231
|
+
_context3.next = 34;
|
205
232
|
break;
|
206
233
|
}
|
207
234
|
this.handleBehaviorRender();
|
208
|
-
return
|
235
|
+
return _context3.abrupt("return");
|
209
236
|
case 34:
|
210
237
|
if (!(this.bizFlowStartBehavior.behaviorType === 'REDIRECT')) {
|
211
|
-
|
238
|
+
_context3.next = 38;
|
212
239
|
break;
|
213
240
|
}
|
214
241
|
payload = (_this$bizFlowStartBeh = this.bizFlowStartBehavior) === null || _this$bizFlowStartBeh === void 0 ? void 0 : _this$bizFlowStartBeh.payload;
|
215
242
|
redirect(payload, this.instanceId);
|
216
|
-
return
|
243
|
+
return _context3.abrupt("return");
|
217
244
|
case 38:
|
218
245
|
case "end":
|
219
|
-
return
|
246
|
+
return _context3.stop();
|
220
247
|
}
|
221
|
-
},
|
248
|
+
}, _callee3, this, [[13, 26]]);
|
222
249
|
}));
|
223
|
-
function startBizFlow(
|
250
|
+
function startBizFlow(_x5) {
|
224
251
|
return _startBizFlow.apply(this, arguments);
|
225
252
|
}
|
226
253
|
return startBizFlow;
|
@@ -534,42 +534,48 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
|
|
534
534
|
nonCompliant = (_this$paymentContext$3 = this.paymentContext.paymentSessionObj.action) === null || _this$paymentContext$3 === void 0 ? void 0 : _this$paymentContext$3.nonCompliant;
|
535
535
|
isFirstTimeToPay = !this.paymentContext.paymentSessionObj.action.autoDebitWithToken;
|
536
536
|
if (!(productSceneVersion === '1.0')) {
|
537
|
-
_context5.next =
|
537
|
+
_context5.next = 9;
|
538
538
|
break;
|
539
539
|
}
|
540
|
+
console.log('[web-sdk][security-sdk] skip init security sdk for easypay 1.0');
|
541
|
+
// 1.0 不初始化 SecuritySDK
|
540
542
|
return _context5.abrupt("return");
|
541
|
-
case
|
543
|
+
case 9:
|
542
544
|
if (!(productSceneVersion === '2.0')) {
|
543
|
-
_context5.next =
|
545
|
+
_context5.next = 20;
|
544
546
|
break;
|
545
547
|
}
|
546
548
|
if (!(nonCompliant === true)) {
|
547
|
-
_context5.next =
|
549
|
+
_context5.next = 16;
|
548
550
|
break;
|
549
551
|
}
|
550
|
-
|
552
|
+
// 未切流「隐私合规」
|
553
|
+
console.log('[web-sdk][security-sdk] init security sdk for easypay 2.0 and nonCompliant is true');
|
554
|
+
_context5.next = 14;
|
551
555
|
return this.securityService.initSecurity(this.SECURITY_SDK_INIT_TIMEOUT);
|
552
|
-
case 12:
|
553
|
-
_context5.next = 17;
|
554
|
-
break;
|
555
556
|
case 14:
|
557
|
+
_context5.next = 20;
|
558
|
+
break;
|
559
|
+
case 16:
|
556
560
|
if (isFirstTimeToPay) {
|
557
|
-
_context5.next =
|
561
|
+
_context5.next = 20;
|
558
562
|
break;
|
559
563
|
}
|
560
|
-
|
564
|
+
// 切流「隐私合规」且非首次支付
|
565
|
+
console.log('[web-sdk][security-sdk] init security sdk for easypay 2.0 and when not first time to pay');
|
566
|
+
_context5.next = 20;
|
561
567
|
return this.securityService.initSecurity(this.SECURITY_SDK_INIT_TIMEOUT);
|
562
|
-
case
|
563
|
-
_context5.next =
|
568
|
+
case 20:
|
569
|
+
_context5.next = 24;
|
564
570
|
break;
|
565
|
-
case
|
566
|
-
_context5.prev =
|
571
|
+
case 22:
|
572
|
+
_context5.prev = 22;
|
567
573
|
_context5.t0 = _context5["catch"](0);
|
568
|
-
case
|
574
|
+
case 24:
|
569
575
|
case "end":
|
570
576
|
return _context5.stop();
|
571
577
|
}
|
572
|
-
}, _callee5, this, [[0,
|
578
|
+
}, _callee5, this, [[0, 22]]);
|
573
579
|
}));
|
574
580
|
function initSecuritySDK() {
|
575
581
|
return _initSecuritySDK.apply(this, arguments);
|
@@ -7,7 +7,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
7
7
|
import { eventCodeEnum, RedirectType, TargetEnum } from "../../types";
|
8
8
|
import { ServiceProvider } from "../service";
|
9
9
|
import { isPC } from "../../util";
|
10
|
-
import CallApp from "../../util/intl-callapp/es";
|
10
|
+
import CallApp from "../../util/intl-callapp/es/index";
|
11
11
|
import { EVENT } from "../../constant";
|
12
12
|
|
13
13
|
/**
|
@@ -60,7 +60,7 @@ export var redirect = function redirect(payload, instanceId) {
|
|
60
60
|
callAppLib.open({
|
61
61
|
scheme: payload.schemeUrl,
|
62
62
|
fallback: function fallback() {
|
63
|
-
//
|
63
|
+
// SchemeUrl evoke failed
|
64
64
|
if (payload.schemeUrl) {
|
65
65
|
failCallback(payload, RedirectType.SchemeUrl, payload.schemeUrl, payload, serviceProvider);
|
66
66
|
}
|