Added blockchain transaction link for withdrawal
This commit is contained in:
parent
4a2311f2ae
commit
7a4bd4ee7d
@ -952,6 +952,8 @@
|
|||||||
</svg>
|
</svg>
|
||||||
<h4>Sent transfer to bank request</h4>
|
<h4>Sent transfer to bank request</h4>
|
||||||
<p>This may take upto 30 mins to complete</p>
|
<p>This may take upto 30 mins to complete</p>
|
||||||
|
<a href="" class="hide" target="_blank" id="withdrawal_blockchain_link">Check transaction on
|
||||||
|
blockchain</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="grid gap-0-5 hide justify-center text-center">
|
<div class="grid gap-0-5 hide justify-center text-center">
|
||||||
<svg class="icon user-action-result__icon failed" xmlns="http://www.w3.org/2000/svg" height="24px"
|
<svg class="icon user-action-result__icon failed" xmlns="http://www.w3.org/2000/svg" height="24px"
|
||||||
|
|||||||
@ -85,11 +85,14 @@ function withdrawMoneyFromWallet() {
|
|||||||
if (!upiId)
|
if (!upiId)
|
||||||
return notify("Please add an UPI ID to continue", 'error');
|
return notify("Please add an UPI ID to continue", 'error');
|
||||||
buttonLoader('withdraw_rupee_button', true);
|
buttonLoader('withdraw_rupee_button', true);
|
||||||
|
getRef('withdrawal_blockchain_link').classList.add('hide');
|
||||||
User.sendToken(cashier, amount, 'for token-to-cash').then(txid => {
|
User.sendToken(cashier, amount, 'for token-to-cash').then(txid => {
|
||||||
console.warn(`Withdraw ${amount} from cashier ${cashier}`, txid);
|
console.warn(`Withdraw ${amount} from cashier ${cashier}`, txid);
|
||||||
User.tokenToCash(cashier, amount, txid, upiId).then(result => {
|
User.tokenToCash(cashier, amount, txid, upiId).then(result => {
|
||||||
showChildElement('withdraw_wallet_process', 1);
|
showChildElement('withdraw_wallet_process', 1);
|
||||||
refreshBalance();
|
refreshBalance();
|
||||||
|
getRef('withdrawal_blockchain_link').classList.remove('hide');
|
||||||
|
getRef('withdrawal_blockchain_link').href = `https://flosight.duckdns.org/tx/${txid}`
|
||||||
console.log(result);
|
console.log(result);
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
getRef('withdrawal_failed_reason').textContent = error;
|
getRef('withdrawal_failed_reason').textContent = error;
|
||||||
|
|||||||
@ -452,11 +452,11 @@ async function showPage(targetPage, options = {}) {
|
|||||||
} else if (params.type === 'wallet') {
|
} else if (params.type === 'wallet') {
|
||||||
transactionDetails = User.cashierRequests[params.transactionId]
|
transactionDetails = User.cashierRequests[params.transactionId]
|
||||||
console.log(transactionDetails)
|
console.log(transactionDetails)
|
||||||
const { message: { amount, mode, upi_id, upi_txid }, note, tag } = transactionDetails
|
const { message: { amount, mode, upi_id, upi_txid, token_txid }, note, tag } = transactionDetails
|
||||||
status = tag ? tag : (note ? 'REJECTED' : "PENDING");
|
status = tag ? tag : (note ? 'REJECTED' : "PENDING");
|
||||||
getRef('transaction__type').textContent = mode === 'cash-to-token' ? 'Wallet top-up' : 'Withdraw';
|
getRef('transaction__type').textContent = mode === 'cash-to-token' ? 'Wallet top-up' : 'Withdraw';
|
||||||
if (status === 'COMPLETED') {
|
if (status === 'COMPLETED') {
|
||||||
getRef('transaction__link').href = `https://flosight.duckdns.org/tx/${note}`
|
getRef('transaction__link').href = `https://flosight.duckdns.org/tx/${mode === 'cash-to-token' ? note : token_txid}`
|
||||||
getRef('transaction__link').classList.remove('hide')
|
getRef('transaction__link').classList.remove('hide')
|
||||||
} else if (status === 'REJECTED') {
|
} else if (status === 'REJECTED') {
|
||||||
getRef('transaction__note').innerHTML = `<svg class="icon failed" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"></path><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"></path></svg> ${note.split(':')[1]}`
|
getRef('transaction__note').innerHTML = `<svg class="icon failed" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"></path><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"></path></svg> ${note.split(':')[1]}`
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user