Merge pull request #5514 from cmgustavo/ref/amazon-gift-cards-01
Refactor Amazon integration. Clear amount/confirm views
This commit is contained in:
commit
54ef068968
17 changed files with 721 additions and 329 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -44,7 +44,8 @@ angular.module('copayApp.services').factory('ongoingProcess', function($log, $ti
|
|||
'updatingGiftCards': 'Updating Gift Cards...',
|
||||
'updatingGiftCard': 'Updating Gift Card...',
|
||||
'cancelingGiftCard': 'Canceling Gift Card...',
|
||||
'creatingGiftCard': 'Creating Gift Card...'
|
||||
'creatingGiftCard': 'Creating Gift Card...',
|
||||
'buyingGiftCard': 'Buying Gift Card...'
|
||||
};
|
||||
|
||||
root.clear = function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue