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,23 +12,24 @@ $(function () {
element.attachEvent('on' + eventName, eventHandler);
}
}
bindEvent(window,'message',function (evt){
if (!evt.data){
bindEvent(window, 'message', function (evt) {
if (!evt.data) {
return
}
let msg = JSON.parse(evt.data);
if (msg && msg.type=='3dsResult'){
let msg = typeof evt.data == 'string' ? JSON.parse(evt.data) : evt.data;
if (msg && msg.type == '3dsResult') {
evt.stopPropagation();
evt.stopImmediatePropagation();
$('.threeds-container').addClass('hide');
if (msg.success){
if (msg.success) {
location.href = './result'
}else {
} else {
$errorMsgBox.text('[' + evt.errCode + ']' + evt.errMsg).show();
}
}
})
if (window.three_ds_params){
if (window.three_ds_params) {
handleThreeDs(window.three_ds_params)
}

Loading…
Cancel
Save