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