From 67a1111c56cca48cc1231bf82958045fe19a06b6 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Tue, 29 Nov 2016 21:49:56 -0300 Subject: [PATCH] Fixes names --- src/js/controllers/amount.js | 16 ++++++++-------- src/js/controllers/confirm.js | 27 +++++++++++++++++---------- src/js/routes.js | 16 +++------------- www/views/amount.html | 6 +++--- www/views/confirm.html | 4 ++-- 5 files changed, 33 insertions(+), 36 deletions(-) diff --git a/src/js/controllers/amount.js b/src/js/controllers/amount.js index 4ff6ada67..4d83a4bd7 100644 --- a/src/js/controllers/amount.js +++ b/src/js/controllers/amount.js @@ -16,18 +16,18 @@ angular.module('copayApp.controllers').controller('amountController', function($ $scope.$on("$ionicView.beforeEnter", function(event, data) { - $scope.buyAmazon = data.stateParams.buyAmazon; + $scope.isGiftCard = data.stateParams.isGiftCard; $scope.isWallet = data.stateParams.isWallet; $scope.cardId = data.stateParams.cardId; $scope.toAddress = data.stateParams.toAddress; $scope.toName = data.stateParams.toName; $scope.toEmail = data.stateParams.toEmail; - $scope.showAlternativeAmount = !!$scope.cardId || !!$scope.buyAmazon; + $scope.showAlternativeAmount = !!$scope.cardId || !!$scope.isGiftCard; $scope.toColor = data.stateParams.toColor; $scope.customAmount = data.stateParams.customAmount; - if (!$scope.cardId && !$scope.buyAmazon && !data.stateParams.toAddress) { + if (!$scope.cardId && !$scope.isGiftCard && !data.stateParams.toAddress) { $log.error('Bad params at amount') throw ('bad params'); } @@ -242,7 +242,7 @@ angular.module('copayApp.controllers').controller('amountController', function($ }); }); - } else if ($scope.buyAmazon) { + } else if ($scope.isGiftCard) { ongoingProcess.set('Preparing transaction...', true); // Get first wallet as UUID var uuid; @@ -284,10 +284,10 @@ angular.module('copayApp.controllers').controller('amountController', function($ return; } var stateParams = { - giftAmountUSD: amountUSD, - giftAccessKey: dataInvoice.accessKey, - giftInvoiceTime: invoice.invoiceTime, - giftUUID: dataSrc.uuid, + giftCardAmountUSD: amountUSD, + giftCardAccessKey: dataInvoice.accessKey, + giftCardInvoiceTime: invoice.invoiceTime, + giftCardUUID: dataSrc.uuid, toAmount: payProDetails.amount, toAddress: payProDetails.toAddress, description: payProDetails.memo, diff --git a/src/js/controllers/confirm.js b/src/js/controllers/confirm.js index 39337a823..4919263d8 100644 --- a/src/js/controllers/confirm.js +++ b/src/js/controllers/confirm.js @@ -4,15 +4,22 @@ angular.module('copayApp.controllers').controller('confirmController', function( var cachedTxp = {}; var isChromeApp = platformInfo.isChromeApp; var countDown = null; + var giftCardAmountUSD; + var giftCardAccessKey; + var giftCardInvoiceTime; + var giftCardUUID; $scope.isCordova = platformInfo.isCordova; $ionicConfig.views.swipeBackEnabled(false); $scope.$on("$ionicView.beforeEnter", function(event, data) { - $scope.buyAmazon = data.stateParams.buyAmazon; - $scope.giftAmountUSD = data.stateParams.giftAmountUSD; - $scope.giftAccessKey = data.stateParams.giftAccessKey; - $scope.giftInvoiceTime = data.stateParams.giftInvoiceTime; - $scope.giftUUID = data.stateParams.giftUUID; + + // Amazon.com Gift Card parameters + $scope.isGiftCard = data.stateParams.isGiftCard; + giftCardAmountUSD = data.stateParams.giftCardAmountUSD; + giftCardAccessKey = data.stateParams.giftCardAccessKey; + giftCardInvoiceTime = data.stateParams.giftCardInvoiceTime; + giftCardUUID = data.stateParams.giftCardUUID; + $scope.isWallet = data.stateParams.isWallet; $scope.cardId = data.stateParams.cardId; $scope.toAmount = data.stateParams.toAmount; @@ -54,7 +61,7 @@ angular.module('copayApp.controllers').controller('confirmController', function( var wallets = profileService.getWallets({ onlyComplete: true, network: networkName, - n: $scope.buyAmazon ? true : false + n: $scope.isGiftCard ? true : false }); if (!wallets || !wallets.length) { @@ -420,12 +427,12 @@ angular.module('copayApp.controllers').controller('confirmController', function( var invoiceId = JSON.parse($scope.paypro.merchant_data).invoiceId; var dataSrc = { currency: 'USD', - amount: $scope.giftAmountUSD, - uuid: $scope.giftUUID, - accessKey: $scope.giftAccessKey, + amount: giftCardAmountUSD, + uuid: giftCardUUID, + accessKey: giftCardAccessKey, invoiceId: invoiceId, invoiceUrl: $scope.paypro.url, - invoiceTime: $scope.giftInvoiceTime + invoiceTime: giftCardInvoiceTime }; debounceCreate(count, dataSrc, onSendStatusChange); } diff --git a/src/js/routes.js b/src/js/routes.js index 43c3c4fc4..d86d0c8ab 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -970,16 +970,6 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr cardClaimCode: null } }) - .state('tabs.giftcards.amazon.buy', { - url: '/buy', - views: { - 'tab-home@tabs': { - controller: 'buyAmazonController', - controllerAs: 'buy', - templateUrl: 'views/buyAmazon.html' - } - } - }) .state('tabs.giftcards.amazon.amount', { url: '/amount', views: { @@ -989,12 +979,12 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr } }, params: { - buyAmazon: true, + isGiftCard: true, toName: 'Amazon.com Gift Card' } }) .state('tabs.giftcards.amazon.confirm', { - url: '/confirm/:toAmount/:toAddress/:description/:giftAmountUSD/:giftAccessKey/:giftInvoiceTime/:giftUUID', + url: '/confirm/:toAmount/:toAddress/:description/:giftCardAmountUSD/:giftCardAccessKey/:giftCardInvoiceTime/:giftCardUUID', views: { 'tab-home@tabs': { controller: 'confirmController', @@ -1002,7 +992,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr } }, params: { - buyAmazon: true, + isGiftCard: true, toName: 'Amazon.com Gift Card', paypro: null } diff --git a/www/views/amount.html b/www/views/amount.html index a19348795..6892406a7 100644 --- a/www/views/amount.html +++ b/www/views/amount.html @@ -16,13 +16,13 @@ - +
- +
@@ -36,7 +36,7 @@
Amount - (Purchase Amount is limited to USD 500 per day) + (Purchase Amount is limited to USD 500 per day)
diff --git a/www/views/confirm.html b/www/views/confirm.html index e84ed5b93..85d9006d4 100644 --- a/www/views/confirm.html +++ b/www/views/confirm.html @@ -28,9 +28,9 @@
To - + - +