diff --git a/js/controllers/send.js b/js/controllers/send.js index 08a1dcac3..8ed95b34c 100644 --- a/js/controllers/send.js +++ b/js/controllers/send.js @@ -80,11 +80,11 @@ angular.module('copayApp.controllers').controller('SendController', var message = 'The transaction proposal has been created'; if (merchantData) { if (merchantData.pr.ca) { - message += '\nThis payment protocol transaction' + message += ' This payment protocol transaction' + ' has been verified through ' + merchantData.pr.ca + '.'; } - message += '\nMessage from server: ' + merchantData.ack.memo; - message += '\nFor merchant: ' + merchantData.pr.pd.payment_url; + message += ' Message from server: ' + merchantData.ack.memo; + message += ' For merchant: ' + merchantData.pr.pd.payment_url; } notification.success('Success!', message); $scope.loadTxs(); @@ -94,11 +94,11 @@ angular.module('copayApp.controllers').controller('SendController', var message = 'Transaction id: ' + txid; if (merchantData) { if (merchantData.pr.ca) { - message += '\nThis payment protocol transaction' + message += ' This payment protocol transaction' + ' has been verified through ' + merchantData.pr.ca + '.'; } - message += '\nMessage from server: ' + merchantData.ack.memo; - message += '\nFor merchant: ' + merchantData.pr.pd.payment_url; + message += ' Message from server: ' + merchantData.ack.memo; + message += ' For merchant: ' + merchantData.pr.pd.payment_url; } notification.success('Transaction broadcast', message); } else { @@ -116,6 +116,8 @@ angular.module('copayApp.controllers').controller('SendController', uri = copay.HDPath.parseBitcoinURI(address); } else if (address.indexOf('Merchant: ') === 0) { uri = { merchant: address.split(/\s+/)[1] }; + } else if (/^https?:\/\//.test(address)) { + uri = { merchant: address }; } if (uri && uri.merchant) { diff --git a/js/directives.js b/js/directives.js index 72e9829c5..cefd996a5 100644 --- a/js/directives.js +++ b/js/directives.js @@ -55,8 +55,8 @@ angular.module('copayApp.directives') total = +total / config.unitToSatoshi; notification.info('Payment Request', - 'Server is requesting ' + total + ' ' + config.unitName + '.\n' - + 'Message: ' + memo); + 'Server is requesting ' + total + ' ' + config.unitName + '.' + + ' Message: ' + memo); // XXX Pretty much all of this code accesses the raw DOM. It's // very bad, there's probably a better, more angular-y way to @@ -122,8 +122,6 @@ angular.module('copayApp.directives') sendall.attr('class').replace(' hidden', '')); } } - // TODO: Check paymentRequest expiration, - // delete if beyond expiration date. }; scope.$watch('address',scope._resetPayPro); } @@ -148,7 +146,7 @@ angular.module('copayApp.directives') ctrl.$setValidity('validAddress', true); - return 'Merchant: '+ uri.merchant; + return 'Merchant: ' + uri.merchant; }; ctrl.$parsers.unshift(validator);