Fix payment uri handling
This commit is contained in:
parent
a3377a5579
commit
d849df98c6
3 changed files with 17 additions and 6 deletions
|
|
@ -3,8 +3,15 @@
|
|||
var bitcore = require('bitcore');
|
||||
|
||||
angular.module('copayApp.controllers').controller('UriPaymentController', function($rootScope, $scope, $routeParams, $timeout, $location) {
|
||||
var data = decodeURIComponent($routeParams.data);
|
||||
$rootScope.pendingPayment = new bitcore.BIP21($routeParams.data);
|
||||
// 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;
|
||||
|
||||
$rootScope.pendingPayment = new bitcore.BIP21(bitcoinURI);
|
||||
|
||||
$timeout(function() {
|
||||
$location.path('/open');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue