Buy gift card. Limits

This commit is contained in:
Gustavo Maximiliano Cortez 2017-07-05 18:42:35 -03:00
commit 3e78971446
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
7 changed files with 221 additions and 193 deletions

View file

@ -46,15 +46,6 @@ angular.module('copayApp.controllers').controller('mercadoLibreCardsController',
lodash.merge(newData, dataFromStorage, giftCard);
if (newData.status == 'expired') {
mercadoLibreService.savePendingGiftCard(newData, {
remove: true
}, function(err) {
updateGiftCards();
return;
});
}
mercadoLibreService.savePendingGiftCard(newData, null, function(err) {
$log.debug("Saving new gift card");
updateGiftCards();
@ -85,11 +76,11 @@ angular.module('copayApp.controllers').controller('mercadoLibreCardsController',
};
$scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.cardClaimCode = data.stateParams.cardClaimCode;
$scope.invoiceId = data.stateParams.invoiceId;
updateGiftCards(function() {
if ($scope.cardClaimCode) {
if ($scope.invoiceId) {
var card = lodash.find($scope.giftCards, {
claimCode: $scope.cardClaimCode
invoiceId: $scope.invoiceId
});
if (lodash.isEmpty(card)) {
popupService.showAlert(null, 'Card not found');