mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
add unconfirmed payment initial message
This commit is contained in:
parent
f1f64c277c
commit
2ac42b4caf
@ -4,6 +4,10 @@
|
|||||||
<div class="alert alert-failure mb-4" hidden id="errors"></div>
|
<div class="alert alert-failure mb-4" hidden id="errors"></div>
|
||||||
|
|
||||||
<div class="blockonomics-payment-wrapper">
|
<div class="blockonomics-payment-wrapper">
|
||||||
|
<div class="progress-message">
|
||||||
|
The payment is unconfirmed but in progress, please stay tuned.
|
||||||
|
</div>
|
||||||
|
<div class="initial-state">
|
||||||
<div class="invoice-number">Invoice #{{$invoice_number}}</div>
|
<div class="invoice-number">Invoice #{{$invoice_number}}</div>
|
||||||
<div>To pay, send exactly this BTC amount</div>
|
<div>To pay, send exactly this BTC amount</div>
|
||||||
<div class="full-width-input" onclick='copyToClipboard("{{$btc_amount}}", this)'>
|
<div class="full-width-input" onclick='copyToClipboard("{{$btc_amount}}", this)'>
|
||||||
@ -17,6 +21,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="countdown"></div>
|
<div id="countdown"></div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<form action="{{ route('client.payments.response') }}" method="post" id="server-response">
|
<form action="{{ route('client.payments.response') }}" method="post" id="server-response">
|
||||||
@csrf
|
@csrf
|
||||||
@ -94,7 +99,14 @@
|
|||||||
ws.onmessage = function(event) {
|
ws.onmessage = function(event) {
|
||||||
const data = JSON.parse(event.data);
|
const data = JSON.parse(event.data);
|
||||||
console.log('Payment status:', data.status);
|
console.log('Payment status:', data.status);
|
||||||
const isPaymentConfirmed = data.status == 2;
|
const isPaymentUnconfirmed = data.status === 0;
|
||||||
|
const isPaymentConfirmed = data.status === 2;
|
||||||
|
if (isPaymentUnconfirmed) {
|
||||||
|
// Hide all existing content
|
||||||
|
document.querySelector('.initial-state').style.display = 'none';
|
||||||
|
document.querySelector('.progress-message').style.display = 'block';
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (isPaymentConfirmed) {
|
if (isPaymentConfirmed) {
|
||||||
document.querySelector('input[name="txid"]').value = data.txid || '';
|
document.querySelector('input[name="txid"]').value = data.txid || '';
|
||||||
document.getElementById('server-response').submit();
|
document.getElementById('server-response').submit();
|
||||||
@ -120,6 +132,11 @@
|
|||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
.blockonomics-payment-wrapper {
|
.blockonomics-payment-wrapper {
|
||||||
|
padding: 12px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.initial-state {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@ -148,6 +165,12 @@
|
|||||||
transform: translateY(-50%);
|
transform: translateY(-50%);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
.progress-message {
|
||||||
|
display: none;
|
||||||
|
margin: 120px 0;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<!-- @include('portal.ninja2020.gateways.includes.pay_now') -->
|
<!-- @include('portal.ninja2020.gateways.includes.pay_now') -->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user