This commit is contained in:
Marty Alcala 2016-10-19 16:45:29 -04:00
parent 01d5e1d2eb
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() {
// if ($scope.paypro) {
// return setFromPayPro($scope.paypro, function(err) {
// if (err && !isChromeApp) {
// popupService.showAlert(gettext('Could not fetch payment'));
// }
// });
// }
// TODO (URL , etc)
if (!$scope.toAddress || !$scope.toAmount) {
$log.error('Bad params at amount')
$log.error('Bad params at amount');
throw ('bad params');
}
$scope.isCordova = platformInfo.isCordova;
@ -143,59 +136,6 @@ angular.module('copayApp.controllers').controller('confirmController', function(
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) {
var stop;
$scope.wallet = wallet;
@ -222,7 +162,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
});
}, delayed ? 2000 : 1);
}
};
}
var setSendError = function(msg) {
$scope.sendStatus = '';
@ -259,7 +199,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
var msg = 'Amount too big';
$log.warn(msg);
return setSendError(msg);
};
}
outputs.push({
'toAddress': toAddress,

View File

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

View File

@ -13,16 +13,11 @@ angular.module('copayApp.directives')
scope.showMenu = true;
scope.https = false;
console.log('scope.type', scope.type);
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) {
scope.https = true;
}
}
console.log('data', data);
});
});
scope.hide = function() {

View File

@ -8,11 +8,6 @@ angular.module('copayApp.services').factory('incomingData', function($log, $ioni
$rootScope.$broadcast('incomingDataMenu.showMenu', data);
};
// $timeout(function() {
// var data = 'https://bitpay.com';
// root.redir(data);
// }, 2000);
root.redir = function(data) {
$log.debug('Processing incoming data: ' + data);
@ -52,10 +47,6 @@ angular.module('copayApp.services').factory('incomingData', function($log, $ioni
}
data = sanitizeUri(data);
// data = '1F1tAaz5x1HUXrCNLbtMDqcw6o5GNn4xqX';
//data = 'msEVvmpiFEtXv3MdsFLUYMbnNLeNYrqBEA';
//data = 'alkjsdflkajsdf';
console.log('brroooooo');
// BIP21
if (bitcore.URI.isValid(data)) {
@ -86,11 +77,9 @@ angular.module('copayApp.services').factory('incomingData', function($log, $ioni
getPayProDetails(data, function(err, details) {
if(err) {
console.log('getPayProDetails err', err);
root.showMenu({data: data, type: 'url'});
return;
}
console.log('paypro details', details);
$state.go('tabs.send');
var stateParams = {
toAmount: details.amount,
@ -107,13 +96,13 @@ angular.module('copayApp.services').factory('incomingData', function($log, $ioni
} else if (bitcore.Address.isValid(data, 'testnet')) {
root.showMenu({data: data, type: 'bitcoinAddress'});
// 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});
} 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});
// 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 email = getParameterByName('email', data);
var otp = getParameterByName('otp', data);
@ -140,7 +129,6 @@ angular.module('copayApp.services').factory('incomingData', function($log, $ioni
});
return true;
} else {
console.log('unrecognized dood');
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);
console.log('show fetchingPayPro loader');
ongoingProcess.set('fetchingPayPro', true);
//debugger;
// 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);
}

View File

@ -9,7 +9,7 @@ action-sheet {
bottom: 0;
left: 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;
padding-top: 1.75rem;
padding-left: 1.25rem;

View File

@ -62,9 +62,8 @@
<i class="icon bp-arrow-right"></i>
</a>
<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">
<!-- {{feeLevel}} -->
{{fee || '...'}}
</span>
</div>