Bug fix
This commit is contained in:
parent
71994502f8
commit
4eb2bae4a8
25
index.html
25
index.html
@ -14,33 +14,10 @@
|
||||
<script id="floGlobals">
|
||||
/* Constants for FLO blockchain operations !!Make sure to add this at begining!! */
|
||||
const floGlobals = {
|
||||
|
||||
//Required for all
|
||||
blockchain: "FLO",
|
||||
|
||||
//Required for blockchain API operators
|
||||
apiURL: {
|
||||
FLO: ['https://flosight.duckdns.org/', 'https://livenet.flocha.in/'],
|
||||
FLO_TEST: ['https://testnet-flosight.duckdns.org/', 'https://testnet.flocha.in/']
|
||||
},
|
||||
adminID: "FH64hLqB71e6i11rnZZW7hvzoH8daCwy1J",
|
||||
sendAmt: 0.001,
|
||||
fee: 0.0005,
|
||||
|
||||
//Required for token API operations
|
||||
tokenURL: "https://ranchimallflo.duckdns.org/",
|
||||
currency: "rupee",
|
||||
|
||||
//Required for Supernode operations
|
||||
SNStorageID: "FNaN9McoBAEFUjkRmNQRYLmBF8SpS7Tgfk",
|
||||
supernodes: {}, //each supnernode must be stored as floID : {uri:<uri>,pubKey:<publicKey>}
|
||||
|
||||
//for cloud apps
|
||||
subAdmins: [],
|
||||
application: "blockchainUPI",
|
||||
appObjects: {},
|
||||
generalData: {},
|
||||
lastVC: {}
|
||||
application: "blockchainUPI"
|
||||
}
|
||||
</script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/fuse.js@6.4.6" defer></script>
|
||||
|
||||
@ -140,7 +140,7 @@ User.tokenToCash = function(cashier, amount, blkTxID, upiID) {
|
||||
|
||||
User.sendToken = function(receiverID, amount, remark = '', options = {}) {
|
||||
return new Promise((resolve, reject) => {
|
||||
floTokenAPI.sendToken(myPrivKey, amount, receiverID, remark, options)
|
||||
floTokenAPI.sendToken(myPrivKey, amount, receiverID, remark, floTokenAPI.currency, options)
|
||||
.then(result => resolve(result))
|
||||
.catch(error => reject(error))
|
||||
})
|
||||
@ -194,7 +194,7 @@ function startStatusInterval() {
|
||||
|
||||
Cashier.init = function() {
|
||||
delegate(getRef('cashier_pending_request_list'), 'click', '.process-cashier-request', e => {
|
||||
const requestID = e.delegateTarget.closest('.cashier-request').id;
|
||||
const requestID = e.delegateTarget.closest('.cashier-request').dataset.vc;
|
||||
cashierUI.completeRequest(requestID)
|
||||
})
|
||||
getRef('cashier_requests_selector').addEventListener('change', e => {
|
||||
|
||||
@ -419,17 +419,19 @@ function declineTopUp() {
|
||||
|
||||
|
||||
function completeTokenToCashRequest(request) {
|
||||
const { vectorClock, senderID, message: { token_txid, amount, upi_id } } = request
|
||||
if (upi_id instanceof Object && "secret" in upi_id){
|
||||
const { vectorClock, senderID, message: { token_txid, amount, upi_id } } = request;
|
||||
var upiID;
|
||||
if(upi_id instanceof Object && "secret" in upi_id){
|
||||
try {
|
||||
upi_id = floCrypto.decryptData(upi_id, myPrivKey);
|
||||
upiID = floCrypto.decryptData(upi_id, myPrivKey);
|
||||
} catch(error) {
|
||||
console.error("UPI ID is not encrypted with a proper key", error);
|
||||
return notify("Invalid UPI ID", 'error');
|
||||
}
|
||||
}
|
||||
} else
|
||||
upiID = upi_id;
|
||||
Cashier.checkIfTokenTxIsValid(token_txid, senderID, amount).then(result => {
|
||||
getPromptInput('Process', `Token transfer is verified!\n Send ${formatAmount(amount)}\n to ${upi_id}\n Enter UPI transaction ID`, {
|
||||
getPromptInput('Process', `Token transfer is verified!\n Send ${formatAmount(amount)}\n to ${upiID}\n Enter UPI transaction ID`, {
|
||||
placeholder: 'UPI transaction ID',
|
||||
}).then(upiTxID => {
|
||||
if (!upiTxID || upiTxID.length < 10)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user