send working. Refactor paypro and payment intents
This commit is contained in:
parent
7f42d60d5d
commit
2fe6ec4c6a
21 changed files with 426 additions and 493 deletions
19
js/controllers/paymentUri.js
Normal file
19
js/controllers/paymentUri.js
Normal 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();
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue