This commit is contained in:
Marty Alcala 2016-10-19 16:45:29 -04:00
commit 01da9d91e4
6 changed files with 9 additions and 102 deletions

View file

@ -19,16 +19,9 @@ angular.module('copayApp.controllers').controller('confirmController', function(
}); });
var initConfirm = function() { var initConfirm = function() {
// if ($scope.paypro) {
// return setFromPayPro($scope.paypro, function(err) {
// if (err && !isChromeApp) {
// popupService.showAlert(gettext('Could not fetch payment'));
// }
// });
// }
// TODO (URL , etc) // TODO (URL , etc)
if (!$scope.toAddress || !$scope.toAmount) { if (!$scope.toAddress || !$scope.toAmount) {
$log.error('Bad params at amount') $log.error('Bad params at amount');
throw ('bad params'); throw ('bad params');
} }
$scope.isCordova = platformInfo.isCordova; $scope.isCordova = platformInfo.isCordova;
@ -143,59 +136,6 @@ angular.module('copayApp.controllers').controller('confirmController', function(
return amountStr.split(' ')[1]; return amountStr.split(' ')[1];
} }
// var setFromPayPro = function(uri, cb) {
// if (!cb) cb = function() {};
//
// var wallet = profileService.getWallets({
// onlyComplete: true
// })[0];
//
// if (!wallet) return cb();
//
// if (isChromeApp) {
// popupService.showAlert(gettextCatalog.getString('Payment Protocol not supported on Chrome App'));
// return cb(true);
// }
//
// $log.debug('Fetch PayPro Request...', uri);
//
// ongoingProcess.set('fetchingPayPro', true);
// //debugger;
// var uri = 'https://bitpay.com/i/NhjqGZo1RNoHxiHxK7VBuM';
// uri = 'https://test.bitpay.com:443/i/LCy5Y7hxmEbkprAK27odAU';
// wallet.fetchPayPro({
// payProUrl: uri,
// }, function(err, paypro) {
// console.log('paypro', paypro);
// ongoingProcess.set('fetchingPayPro', false);
//
// if (err) {
// $log.warn('Could not fetch payment request:', err);
// var msg = err.toString();
// if (msg.match('HTTP')) {
// msg = gettextCatalog.getString('Could not fetch payment information');
// }
// popupService.showAlert(msg);
// return cb(true);
// }
//
// if (!paypro.verified) {
// $log.warn('Failed to verify payment protocol signatures');
// popupService.showAlert(gettextCatalog.getString('Payment Protocol Invalid'));
// return cb(true);
// }
//
// $scope.toAmount = paypro.amount;
// $scope.toAddress = paypro.toAddress;
// $scope.description = paypro.memo;
// $scope.paypro = null;
//
// $scope._paypro = paypro;
//
// return initConfirm();
// });
// };
function setWallet(wallet, delayed) { function setWallet(wallet, delayed) {
var stop; var stop;
$scope.wallet = wallet; $scope.wallet = wallet;
@ -222,7 +162,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
}); });
}, delayed ? 2000 : 1); }, delayed ? 2000 : 1);
} }
}; }
var setSendError = function(msg) { var setSendError = function(msg) {
$scope.sendStatus = ''; $scope.sendStatus = '';
@ -259,7 +199,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
var msg = 'Amount too big'; var msg = 'Amount too big';
$log.warn(msg); $log.warn(msg);
return setSendError(msg); return setSendError(msg);
}; }
outputs.push({ outputs.push({
'toAddress': toAddress, 'toAddress': toAddress,

View file

@ -11,10 +11,6 @@ angular.module('copayApp.controllers').controller('tabScanController', function(
}; };
$scope.scannerStates = scannerStates; $scope.scannerStates = scannerStates;
$timeout(function() {
$scope.showActionSheet = true;
}, 2000);
function _updateCapabilities(){ function _updateCapabilities(){
var capabilities = scannerService.getCapabilities(); var capabilities = scannerService.getCapabilities();
$scope.scannerIsAvailable = capabilities.isAvailable; $scope.scannerIsAvailable = capabilities.isAvailable;
@ -105,7 +101,6 @@ angular.module('copayApp.controllers').controller('tabScanController', function(
} }
$rootScope.$on('incomingDataMenu.menuHidden', function() { $rootScope.$on('incomingDataMenu.menuHidden', function() {
console.log('in herererere');
scannerService.resumePreview(); scannerService.resumePreview();
activate(); activate();
}); });

View file

@ -13,16 +13,11 @@ angular.module('copayApp.directives')
scope.showMenu = true; scope.showMenu = true;
scope.https = false; scope.https = false;
console.log('scope.type', scope.type);
if(scope.type === 'url') { if(scope.type === 'url') {
console.log('scope.data', scope.data);
console.log('scope.data.indexOf("https://")', scope.data.indexOf('https://'));
if(scope.data.indexOf('https://') === 0) { if(scope.data.indexOf('https://') === 0) {
scope.https = true; scope.https = true;
} }
} }
console.log('data', data);
}); });
}); });
scope.hide = function() { scope.hide = function() {

View file

@ -8,11 +8,6 @@ angular.module('copayApp.services').factory('incomingData', function($log, $ioni
$rootScope.$broadcast('incomingDataMenu.showMenu', data); $rootScope.$broadcast('incomingDataMenu.showMenu', data);
}; };
// $timeout(function() {
// var data = 'https://bitpay.com';
// root.redir(data);
// }, 2000);
root.redir = function(data) { root.redir = function(data) {
$log.debug('Processing incoming data: ' + data); $log.debug('Processing incoming data: ' + data);
@ -52,10 +47,6 @@ angular.module('copayApp.services').factory('incomingData', function($log, $ioni
} }
data = sanitizeUri(data); data = sanitizeUri(data);
// data = '1F1tAaz5x1HUXrCNLbtMDqcw6o5GNn4xqX';
//data = 'msEVvmpiFEtXv3MdsFLUYMbnNLeNYrqBEA';
//data = 'alkjsdflkajsdf';
console.log('brroooooo');
// BIP21 // BIP21
if (bitcore.URI.isValid(data)) { if (bitcore.URI.isValid(data)) {
@ -86,11 +77,9 @@ angular.module('copayApp.services').factory('incomingData', function($log, $ioni
getPayProDetails(data, function(err, details) { getPayProDetails(data, function(err, details) {
if(err) { if(err) {
console.log('getPayProDetails err', err);
root.showMenu({data: data, type: 'url'}); root.showMenu({data: data, type: 'url'});
return; return;
} }
console.log('paypro details', details);
$state.go('tabs.send'); $state.go('tabs.send');
var stateParams = { var stateParams = {
toAmount: details.amount, toAmount: details.amount,
@ -107,13 +96,13 @@ angular.module('copayApp.services').factory('incomingData', function($log, $ioni
} else if (bitcore.Address.isValid(data, 'testnet')) { } else if (bitcore.Address.isValid(data, 'testnet')) {
root.showMenu({data: data, type: 'bitcoinAddress'}); root.showMenu({data: data, type: 'bitcoinAddress'});
// Protocol // Protocol
} else if (data && data.indexOf($window.appConfig.name + '://glidera')==0) { } else if (data && data.indexOf($window.appConfig.name + '://glidera') === 0) {
return $state.go('uriglidera', {url: data}); return $state.go('uriglidera', {url: data});
} else if (data && data.indexOf($window.appConfig.name + '://coinbase')==0) { } else if (data && data.indexOf($window.appConfig.name + '://coinbase') === 0) {
return $state.go('uricoinbase', {url: data}); return $state.go('uricoinbase', {url: data});
// BitPayCard Authentication // BitPayCard Authentication
} else if (data && data.indexOf($window.appConfig.name + '://')==0) { } else if (data && data.indexOf($window.appConfig.name + '://') === 0) {
var secret = getParameterByName('secret', data); var secret = getParameterByName('secret', data);
var email = getParameterByName('email', data); var email = getParameterByName('email', data);
var otp = getParameterByName('otp', data); var otp = getParameterByName('otp', data);
@ -140,7 +129,6 @@ angular.module('copayApp.services').factory('incomingData', function($log, $ioni
}); });
return true; return true;
} else { } else {
console.log('unrecognized dood');
root.showMenu({data: data, type: 'text'}); root.showMenu({data: data, type: 'text'});
} }
@ -164,24 +152,14 @@ angular.module('copayApp.services').factory('incomingData', function($log, $ioni
$log.debug('Fetch PayPro Request...', uri); $log.debug('Fetch PayPro Request...', uri);
console.log('show fetchingPayPro loader');
ongoingProcess.set('fetchingPayPro', true); ongoingProcess.set('fetchingPayPro', true);
//debugger;
// uri = 'https://bitpay.com/i/NhjqGZo1RNoHxiHxK7VBuM';
//uri = 'https://test.bitpay.com:443/i/LCy5Y7hxmEbkprAK27odAU';
wallet.fetchPayPro({ wallet.fetchPayPro({
payProUrl: uri, payProUrl: uri,
}, function(err, paypro) { }, function(err, paypro) {
console.log('paypro', paypro);
ongoingProcess.set('fetchingPayPro', false); ongoingProcess.set('fetchingPayPro', false);
if (err) { if (err) {
// $log.warn('Could not fetch payment request:', err);
// var msg = err.toString();
// if (msg.match('HTTP')) {
// msg = gettextCatalog.getString('Could not fetch payment information');
// }
// popupService.showAlert(msg);
return cb(true); return cb(true);
} }

View file

@ -9,7 +9,7 @@ action-sheet {
bottom: 0; bottom: 0;
left: 50%; left: 50%;
transform: translateY(100%) translateX(-50%); transform: translateY(100%) translateX(-50%);
transition: transform 250ms cubic-bezier(0.4, 0.0, 0.2, 1) !important; transition: transform 250ms cubic-bezier(0.4, 0.0, 0.2, 1);
z-index: 100; z-index: 100;
padding-top: 1.75rem; padding-top: 1.75rem;
padding-left: 1.25rem; padding-left: 1.25rem;

View file

@ -62,9 +62,8 @@
<i class="icon bp-arrow-right"></i> <i class="icon bp-arrow-right"></i>
</a> </a>
<div class="item single-line" ng-hide="insuffientFunds"> <div class="item single-line" ng-hide="insuffientFunds">
<span class="label" translate>Fee</span> <span class="label" translate>Fee: {{feeLevel}}</span>
<span class="item-note"> <span class="item-note">
<!-- {{feeLevel}} -->
{{fee || '...'}} {{fee || '...'}}
</span> </span>
</div> </div>