Buy gift card. Limits
This commit is contained in:
parent
ef650aff86
commit
3e78971446
7 changed files with 221 additions and 193 deletions
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue