Merge branch 'feat/bitpay-accounts' of https://github.com/ajp8164/copay into feat/bitpay-accounts
This commit is contained in:
commit
14aa806267
1 changed files with 23 additions and 1 deletions
|
|
@ -380,7 +380,7 @@ angular.module('copayApp.services')
|
|||
bitpayAccounts = bitpayAccounts || {};
|
||||
bitpayAccounts[data.email] = bitpayAccounts[data.email] || {};
|
||||
bitpayAccounts[data.email]['bitpayDebitCards-' + network] = data.cards;
|
||||
storage.set('bitpayAccounts-v2-' + network, JSON.stringify(bitpayAccounts), cb);
|
||||
storage.set('bitpayAccounts-v3-' + network, JSON.stringify(bitpayAccounts), cb);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -539,6 +539,28 @@ angular.module('copayApp.services')
|
|||
});
|
||||
};
|
||||
|
||||
// account: {
|
||||
// email: account email
|
||||
// apiContext: the context needed for making future api calls
|
||||
// bitpayDebitCards: an array of cards
|
||||
// }
|
||||
root.removeBitpayAccount = function(network, account, cb) {
|
||||
if (lodash.isString(account)) {
|
||||
account = JSON.parse(account);
|
||||
}
|
||||
account = account || {};
|
||||
if (lodash.isEmpty(account)) return cb('No account to remove');
|
||||
storage.get('bitpayAccounts-v3-' + network, function(err, bitpayAccounts) {
|
||||
if (err) cb(err);
|
||||
if (lodash.isString(bitpayAccounts)) {
|
||||
bitpayAccounts = JSON.parse(bitpayAccounts);
|
||||
}
|
||||
bitpayAccounts = bitpayAccounts || {};
|
||||
delete bitpayAccounts[account.email];
|
||||
storage.set('bitpayAccounts-v3-' + network, JSON.stringify(bitpayAccounts), cb);
|
||||
});
|
||||
};
|
||||
|
||||
root.setAppIdentity = function(network, data, cb) {
|
||||
storage.set('appIdentity-' + network, data, cb);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue