Bug fix
This commit is contained in:
parent
71994502f8
commit
4eb2bae4a8
25
index.html
25
index.html
@ -14,33 +14,10 @@
|
|||||||
<script id="floGlobals">
|
<script id="floGlobals">
|
||||||
/* Constants for FLO blockchain operations !!Make sure to add this at begining!! */
|
/* Constants for FLO blockchain operations !!Make sure to add this at begining!! */
|
||||||
const floGlobals = {
|
const floGlobals = {
|
||||||
|
|
||||||
//Required for all
|
|
||||||
blockchain: "FLO",
|
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",
|
adminID: "FH64hLqB71e6i11rnZZW7hvzoH8daCwy1J",
|
||||||
sendAmt: 0.001,
|
|
||||||
fee: 0.0005,
|
|
||||||
|
|
||||||
//Required for token API operations
|
|
||||||
tokenURL: "https://ranchimallflo.duckdns.org/",
|
|
||||||
currency: "rupee",
|
currency: "rupee",
|
||||||
|
application: "blockchainUPI"
|
||||||
//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: {}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/fuse.js@6.4.6" defer></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 = {}) {
|
User.sendToken = function(receiverID, amount, remark = '', options = {}) {
|
||||||
return new Promise((resolve, reject) => {
|
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))
|
.then(result => resolve(result))
|
||||||
.catch(error => reject(error))
|
.catch(error => reject(error))
|
||||||
})
|
})
|
||||||
@ -194,7 +194,7 @@ function startStatusInterval() {
|
|||||||
|
|
||||||
Cashier.init = function() {
|
Cashier.init = function() {
|
||||||
delegate(getRef('cashier_pending_request_list'), 'click', '.process-cashier-request', e => {
|
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)
|
cashierUI.completeRequest(requestID)
|
||||||
})
|
})
|
||||||
getRef('cashier_requests_selector').addEventListener('change', e => {
|
getRef('cashier_requests_selector').addEventListener('change', e => {
|
||||||
|
|||||||
@ -419,17 +419,19 @@ function declineTopUp() {
|
|||||||
|
|
||||||
|
|
||||||
function completeTokenToCashRequest(request) {
|
function completeTokenToCashRequest(request) {
|
||||||
const { vectorClock, senderID, message: { token_txid, amount, upi_id } } = request
|
const { vectorClock, senderID, message: { token_txid, amount, upi_id } } = request;
|
||||||
if (upi_id instanceof Object && "secret" in upi_id){
|
var upiID;
|
||||||
|
if(upi_id instanceof Object && "secret" in upi_id){
|
||||||
try {
|
try {
|
||||||
upi_id = floCrypto.decryptData(upi_id, myPrivKey);
|
upiID = floCrypto.decryptData(upi_id, myPrivKey);
|
||||||
} catch(error) {
|
} catch(error) {
|
||||||
console.error("UPI ID is not encrypted with a proper key", error);
|
console.error("UPI ID is not encrypted with a proper key", error);
|
||||||
return notify("Invalid UPI ID", 'error');
|
return notify("Invalid UPI ID", 'error');
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
|
upiID = upi_id;
|
||||||
Cashier.checkIfTokenTxIsValid(token_txid, senderID, amount).then(result => {
|
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',
|
placeholder: 'UPI transaction ID',
|
||||||
}).then(upiTxID => {
|
}).then(upiTxID => {
|
||||||
if (!upiTxID || upiTxID.length < 10)
|
if (!upiTxID || upiTxID.length < 10)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user