Fixes names

This commit is contained in:
Gustavo Maximiliano Cortez 2016-11-29 21:49:56 -03:00
commit 67a1111c56
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
5 changed files with 33 additions and 36 deletions

View file

@ -16,18 +16,18 @@ angular.module('copayApp.controllers').controller('amountController', function($
$scope.$on("$ionicView.beforeEnter", function(event, data) { $scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.buyAmazon = data.stateParams.buyAmazon; $scope.isGiftCard = data.stateParams.isGiftCard;
$scope.isWallet = data.stateParams.isWallet; $scope.isWallet = data.stateParams.isWallet;
$scope.cardId = data.stateParams.cardId; $scope.cardId = data.stateParams.cardId;
$scope.toAddress = data.stateParams.toAddress; $scope.toAddress = data.stateParams.toAddress;
$scope.toName = data.stateParams.toName; $scope.toName = data.stateParams.toName;
$scope.toEmail = data.stateParams.toEmail; $scope.toEmail = data.stateParams.toEmail;
$scope.showAlternativeAmount = !!$scope.cardId || !!$scope.buyAmazon; $scope.showAlternativeAmount = !!$scope.cardId || !!$scope.isGiftCard;
$scope.toColor = data.stateParams.toColor; $scope.toColor = data.stateParams.toColor;
$scope.customAmount = data.stateParams.customAmount; $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') $log.error('Bad params at amount')
throw ('bad params'); 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); ongoingProcess.set('Preparing transaction...', true);
// Get first wallet as UUID // Get first wallet as UUID
var uuid; var uuid;
@ -284,10 +284,10 @@ angular.module('copayApp.controllers').controller('amountController', function($
return; return;
} }
var stateParams = { var stateParams = {
giftAmountUSD: amountUSD, giftCardAmountUSD: amountUSD,
giftAccessKey: dataInvoice.accessKey, giftCardAccessKey: dataInvoice.accessKey,
giftInvoiceTime: invoice.invoiceTime, giftCardInvoiceTime: invoice.invoiceTime,
giftUUID: dataSrc.uuid, giftCardUUID: dataSrc.uuid,
toAmount: payProDetails.amount, toAmount: payProDetails.amount,
toAddress: payProDetails.toAddress, toAddress: payProDetails.toAddress,
description: payProDetails.memo, description: payProDetails.memo,

View file

@ -4,15 +4,22 @@ angular.module('copayApp.controllers').controller('confirmController', function(
var cachedTxp = {}; var cachedTxp = {};
var isChromeApp = platformInfo.isChromeApp; var isChromeApp = platformInfo.isChromeApp;
var countDown = null; var countDown = null;
var giftCardAmountUSD;
var giftCardAccessKey;
var giftCardInvoiceTime;
var giftCardUUID;
$scope.isCordova = platformInfo.isCordova; $scope.isCordova = platformInfo.isCordova;
$ionicConfig.views.swipeBackEnabled(false); $ionicConfig.views.swipeBackEnabled(false);
$scope.$on("$ionicView.beforeEnter", function(event, data) { $scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.buyAmazon = data.stateParams.buyAmazon;
$scope.giftAmountUSD = data.stateParams.giftAmountUSD; // Amazon.com Gift Card parameters
$scope.giftAccessKey = data.stateParams.giftAccessKey; $scope.isGiftCard = data.stateParams.isGiftCard;
$scope.giftInvoiceTime = data.stateParams.giftInvoiceTime; giftCardAmountUSD = data.stateParams.giftCardAmountUSD;
$scope.giftUUID = data.stateParams.giftUUID; giftCardAccessKey = data.stateParams.giftCardAccessKey;
giftCardInvoiceTime = data.stateParams.giftCardInvoiceTime;
giftCardUUID = data.stateParams.giftCardUUID;
$scope.isWallet = data.stateParams.isWallet; $scope.isWallet = data.stateParams.isWallet;
$scope.cardId = data.stateParams.cardId; $scope.cardId = data.stateParams.cardId;
$scope.toAmount = data.stateParams.toAmount; $scope.toAmount = data.stateParams.toAmount;
@ -54,7 +61,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
var wallets = profileService.getWallets({ var wallets = profileService.getWallets({
onlyComplete: true, onlyComplete: true,
network: networkName, network: networkName,
n: $scope.buyAmazon ? true : false n: $scope.isGiftCard ? true : false
}); });
if (!wallets || !wallets.length) { 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 invoiceId = JSON.parse($scope.paypro.merchant_data).invoiceId;
var dataSrc = { var dataSrc = {
currency: 'USD', currency: 'USD',
amount: $scope.giftAmountUSD, amount: giftCardAmountUSD,
uuid: $scope.giftUUID, uuid: giftCardUUID,
accessKey: $scope.giftAccessKey, accessKey: giftCardAccessKey,
invoiceId: invoiceId, invoiceId: invoiceId,
invoiceUrl: $scope.paypro.url, invoiceUrl: $scope.paypro.url,
invoiceTime: $scope.giftInvoiceTime invoiceTime: giftCardInvoiceTime
}; };
debounceCreate(count, dataSrc, onSendStatusChange); debounceCreate(count, dataSrc, onSendStatusChange);
} }

View file

@ -970,16 +970,6 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
cardClaimCode: null 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', { .state('tabs.giftcards.amazon.amount', {
url: '/amount', url: '/amount',
views: { views: {
@ -989,12 +979,12 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
} }
}, },
params: { params: {
buyAmazon: true, isGiftCard: true,
toName: 'Amazon.com Gift Card' toName: 'Amazon.com Gift Card'
} }
}) })
.state('tabs.giftcards.amazon.confirm', { .state('tabs.giftcards.amazon.confirm', {
url: '/confirm/:toAmount/:toAddress/:description/:giftAmountUSD/:giftAccessKey/:giftInvoiceTime/:giftUUID', url: '/confirm/:toAmount/:toAddress/:description/:giftCardAmountUSD/:giftCardAccessKey/:giftCardInvoiceTime/:giftCardUUID',
views: { views: {
'tab-home@tabs': { 'tab-home@tabs': {
controller: 'confirmController', controller: 'confirmController',
@ -1002,7 +992,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
} }
}, },
params: { params: {
buyAmazon: true, isGiftCard: true,
toName: 'Amazon.com Gift Card', toName: 'Amazon.com Gift Card',
paypro: null paypro: null
} }

View file

@ -16,13 +16,13 @@
<i class="icon big-icon-svg" ng-if="isWallet"> <i class="icon big-icon-svg" ng-if="isWallet">
<img src="img/icon-wallet.svg" ng-style="{'background-color': toColor}" class="bg"/> <img src="img/icon-wallet.svg" ng-style="{'background-color': toColor}" class="bg"/>
</i> </i>
<span ng-if="!isWallet && !buyAmazon"> <span ng-if="!isWallet && !isGiftCard">
<gravatar ng-if="!cardId" class="send-gravatar" name="{{toName}}" width="30" email="{{toEmail}}"></gravatar> <gravatar ng-if="!cardId" class="send-gravatar" name="{{toName}}" width="30" email="{{toEmail}}"></gravatar>
<i ng-if="cardId" class="icon big-icon-svg"> <i ng-if="cardId" class="icon big-icon-svg">
<div class="bg icon-bitpay-card"></div> <div class="bg icon-bitpay-card"></div>
</i> </i>
</span> </span>
<span ng-if="buyAmazon"> <span ng-if="isGiftCard">
<i class="icon big-icon-svg"> <i class="icon big-icon-svg">
<div class="bg icon-amazon"></div> <div class="bg icon-amazon"></div>
</i> </i>
@ -36,7 +36,7 @@
<div class="amount-bar oh"> <div class="amount-bar oh">
<div class="title"> <div class="title">
<span translate>Amount</span> <span translate>Amount</span>
<span ng-show="buyAmazon" class="size-12">(Purchase Amount is limited to USD 500 per day)</span> <span ng-show="isGiftCard" class="size-12">(Purchase Amount is limited to USD 500 per day)</span>
</div> </div>
</div> </div>

View file

@ -28,9 +28,9 @@
<div class="item"> <div class="item">
<span class="label" translate>To</span> <span class="label" translate>To</span>
<span class="payment-proposal-to"> <span class="payment-proposal-to">
<img ng-if="!cardId && !buyAmazon" src="img/icon-bitcoin-small.svg"> <img ng-if="!cardId && !isGiftCard" src="img/icon-bitcoin-small.svg">
<img ng-if="cardId" src="img/icon-card.svg" width="34"> <img ng-if="cardId" src="img/icon-card.svg" width="34">
<i ng-if="buyAmazon" class="icon big-icon-svg"> <i ng-if="isGiftCard" class="icon big-icon-svg">
<div class="bg icon-amazon"></div> <div class="bg icon-amazon"></div>
</i> </i>