send working. Refactor paypro and payment intents

This commit is contained in:
Matias Alejo Garcia 2014-12-08 18:26:18 -03:00
commit 2fe6ec4c6a
21 changed files with 426 additions and 493 deletions

View file

@ -0,0 +1,19 @@
var bitcore = require('bitcore');
angular.module('copayApp.controllers').controller('paymentUriController', function($rootScope, $scope, $routeParams, $location, go) {
// Build bitcoinURI with querystring
var query = [];
angular.forEach($location.search(), function(value, key) {
query.push(key + "=" + value);
});
var queryString = query ? "?" + query.join("&") : "";
var bitcoinURI = $routeParams.data + queryString;
var uri = new bitcore.BIP21(bitcoinURI);
if (uri.isValid()) {
$rootScope.pendingPayment = bitcoinURI;
}
go.home();
});