Fix sendmax. Remove comments

This commit is contained in:
Gustavo Maximiliano Cortez 2017-06-27 20:09:20 -03:00
parent 36b64bdfa7
commit db33b6f685
No known key found for this signature in database
GPG Key ID: 15EDAD8D9F2EB1AF
1 changed files with 3 additions and 10 deletions

View File

@ -149,13 +149,12 @@ angular.module('copayApp.controllers').controller('topUpController', function($s
message: err message: err
}) })
} }
var maxAmountBtc = (values.amount / 100000000).toFixed(8); var maxAmountBtc = Number((values.amount / 100000000).toFixed(8));
console.log('[topup.js:152]',maxAmountBtc); //TODO/
createInvoice({amount: maxAmountBtc, currency: 'BTC'}, function(err, inv) { createInvoice({amount: maxAmountBtc, currency: 'BTC'}, function(err, inv) {
if (err) return cb(err); if (err) return cb(err);
return cb(null, txFormatService.parseAmount(maxAmountBtc - inv.btcDue, 'BTC')); return cb(null, txFormatService.parseAmount(maxAmountBtc - inv.buyerPaidBtcMinerFee, 'BTC'));
}); });
}); });
} else { } else {
@ -171,7 +170,6 @@ console.log('[topup.js:152]',maxAmountBtc); //TODO/
}; };
ongoingProcess.set('loadingTxInfo', true); ongoingProcess.set('loadingTxInfo', true);
createInvoice(dataSrc, function(err, invoice) { createInvoice(dataSrc, function(err, invoice) {
console.log('[topup.js:155] INVOICE',invoice); //TODO/
if (err) { if (err) {
ongoingProcess.set('loadingTxInfo', false); ongoingProcess.set('loadingTxInfo', false);
showErrorAndBack(err.title, err.message); showErrorAndBack(err.title, err.message);
@ -186,7 +184,6 @@ console.log('[topup.js:155] INVOICE',invoice); //TODO/
}); });
createTx(wallet, invoice, message, function(err, ctxp) { createTx(wallet, invoice, message, function(err, ctxp) {
console.log('[topup.js:159] CREATE TX',ctxp); //TODO
ongoingProcess.set('loadingTxInfo', false); ongoingProcess.set('loadingTxInfo', false);
if (err) { if (err) {
showErrorAndBack(err.title, err.message); showErrorAndBack(err.title, err.message);
@ -195,8 +192,7 @@ console.log('[topup.js:159] CREATE TX',ctxp); //TODO
createdTx = ctxp; createdTx = ctxp;
var totalAmountSat = ctxp.amount + ctxp.fee; $scope.totalAmountStr = txFormatService.formatAmountStr(ctxp.amount);
$scope.totalAmountStr = txFormatService.formatAmountStr(totalAmountSat);
setTotalAmount(parsedAmount.amountSat, invoiceFeeSat, ctxp.fee); setTotalAmount(parsedAmount.amountSat, invoiceFeeSat, ctxp.fee);
@ -220,10 +216,8 @@ console.log('[topup.js:159] CREATE TX',ctxp); //TODO
useSendMax = data.stateParams.useSendMax; useSendMax = data.stateParams.useSendMax;
amount = data.stateParams.amount; amount = data.stateParams.amount;
currency = data.stateParams.currency; currency = data.stateParams.currency;
console.log('[topup.js:201]',cardId, useSendMax, amount, currency); //TODO/
bitpayCardService.get({ cardId: cardId, noRefresh: true }, function(err, card) { bitpayCardService.get({ cardId: cardId, noRefresh: true }, function(err, card) {
console.log('[topup.js:203]',card[0]); //TODO/
if (err) { if (err) {
showErrorAndBack(null, err); showErrorAndBack(null, err);
return; return;
@ -285,7 +279,6 @@ console.log('[topup.js:203]',card[0]); //TODO/
$scope.wallet = wallet; $scope.wallet = wallet;
ongoingProcess.set('retrievingInputs', true); ongoingProcess.set('retrievingInputs', true);
parseAmount(wallet, function(err, parsedAmount) { parseAmount(wallet, function(err, parsedAmount) {
console.log('[topup.js:287]',parsedAmount); //TODO/
ongoingProcess.set('retrievingInputs', false); ongoingProcess.set('retrievingInputs', false);
if (err) { if (err) {
showErrorAndBack(err.title, err.message); showErrorAndBack(err.title, err.message);