@alipay/ams-checkout 2.0.5 → 2.0.7
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.
|
@@ -870,9 +870,11 @@ var ElementController = /*#__PURE__*/function () {
|
|
|
870
870
|
}, {
|
|
871
871
|
key: "isEventAllowed",
|
|
872
872
|
value: function isEventAllowed(event) {
|
|
873
|
-
var _safeParse
|
|
874
|
-
//
|
|
875
|
-
var
|
|
873
|
+
var _safeParse;
|
|
874
|
+
// 获取当前业务场景
|
|
875
|
+
var _convertPaymentSessio2 = convertPaymentSession(this.options.sessionData),
|
|
876
|
+
paymentSessionObj = _convertPaymentSessio2.data;
|
|
877
|
+
var isExpressCheckout = ((_safeParse = safeParse(paymentSessionObj === null || paymentSessionObj === void 0 ? void 0 : paymentSessionObj.extendInfo)) === null || _safeParse === void 0 ? void 0 : _safeParse.expressCheckout) === 'true';
|
|
876
878
|
var productScene = isExpressCheckout ? ProductScene.EXPRESS_CHECKOUT : ProductScene.ELEMENT_PAYMENT;
|
|
877
879
|
// 查找对应的产品场景
|
|
878
880
|
var scenario = productEventScenarios.find(function (s) {
|
|
@@ -133,10 +133,10 @@ var PaymentProcessor = /*#__PURE__*/function (_BaseElementProcessor) {
|
|
|
133
133
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
134
134
|
this.eventCenter.listen(EVENT.getApplePayToken.name, function (data) {
|
|
135
135
|
var _this2$elementContain = _this2.elementContainer.getPaymentContext(),
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
paymentSessionObj = _this2$elementContain.paymentSessionObj,
|
|
137
|
+
paymentSession = _this2$elementContain.paymentSession;
|
|
138
138
|
var applePayService = new ApplePaySdk({
|
|
139
|
-
paymentSessionData:
|
|
139
|
+
paymentSessionData: paymentSession,
|
|
140
140
|
parseData: paymentSessionObj,
|
|
141
141
|
logger: logger
|
|
142
142
|
});
|
|
@@ -164,17 +164,17 @@ var PaymentProcessor = /*#__PURE__*/function (_BaseElementProcessor) {
|
|
|
164
164
|
value: function () {
|
|
165
165
|
var _initApplePaySdk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
166
166
|
var _this$elementContaine6;
|
|
167
|
-
var _ref, paymentSessionObj,
|
|
167
|
+
var _ref, paymentSessionObj, paymentSession;
|
|
168
168
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
169
169
|
while (1) switch (_context.prev = _context.next) {
|
|
170
170
|
case 0:
|
|
171
|
-
_ref = ((_this$elementContaine6 = this.elementContainer) === null || _this$elementContaine6 === void 0 ? void 0 : _this$elementContaine6.getPaymentContext()) || {}, paymentSessionObj = _ref.paymentSessionObj,
|
|
171
|
+
_ref = ((_this$elementContaine6 = this.elementContainer) === null || _this$elementContaine6 === void 0 ? void 0 : _this$elementContaine6.getPaymentContext()) || {}, paymentSessionObj = _ref.paymentSessionObj, paymentSession = _ref.paymentSession;
|
|
172
172
|
if (!isSkipRenderPaymentMethod(paymentSessionObj)) {
|
|
173
173
|
_context.next = 13;
|
|
174
174
|
break;
|
|
175
175
|
}
|
|
176
176
|
this.ApplePayService = new ApplePaySdk({
|
|
177
|
-
paymentSessionData:
|
|
177
|
+
paymentSessionData: paymentSession,
|
|
178
178
|
parseData: paymentSessionObj,
|
|
179
179
|
logger: logger
|
|
180
180
|
});
|