paypro: add notification for payment ACK.

This commit is contained in:
Christopher Jeffrey 2014-08-04 10:41:35 -07:00 committed by Manuel Araoz
parent 87987fca2b
commit bfb7477f1a
1 changed files with 16 additions and 2 deletions

View File

@ -332,11 +332,25 @@ angular.module('copayApp.controllers').controller('SendController',
$scope.loading = true;
$rootScope.txAlertCount = 0;
var w = $rootScope.wallet;
w.sendTx(ntxid, function(txid) {
w.sendTx(ntxid, function(txid, ca) {
if (!txid) {
notification.error('Error', 'There was an error sending the transaction');
} else {
if (!ca) {
notification.success('Transaction broadcast', 'Transaction id: '+txid);
} else {
var txp = w.txProposals.txps[ntxid];
var merchantData = txp.merchant;
var message = 'Transaction ID: ' + txid;
if (ca) {
message += '\nThis payment protocol transaction'
+ ' has been verified through ' + ca + '.';
}
if (merchantData) {
message += '\nFor merchant: ' + merchantData.pr.pd.payment_url;
}
notification.success('Transaction sent', message);
}
}
if (cb) return cb();