3ds 流程优化

master
yixian 4 years ago
parent a4b4c53ce9
commit 4caba62bf8

@ -4,6 +4,7 @@ $(function () {
let cardFrame = new CardInputFrame($container, window.card_input_appid, window.card_input_token);
let $errorMsgBox = $('#errorMsgBox');
let loading = $('.loading-container');
function bindEvent(element, eventName, eventHandler) {
if (element.addEventListener) {
element.addEventListener(eventName, eventHandler, true);
@ -11,11 +12,12 @@ $(function () {
element.attachEvent('on' + eventName, eventHandler);
}
}
bindEvent(window, 'message', function (evt) {
if (!evt.data) {
return
}
let msg = JSON.parse(evt.data);
let msg = typeof evt.data == 'string' ? JSON.parse(evt.data) : evt.data;
if (msg && msg.type == '3dsResult') {
evt.stopPropagation();
evt.stopImmediatePropagation();

Loading…
Cancel
Save