paypro: fix total on merchantdata.

This commit is contained in:
Christopher Jeffrey 2014-07-30 13:35:57 -07:00 committed by Manuel Araoz
parent f9406bbde2
commit 4d244a03f8
1 changed files with 6 additions and 2 deletions

View File

@ -881,8 +881,8 @@ Wallet.prototype.receivePaymentRequest = function(options, pr, cb) {
},
signature: sig,
ca: ca,
total: bignum('0')
}
},
total: bignum('0').toString(10)
};
return this.getUnspent(function(err, unspent) {
@ -1050,6 +1050,10 @@ Wallet.prototype.createPaymentTxSync = function(options, merchantData, unspent)
var signed = b.sign(keys);
}
if (typeof merchantData.total === 'string') {
merchantData.total = bignum(merchantData.total, 10);
}
merchantData.pr.pd.outputs.forEach(function(output, i) {
var amount = output.get
? output.get('amount')