handle the "invalid" status

This commit is contained in:
Matias Alejo Garcia 2017-04-13 16:58:42 -03:00
commit dd1209a92c
No known key found for this signature in database
GPG key ID: 02470DB551277AB3
4 changed files with 37 additions and 12 deletions

View file

@ -72,8 +72,10 @@ angular.module('copayApp.services').factory('amazonService', function($http, $lo
if (opts && opts.remove) {
delete(inv[gc.invoiceId]);
}
inv = JSON.stringify(inv);
storageService.setAmazonGiftCards(network, inv, function(err) {
homeIntegrationsService.register(homeItem);
@ -125,8 +127,10 @@ 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);