Refactor Amazon integration. Clear amount/confirm views

This commit is contained in:
Gustavo Maximiliano Cortez 2017-01-24 01:23:57 -03:00
commit b312e38cbc
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
17 changed files with 720 additions and 329 deletions

View file

@ -40,13 +40,13 @@ angular.module('copayApp.services').factory('amazonService', function($http, $lo
};
};
root.getEnvironment = function() {
root.getNetwork = function() {
_setCredentials();
return credentials.NETWORK;
};
root.savePendingGiftCard = function(gc, opts, cb) {
var network = root.getEnvironment();
var network = root.getNetwork();
storageService.getAmazonGiftCards(network, function(err, oldGiftCards) {
if (lodash.isString(oldGiftCards)) {
oldGiftCards = JSON.parse(oldGiftCards);
@ -74,7 +74,7 @@ angular.module('copayApp.services').factory('amazonService', function($http, $lo
};
root.getPendingGiftCards = function(cb) {
var network = root.getEnvironment();
var network = root.getNetwork();
storageService.getAmazonGiftCards(network, function(err, giftCards) {
var _gcds = giftCards ? JSON.parse(giftCards) : null;
return cb(err, _gcds);