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.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,

View file

@ -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);
}

View file

@ -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
}

View file

@ -16,13 +16,13 @@
<i class="icon big-icon-svg" ng-if="isWallet">
<img src="img/icon-wallet.svg" ng-style="{'background-color': toColor}" class="bg"/>
</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>
<i ng-if="cardId" class="icon big-icon-svg">
<div class="bg icon-bitpay-card"></div>
</i>
</span>
<span ng-if="buyAmazon">
<span ng-if="isGiftCard">
<i class="icon big-icon-svg">
<div class="bg icon-amazon"></div>
</i>
@ -36,7 +36,7 @@
<div class="amount-bar oh">
<div class="title">
<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>

View file

@ -28,9 +28,9 @@
<div class="item">
<span class="label" translate>To</span>
<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">
<i ng-if="buyAmazon" class="icon big-icon-svg">
<i ng-if="isGiftCard" class="icon big-icon-svg">
<div class="bg icon-amazon"></div>
</i>