New pairing request

This commit is contained in:
Gustavo Maximiliano Cortez 2016-10-11 14:50:35 -03:00
commit d4ace8ab2c
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
4 changed files with 130 additions and 179 deletions

View file

@ -4,9 +4,7 @@ angular.module('copayApp.controllers').controller('bitpayCardController', functi
var self = this;
$scope.dateRange = 'last30Days';
bitpayCardService.getEnvironment(function(err, network) {
$scope.network = network;
});
$scope.network = bitpayCardService.getEnvironment();
var getFromCache = function(cb) {
bitpayCardService.getBitpayDebitCardsHistory($scope.cardId, function(err, data) {
@ -49,8 +47,8 @@ angular.module('copayApp.controllers').controller('bitpayCardController', functi
$scope.loadingHistory = true;
bitpayCardService.getHistory($scope.cardId, dateRange, function(err, history) {
$scope.loadingHistory = false;
if (err || history.error) {
$log.error(err || history.error);
if (err) {
$log.error(err);
$scope.error = gettextCatalog.getString('Could not get transactions');
return;
}

View file

@ -42,31 +42,22 @@ angular.module('copayApp.controllers').controller('bitpayCardIntroController', f
disableAnimate: true
});
$state.go('tabs.home');
if (data.cards[0]) {
$timeout(function() {
$state.transitionTo('tabs.bitpayCard', {id: data.cards[0].id});
}, 100);
}
});
}
});
});
});
} else {
// TEST TODO
bitpayCardService.testSession(function(err, session) {
bitpayCardService.getCredentials(function(err, credentials) {
if (err) popupService.showAlert(null, err);
else $log.info('BitPay Debit Card Credentials: Ok.');
});
}
/*
storageService.getNextStep('BitpayCard', function(err, value) {
if (value) {
$ionicHistory.nextViewOptions({
disableAnimate: true
});
$state.go('tabs.home');
$timeout(function() {
$state.transitionTo('tabs.bitpayCard');
}, 100);
}
});
*/
});
$scope.orderBitPayCard = function() {