This commit is contained in:
Matias Alejo Garcia 2017-04-14 10:15:27 -03:00
commit b7165e22f3
No known key found for this signature in database
GPG key ID: 02470DB551277AB3
2 changed files with 0 additions and 8 deletions

View file

@ -9,7 +9,6 @@ angular.module('copayApp.controllers').controller('amazonCardsController',
var updateGiftCards = function(cb) { var updateGiftCards = function(cb) {
amazonService.getPendingGiftCards(function(err, gcds) { amazonService.getPendingGiftCards(function(err, gcds) {
console.log('[amazonCards.js.11:gcds:]',gcds); //TODO
if (err) { if (err) {
popupService.showAlert('Could not get gift cards', err); popupService.showAlert('Could not get gift cards', err);
if (cb) return cb(); if (cb) return cb();
@ -29,24 +28,19 @@ console.log('[amazonCards.js.11:gcds:]',gcds); //TODO
updateGiftCards(function() { updateGiftCards(function() {
var index = 0; var index = 0;
var gcds = $scope.giftCards; var gcds = $scope.giftCards;
console.log('[amazonCards.js.31:gcds:]',gcds); //TODO
lodash.forEach(gcds, function(dataFromStorage) { lodash.forEach(gcds, function(dataFromStorage) {
console.log('[amazonCards.js.33:dataFromStorage:]',dataFromStorage); //TODO
if (dataFromStorage.status == 'PENDING' || dataFromStorage.status == 'invalid') { if (dataFromStorage.status == 'PENDING' || dataFromStorage.status == 'invalid') {
$log.debug("Creating / Updating gift card"); $log.debug("Creating / Updating gift card");
$scope.updatingPending[dataFromStorage.invoiceId] = true; $scope.updatingPending[dataFromStorage.invoiceId] = true;
console.log('[amazonCards.js.38]'); //TODO
amazonService.createGiftCard(dataFromStorage, function(err, giftCard) { amazonService.createGiftCard(dataFromStorage, function(err, giftCard) {
console.log('[amazonCards.js.41]'); //TODO
$scope.updatingPending[dataFromStorage.invoiceId] = false; $scope.updatingPending[dataFromStorage.invoiceId] = false;
if (err) { if (err) {
popupService.showAlert('Error creating gift card', err); popupService.showAlert('Error creating gift card', err);
return; return;
} }
console.log('[amazonCards.js.48]', giftCard); //TODO
if (giftCard.status != 'PENDING') { if (giftCard.status != 'PENDING') {
var newData = {}; var newData = {};

View file

@ -127,10 +127,8 @@ angular.module('copayApp.services').factory('amazonService', function($http, $lo
"invoiceId": data.invoiceId, "invoiceId": data.invoiceId,
"accessKey": data.accessKey "accessKey": data.accessKey
}; };
console.log('[amazonService.js.129:dataSrc:]',dataSrc); //TODO
$http(_postBitPay('/amazon-gift/redeem', dataSrc)).then(function(data) { $http(_postBitPay('/amazon-gift/redeem', dataSrc)).then(function(data) {
console.log('[amazonService.js.130:data:]',data); //TODO
var status = data.data.status == 'new' ? 'PENDING' : (data.data.status == 'paid') ? 'PENDING' : data.data.status; var status = data.data.status == 'new' ? 'PENDING' : (data.data.status == 'paid') ? 'PENDING' : data.data.status;
data.data.status = status; data.data.status = status;
$log.info('Amazon.com Gift Card Create/Update: ' + status); $log.info('Amazon.com Gift Card Create/Update: ' + status);