commit
71994502f8
@ -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"
|
||||||
@ -1083,7 +1085,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex justify-right gap-0-3">
|
<div class="flex justify-right gap-0-3">
|
||||||
<button class="button" onclick="showChildElement('confirm_topup_wrapper', 1)">Decline</button>
|
<button class="button" onclick="showChildElement('confirm_topup_wrapper', 1)">Decline</button>
|
||||||
<button class="button" onclick="confirmTopUp()">Confirm</button>
|
<div class="multi-state-button">
|
||||||
|
<button class="button" onclick="confirmTopUp(this)">Confirm</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-direction-column gap-1-5 hide" style="height: 24rem;">
|
<div class="flex flex-direction-column gap-1-5 hide" style="height: 24rem;">
|
||||||
|
|||||||
@ -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;
|
||||||
@ -335,11 +338,10 @@ cashierUI.renderRequests = function (requests, error = null) {
|
|||||||
return console.error(error);
|
return console.error(error);
|
||||||
else if (typeof requests !== "object" || requests === null)
|
else if (typeof requests !== "object" || requests === null)
|
||||||
return;
|
return;
|
||||||
const frag = document.createDocumentFragment();
|
|
||||||
for (let transactionID in requests) {
|
for (let transactionID in requests) {
|
||||||
const { note, tag } = requests[transactionID];
|
const { note, tag } = requests[transactionID];
|
||||||
let status = tag ? 'done' : (note ? 'failed' : "pending");
|
let status = tag ? 'done' : (note ? 'failed' : "pending");
|
||||||
getRef('cashier_pending_request_list').querySelectorAll(`[data-vc="${transactionID}"]`).forEach(card => card.remove());
|
getRef('cashier_requests_wrapper').querySelectorAll(`[data-vc="${transactionID}"]`).forEach(card => card.remove());
|
||||||
getRef(status === 'pending' ? 'cashier_pending_request_list' : 'cashier_processed_request_list').prepend(render.cashierRequestCard(requests[transactionID]))
|
getRef(status === 'pending' ? 'cashier_pending_request_list' : 'cashier_processed_request_list').prepend(render.cashierRequestCard(requests[transactionID]))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -369,8 +371,9 @@ function completeCashToTokenRequest(request) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function confirmTopUp() {
|
function confirmTopUp(button) {
|
||||||
const { message: { amount }, vectorClock, senderID } = floGlobals.cashierProcessingRequest;
|
const { message: { amount }, vectorClock, senderID } = floGlobals.cashierProcessingRequest;
|
||||||
|
buttonLoader(button, true);
|
||||||
floBlockchainAPI.getBalance(senderID).then(async user_balance => {
|
floBlockchainAPI.getBalance(senderID).then(async user_balance => {
|
||||||
let sendAmt_FLO = floGlobals.sendAmt;
|
let sendAmt_FLO = floGlobals.sendAmt;
|
||||||
if(user_balance < floGlobals.settings.user_flo_threshold){
|
if(user_balance < floGlobals.settings.user_flo_threshold){
|
||||||
|
|||||||
@ -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