|
|
@ -4,7 +4,26 @@ $(function () {
|
|
|
|
let cardFrame = new CardInputFrame($container, window.card_input_appid, window.card_input_token);
|
|
|
|
let cardFrame = new CardInputFrame($container, window.card_input_appid, window.card_input_token);
|
|
|
|
let $errorMsgBox = $('#errorMsgBox');
|
|
|
|
let $errorMsgBox = $('#errorMsgBox');
|
|
|
|
let loading = $('.loading-container');
|
|
|
|
let loading = $('.loading-container');
|
|
|
|
|
|
|
|
function bindEvent(element, eventName, eventHandler) {
|
|
|
|
|
|
|
|
if (element.addEventListener) {
|
|
|
|
|
|
|
|
element.addEventListener(eventName, eventHandler, true);
|
|
|
|
|
|
|
|
} else if (element.attachEvent) {
|
|
|
|
|
|
|
|
element.attachEvent('on' + eventName, eventHandler);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
bindEvent(window,'message',function (evt){
|
|
|
|
|
|
|
|
let msg = JSON.parse(evt.data);
|
|
|
|
|
|
|
|
if (msg && msg.type=='3dsResult'){
|
|
|
|
|
|
|
|
evt.stopPropagation();
|
|
|
|
|
|
|
|
evt.stopImmediatePropagation();
|
|
|
|
|
|
|
|
$('.threeds-container').addClass('hide');
|
|
|
|
|
|
|
|
if (msg.success){
|
|
|
|
|
|
|
|
location.href = './result'
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
$errorMsgBox.text('[' + evt.errCode + ']' + evt.errMsg).show();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
if (window.three_ds_params){
|
|
|
|
if (window.three_ds_params){
|
|
|
|
handleThreeDs(window.three_ds_params)
|
|
|
|
handleThreeDs(window.three_ds_params)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -15,14 +34,6 @@ $(function () {
|
|
|
|
$('<input>').attr('name', 'PaReq').val(threeDsParams.pa_req).attr('type', 'hidden').appendTo(form);
|
|
|
|
$('<input>').attr('name', 'PaReq').val(threeDsParams.pa_req).attr('type', 'hidden').appendTo(form);
|
|
|
|
$('<input>').attr('name', 'TermUrl').val(threeDsParams.term_url).attr('type', 'hidden').appendTo(form);
|
|
|
|
$('<input>').attr('name', 'TermUrl').val(threeDsParams.term_url).attr('type', 'hidden').appendTo(form);
|
|
|
|
$('body').append(form);
|
|
|
|
$('body').append(form);
|
|
|
|
window.threeds_success = function (success, errorCode, errorMsg) {
|
|
|
|
|
|
|
|
$('.threeds-container').addClass('hide');
|
|
|
|
|
|
|
|
if (success) {
|
|
|
|
|
|
|
|
location.href = './result'
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$errorMsgBox.text('[' + errorCode + ']' + errorMsg).show();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
form.submit();
|
|
|
|
form.submit();
|
|
|
|
$('.threeds-container').removeClass('hide')
|
|
|
|
$('.threeds-container').removeClass('hide')
|
|
|
|
}
|
|
|
|
}
|
|
|
|