From 360e1c8f874db51d3f20a00c97d9b3d2cb90e10c Mon Sep 17 00:00:00 2001 From: Marty Alcala Date: Fri, 21 Oct 2016 11:10:01 -0400 Subject: [PATCH] fix paypro scan handling --- src/js/controllers/confirm.js | 8 +++++++- src/js/routes.js | 2 +- src/js/services/incomingData.js | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/js/controllers/confirm.js b/src/js/controllers/confirm.js index 712937c8b..6cdca609a 100644 --- a/src/js/controllers/confirm.js +++ b/src/js/controllers/confirm.js @@ -15,6 +15,7 @@ angular.module('copayApp.controllers').controller('confirmController', function( $scope.toEmail = data.stateParams.toEmail; $scope.description = data.stateParams.description; $scope.paypro = data.stateParams.paypro; + $scope._paypro = $scope.paypro; $scope.paymentExpired = { value: false }; @@ -94,6 +95,7 @@ angular.module('copayApp.controllers').controller('confirmController', function( }); if($scope.paypro) { + console.log('$scope.paypro', $scope.paypro); _paymentTimeControl($scope.paypro.expires); } @@ -199,6 +201,7 @@ angular.module('copayApp.controllers').controller('confirmController', function( // }; function _paymentTimeControl(expirationTime) { + console.log('expirationTime', expirationTime); $scope.paymentExpired.value = false; setExpirationTime(); @@ -313,13 +316,14 @@ angular.module('copayApp.controllers').controller('confirmController', function( txp.outputs = outputs; txp.message = description; - txp.payProUrl = paypro; + txp.payProUrl = paypro.url; txp.excludeUnconfirmedUtxos = config.spendUnconfirmed ? false : true; txp.feeLevel = config.settings && config.settings.feeLevel ? config.settings.feeLevel : 'normal'; txp.dryRun = dryRun; walletService.createTx(wallet, txp, function(err, ctxp) { if (err) { + console.log('in createTx error', err); setSendError(err); return cb(err); } @@ -337,6 +341,8 @@ angular.module('copayApp.controllers').controller('confirmController', function( }; $scope.approve = function(onSendStatusChange) { + console.log('$scope._paypro', $scope._paypro); + console.log('$scope.paymentExpired', $scope.paymentExpired); if ($scope._paypro && $scope.paymentExpired.value) { popupService.showAlert(null, gettextCatalog.getString('The payment request has expired')); $scope.sendStatus = ''; diff --git a/src/js/routes.js b/src/js/routes.js index 2c45c13c6..3584cf3e9 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -260,7 +260,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr } }) .state('tabs.send.confirm', { - url: '/confirm/:isWallet/:toAddress/:toName/:toAmount/:toEmail/:description/:paypro', + url: '/confirm/:isWallet/:toAddress/:toName/:toAmount/:toEmail/:description/{paypro:json}', views: { 'tab-send@tabs': { controller: 'confirmController', diff --git a/src/js/services/incomingData.js b/src/js/services/incomingData.js index 17e93c67d..b74d6b9ae 100644 --- a/src/js/services/incomingData.js +++ b/src/js/services/incomingData.js @@ -180,6 +180,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat } function handlePayPro(payProDetails){ + console.log('payProDetails', payProDetails); var stateParams = { toAmount: payProDetails.amount, toAddress: payProDetails.toAddress,