diff --git a/js/controllers/send.js b/js/controllers/send.js index 2b37844d6..80ff2e5a3 100644 --- a/js/controllers/send.js +++ b/js/controllers/send.js @@ -169,26 +169,23 @@ angular.module('copayApp.controllers').controller('SendController', $rootScope.pendingPayment = null; } - // XXX Payment Protocol is temporarily disabled. - // var uri; - // if (address.indexOf('bitcoin:') === 0) { - // uri = new bitcore.BIP21(address).data; - // } else if (/^https?:\/\//.test(address)) { - // uri = { - // merchant: address - // }; - // } - // - // if (uri && uri.merchant) { - // w.createPaymentTx({ - // uri: uri.merchant, - // memo: commentText - // }, done); - // } else { - // w.createTx(address, amount, commentText, done); - // } + var uri; + if (address.indexOf('bitcoin:') === 0) { + uri = new bitcore.BIP21(address).data; + } else if (/^https?:\/\//.test(address)) { + uri = { + merchant: address + }; + } - w.createTx(address, amount, commentText, done); + if (uri && uri.merchant) { + w.createPaymentTx({ + uri: uri.merchant, + memo: commentText + }, done); + } else { + w.createTx(address, amount, commentText, done); + } // reset fields $scope.address = $scope.amount = $scope.commentText = null; @@ -564,9 +561,4 @@ angular.module('copayApp.controllers').controller('SendController', }); }; - // XXX Payment Protocol is temporarily disabled. - $scope.onChanged = function() { - ; - }; - });