3ds 流程优化

master
yixian 4 years ago
parent fe7b0234f0
commit 2f177be4a7

@ -5,11 +5,11 @@
<parent> <parent>
<groupId>au.com.royalpay.payment</groupId> <groupId>au.com.royalpay.payment</groupId>
<artifactId>payment-parent</artifactId> <artifactId>payment-parent</artifactId>
<version>2.2.29</version> <version>2.2.30</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId> <artifactId>manage</artifactId>
<version>2.3.86</version> <version>2.3.87-SNAPSHOT</version>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>2.4.0</jib-maven-plugin.version> <jib-maven-plugin.version>2.4.0</jib-maven-plugin.version>

@ -105,6 +105,9 @@
border-radius: 4px; border-radius: 4px;
height: 50px; height: 50px;
} }
.threeds-container .dialog{
width:100%;
}
} }
.btn-warning { .btn-warning {
@ -184,4 +187,33 @@
60% { 60% {
opacity: 1; opacity: 1;
} }
} }
.threeds-container {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
background: rgba(0, 0, 0, .4);
display: block;
}
.threeds-container.hide{
display: none;
}
.threeds-container .dialog{
display: block;
width: 768px;
position: relative;
margin: 40px auto;
background: #fff;
max-height: 80%;
overflow: auto;
}
.threeds-container .dialog>iframe{
border: none;
width: 100%;
}

@ -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);

Loading…
Cancel
Save