mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Pay Now using ninja tokens
This commit is contained in:
parent
53e295df4c
commit
0c8e5b2e37
@ -7,8 +7,8 @@
|
|||||||
@section('gateway_content')
|
@section('gateway_content')
|
||||||
|
|
||||||
<form action="javascript:void(0);" id="stepone">
|
<form action="javascript:void(0);" id="stepone">
|
||||||
<input type="hidden" name="gateway_response">
|
<input type="hidden" name="gateway_response">
|
||||||
<button type="submit" class="hidden" id="stepone_submit">Submit</button>
|
<button type="submit" class="hidden" id="stepone_submit">Submit</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<form action="{{ route('client.payments.response') }}" method="post" id="server-response">
|
<form action="{{ route('client.payments.response') }}" method="post" id="server-response">
|
||||||
@ -145,7 +145,13 @@
|
|||||||
console.log("finish");
|
console.log("finish");
|
||||||
console.log(data);
|
console.log(data);
|
||||||
|
|
||||||
process3ds();
|
|
||||||
|
const div = document.getElementById('widget');
|
||||||
|
|
||||||
|
if(div.offsetParent !== null)
|
||||||
|
process3ds();
|
||||||
|
else
|
||||||
|
processNon3ds();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -188,13 +194,16 @@
|
|||||||
document.getElementById('store_card').value = storeCard.value;
|
document.getElementById('store_card').value = storeCard.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(document.querySelector('#server-response input[name=gateway_response]').value.length > 1)
|
document.getElementById('stepone_submit').click();
|
||||||
document.getElementById('stepone_submit').click();
|
|
||||||
else
|
|
||||||
document.getElementById('server-response').submit();
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function processNon3ds()
|
||||||
|
{
|
||||||
|
|
||||||
|
document.getElementById('#server-response').submit();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
async function process3ds()
|
async function process3ds()
|
||||||
{
|
{
|
||||||
@ -204,7 +213,7 @@
|
|||||||
const resource = await get3dsToken();
|
const resource = await get3dsToken();
|
||||||
console.log("3DS Token:", resource);
|
console.log("3DS Token:", resource);
|
||||||
|
|
||||||
if(resource.status != 'pre-authenticated')
|
if(resource.status != "pre_authentication_pending")
|
||||||
throw new Error('There was an issue authenticating this payment method.');
|
throw new Error('There was an issue authenticating this payment method.');
|
||||||
|
|
||||||
console.log("pre canvas");
|
console.log("pre canvas");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user