paypro: refactor cached payment requests.

This commit is contained in:
Christopher Jeffrey 2014-07-31 12:37:47 -07:00 committed by Manuel Araoz
commit 2aee44f31c
2 changed files with 20 additions and 19 deletions

View file

@ -94,18 +94,10 @@ angular.module('copayApp.controllers').controller('SendController',
&& copay.HDPath.parseBitcoinURI(address);
if (uri && uri.merchant) {
var req = w.paymentRequests[uri.merchant];
if (req) {
if (commentText) {
req.options.memo = commentText;
}
w.receivePaymentRequest(req.options, req.pr, done);
} else {
w.createPaymentTx({
uri: uri.merchant,
memo: commentText
}, done);
}
w.createPaymentTx({
uri: uri.merchant,
memo: commentText
}, done);
} else {
w.createTx(address, amount, commentText, done);
}