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

View file

@ -127,10 +127,8 @@ angular.module('copayApp.services').factory('amazonService', function($http, $lo
"invoiceId": data.invoiceId,
"accessKey": data.accessKey
};
console.log('[amazonService.js.129:dataSrc:]',dataSrc); //TODO
$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;
data.data.status = status;
$log.info('Amazon.com Gift Card Create/Update: ' + status);