|
|
@ -4,6 +4,29 @@ $(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');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (window.three_ds_params){
|
|
|
|
|
|
|
|
handleThreeDs(window.three_ds_params)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function handleThreeDs(threeDsParams) {
|
|
|
|
|
|
|
|
let form = $('<form></form>').attr('action', threeDsParams.acs_url).attr('method', 'post').css('display', 'none')
|
|
|
|
|
|
|
|
.attr('target', 'threeds-frame');
|
|
|
|
|
|
|
|
$('<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);
|
|
|
|
|
|
|
|
$('body').append(form);
|
|
|
|
|
|
|
|
window.threeds_success = function (success, errorCode, errorMsg) {
|
|
|
|
|
|
|
|
$('#threeds-frame').addClass('hide');
|
|
|
|
|
|
|
|
if (success) {
|
|
|
|
|
|
|
|
location.href = './result'
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$errorMsgBox.text('[' + errorCode + ']' + errorMsg).show();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
form.submit();
|
|
|
|
|
|
|
|
$('#threeds-frame').removeClass('hide')
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
cardFrame.onSuccess = function (secretData) {
|
|
|
|
cardFrame.onSuccess = function (secretData) {
|
|
|
|
$.ajax({
|
|
|
|
$.ajax({
|
|
|
|
url: 'commit',
|
|
|
|
url: 'commit',
|
|
|
@ -13,11 +36,7 @@ $(function () {
|
|
|
|
success: function (res) {
|
|
|
|
success: function (res) {
|
|
|
|
if (res.sdk_params) {
|
|
|
|
if (res.sdk_params) {
|
|
|
|
let threeDsParams = JSON.parse(res.sdk_params);
|
|
|
|
let threeDsParams = JSON.parse(res.sdk_params);
|
|
|
|
let form = $('<form></form>').attr('action', threeDsParams.acs_url).attr('method', 'post').css('display', 'none');
|
|
|
|
handleThreeDs(threeDsParams);
|
|
|
|
$('<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);
|
|
|
|
|
|
|
|
$('body').append(form);
|
|
|
|
|
|
|
|
form.submit();
|
|
|
|
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
startCheckOrder(window.client_moniker, window.partner_order_id);
|
|
|
|
startCheckOrder(window.client_moniker, window.partner_order_id);
|
|
|
|