fix backwards compatible qr code paypro scan
This commit is contained in:
parent
41e1d99609
commit
468850f9fb
1 changed files with 23 additions and 10 deletions
|
|
@ -8,6 +8,10 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat
|
||||||
$rootScope.$broadcast('incomingDataMenu.showMenu', data);
|
$rootScope.$broadcast('incomingDataMenu.showMenu', data);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// $timeout(function() {
|
||||||
|
// root.redir('data');
|
||||||
|
// }, 2000);
|
||||||
|
|
||||||
root.redir = function(data) {
|
root.redir = function(data) {
|
||||||
$log.debug('Processing incoming data: ' + data);
|
$log.debug('Processing incoming data: ' + data);
|
||||||
|
|
||||||
|
|
@ -48,6 +52,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat
|
||||||
|
|
||||||
data = sanitizeUri(data);
|
data = sanitizeUri(data);
|
||||||
//data = 'msEVvmpiFEtXv3MdsFLUYMbnNLeNYrqBEA';
|
//data = 'msEVvmpiFEtXv3MdsFLUYMbnNLeNYrqBEA';
|
||||||
|
//data = 'bitcoin:n4asaBf1Vr9Sfijv6e3YJH2SCMdSLNeW64?amount=0.001592&r=https%3A%2F%2Ftest.bitpay.com%3A443%2Fi%2FVLafdjvp5EnEDwV5UHLoFQ';
|
||||||
|
|
||||||
// BIP21
|
// BIP21
|
||||||
if (bitcore.URI.isValid(data)) {
|
if (bitcore.URI.isValid(data)) {
|
||||||
|
|
@ -62,7 +67,9 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat
|
||||||
// Timeout is required to enable the "Back" button
|
// Timeout is required to enable the "Back" button
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
if (parsed.r) {
|
if (parsed.r) {
|
||||||
$state.transitionTo('tabs.send.confirm', {paypro: parsed.r});
|
getPayProDetails(parsed.r, function(err, details) {
|
||||||
|
handlePayPro(details);
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
if (amount) {
|
if (amount) {
|
||||||
$state.transitionTo('tabs.send.confirm', {toAmount: amount, toAddress: addr, description:message});
|
$state.transitionTo('tabs.send.confirm', {toAmount: amount, toAddress: addr, description:message});
|
||||||
|
|
@ -81,14 +88,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat
|
||||||
root.showMenu({data: data, type: 'url'});
|
root.showMenu({data: data, type: 'url'});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$state.go('tabs.send');
|
handlePayPro(details);
|
||||||
var stateParams = {
|
|
||||||
toAmount: details.amount,
|
|
||||||
toAddress: details.toAddress,
|
|
||||||
description: details.memo,
|
|
||||||
paypro: details
|
|
||||||
};
|
|
||||||
$state.transitionTo('tabs.send.confirm', stateParams);
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
// Plain Address
|
// Plain Address
|
||||||
|
|
@ -179,12 +179,25 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat
|
||||||
}
|
}
|
||||||
|
|
||||||
function goToAmountPage(toAddress) {
|
function goToAmountPage(toAddress) {
|
||||||
console.log('goToAmountPage called', toAddress);
|
|
||||||
$state.go('tabs.send');
|
$state.go('tabs.send');
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$state.transitionTo('tabs.send.amount', {toAddress: toAddress});
|
$state.transitionTo('tabs.send.amount', {toAddress: toAddress});
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handlePayPro(payProDetails){
|
||||||
|
var stateParams = {
|
||||||
|
toAmount: payProDetails.amount,
|
||||||
|
toAddress: payProDetails.toAddress,
|
||||||
|
description: payProDetails.memo,
|
||||||
|
paypro: payProDetails
|
||||||
|
};
|
||||||
|
$state.go('tabs.send').then(function() {
|
||||||
|
$timeout(function() {
|
||||||
|
$state.transitionTo('tabs.send.confirm', stateParams);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return root;
|
return root;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue