From bd24f51da40e1e0c296cacf9cd493a46da54adf5 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Tue, 5 Aug 2014 15:14:31 -0700 Subject: [PATCH] put logs back in wallet model for payment protocol This reverts commit e79d86d90625375e22ac2cbafb2c1f894a450bcf. --- js/models/core/Wallet.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/js/models/core/Wallet.js b/js/models/core/Wallet.js index 122192f0f..3b4ab64f6 100644 --- a/js/models/core/Wallet.js +++ b/js/models/core/Wallet.js @@ -952,6 +952,11 @@ Wallet.prototype.receivePaymentRequest = function(options, pr, cb) { self.emit('txProposalsUpdated'); } + self.log('You are currently on this BTC network:'); + self.log(network); + self.log('The server sent you a message:'); + self.log(memo); + return cb(ntxid, merchantData); }); }; @@ -1027,6 +1032,9 @@ Wallet.prototype.sendPaymentTx = function(ntxid, options, cb) { pay = pay.serialize(); + this.log('Sending Payment Message:'); + this.log(pay.toString('hex')); + var buf = new ArrayBuffer(pay.length); var view = new Uint8Array(buf); for (var i = 0; i < pay.length; i++) { @@ -1067,6 +1075,9 @@ Wallet.prototype.receivePaymentRequestACK = function(tx, txp, ack, cb) { var payment = ack.get('payment'); var memo = ack.get('memo'); + this.log('Our payment was acknowledged!'); + this.log('Message from Merchant: %s', memo); + payment = PayPro.Payment.decode(payment); var pay = new PayPro(); payment = pay.makePayment(payment); @@ -1169,6 +1180,11 @@ Wallet.prototype.createPaymentTxSync = function(options, merchantData, unspent) if (options.fetch) return; + this.log(''); + this.log('Created transaction:'); + this.log(b.tx.getStandardizedObject()); + this.log(''); + var myId = this.getMyCopayerId(); var now = Date.now();