fetch paypro details before navigating to confirm view for a topup

This commit is contained in:
Marty Alcala 2016-10-26 16:03:20 -04:00
commit c0c08eeb59
4 changed files with 28 additions and 30 deletions

View file

@ -15,7 +15,6 @@ angular.module('copayApp.controllers').controller('confirmController', function(
$scope.toEmail = data.stateParams.toEmail;
$scope.description = data.stateParams.description;
$scope.paypro = data.stateParams.paypro;
$scope.payProUrl = data.stateParams.payProUrl;
$scope._paypro = $scope.paypro;
$scope.paymentExpired = {
value: false
@ -27,19 +26,6 @@ angular.module('copayApp.controllers').controller('confirmController', function(
});
var initConfirm = function() {
console.log('in init confirm');
console.log('$scope.paypro', $scope.paypro);
if($scope.payProUrl && !$scope.paypro) {
console.log('getting paypro details', $scope.payProUrl);
payproService.getPayProDetails($scope.payProUrl, function(err, details) {
console.log('paypro details', details);
$scope.toAmount = details.amount;
$scope.toAddress = details.toAddress;
$scope.description = details.memo;
$scope.paypro = details;
return initConfirm();
});
}
// TODO (URL , etc)
if (!$scope.toAddress || !$scope.toAmount) {
$log.error('Bad params at amount');