Implement multiple cards.
This commit is contained in:
parent
b5abd844c9
commit
40f0901f2e
11 changed files with 237 additions and 70 deletions
|
|
@ -145,6 +145,12 @@ angular.module('copayApp.controllers').controller('bitpayCardController', functi
|
||||||
updateHistoryFromCache(function() {
|
updateHistoryFromCache(function() {
|
||||||
self.update();
|
self.update();
|
||||||
});
|
});
|
||||||
|
bitpayCardService.getBitpayDebitCards(function(err, cards) {
|
||||||
|
if (err) return;
|
||||||
|
$scope.card = lodash.find(cards, function(card) {
|
||||||
|
return card.eid == $scope.cardId;
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,15 +3,15 @@
|
||||||
angular.module('copayApp.controllers').controller('preferencesBitpayCardController',
|
angular.module('copayApp.controllers').controller('preferencesBitpayCardController',
|
||||||
function($scope, $state, $timeout, $ionicHistory, bitpayCardService, popupService, gettextCatalog) {
|
function($scope, $state, $timeout, $ionicHistory, bitpayCardService, popupService, gettextCatalog) {
|
||||||
|
|
||||||
$scope.remove = function() {
|
$scope.remove = function(card) {
|
||||||
var msg = gettextCatalog.getString('Are you sure you would like to remove your BitPay Card account from this device?');
|
var msg = gettextCatalog.getString('Are you sure you would like to remove your BitPay Card account from this device?');
|
||||||
popupService.showConfirm(null, msg, null, null, function(res) {
|
popupService.showConfirm(null, msg, null, null, function(res) {
|
||||||
if (res) remove();
|
if (res) remove(card);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
var remove = function() {
|
var remove = function(card) {
|
||||||
bitpayCardService.remove(function() {
|
bitpayCardService.remove(card, function() {
|
||||||
$ionicHistory.removeBackView();
|
$ionicHistory.removeBackView();
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$state.go('tabs.home');
|
$state.go('tabs.home');
|
||||||
|
|
@ -22,7 +22,7 @@ angular.module('copayApp.controllers').controller('preferencesBitpayCardControll
|
||||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||||
bitpayCardService.getBitpayDebitCards(function(err, data) {
|
bitpayCardService.getBitpayDebitCards(function(err, data) {
|
||||||
if (err) return;
|
if (err) return;
|
||||||
$scope.bitpayCards = data.cards;
|
$scope.bitpayCards = data;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -223,7 +223,7 @@ angular.module('copayApp.controllers').controller('tabHomeController',
|
||||||
$scope.bitpayCards = null;
|
$scope.bitpayCards = null;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$scope.bitpayCards = data.cards;
|
$scope.bitpayCards = data;
|
||||||
});
|
});
|
||||||
bitpayCardService.getBitpayDebitCardsHistory(null, function(err, data) {
|
bitpayCardService.getBitpayDebitCardsHistory(null, function(err, data) {
|
||||||
if (err) return;
|
if (err) return;
|
||||||
|
|
|
||||||
|
|
@ -964,41 +964,50 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$log.info('Verifying storage...');
|
||||||
$log.info('Init profile...');
|
storageService.verify(function(err) {
|
||||||
// Try to open local profile
|
|
||||||
profileService.loadAndBindProfile(function(err) {
|
|
||||||
$ionicHistory.nextViewOptions({
|
|
||||||
disableAnimate: true
|
|
||||||
});
|
|
||||||
if (err) {
|
if (err) {
|
||||||
if (err.message && err.message.match('NOPROFILE')) {
|
$log.error('Storage failed to verify: ' + err);
|
||||||
$log.debug('No profile... redirecting');
|
// TODO - what next?
|
||||||
$state.go('onboarding.welcome');
|
|
||||||
} else if (err.message && err.message.match('NONAGREEDDISCLAIMER')) {
|
|
||||||
if (lodash.isEmpty(profileService.getWallets())) {
|
|
||||||
$log.debug('No wallets and no disclaimer... redirecting');
|
|
||||||
$state.go('onboarding.welcome');
|
|
||||||
} else {
|
|
||||||
$log.debug('Display disclaimer... redirecting');
|
|
||||||
$state.go('onboarding.disclaimer', {
|
|
||||||
resume: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
throw new Error(err); // TODO
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
profileService.storeProfileIfDirty();
|
$log.info('Storage OK');
|
||||||
$log.debug('Profile loaded ... Starting UX.');
|
|
||||||
scannerService.gentleInitialize();
|
|
||||||
$state.go('tabs.home');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// After everything have been loaded, initialize handler URL
|
$log.info('Init profile...');
|
||||||
$timeout(function() {
|
// Try to open local profile
|
||||||
openURLService.init();
|
profileService.loadAndBindProfile(function(err) {
|
||||||
}, 1000);
|
$ionicHistory.nextViewOptions({
|
||||||
|
disableAnimate: true
|
||||||
|
});
|
||||||
|
if (err) {
|
||||||
|
if (err.message && err.message.match('NOPROFILE')) {
|
||||||
|
$log.debug('No profile... redirecting');
|
||||||
|
$state.go('onboarding.welcome');
|
||||||
|
} else if (err.message && err.message.match('NONAGREEDDISCLAIMER')) {
|
||||||
|
if (lodash.isEmpty(profileService.getWallets())) {
|
||||||
|
$log.debug('No wallets and no disclaimer... redirecting');
|
||||||
|
$state.go('onboarding.welcome');
|
||||||
|
} else {
|
||||||
|
$log.debug('Display disclaimer... redirecting');
|
||||||
|
$state.go('onboarding.disclaimer', {
|
||||||
|
resume: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
throw new Error(err); // TODO
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
profileService.storeProfileIfDirty();
|
||||||
|
$log.debug('Profile loaded ... Starting UX.');
|
||||||
|
scannerService.gentleInitialize();
|
||||||
|
$state.go('tabs.home');
|
||||||
|
}
|
||||||
|
|
||||||
|
// After everything have been loaded, initialize handler URL
|
||||||
|
$timeout(function() {
|
||||||
|
openURLService.init();
|
||||||
|
}, 1000);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -174,7 +174,7 @@ angular.module('copayApp.services').factory('bitpayCardService', function($http,
|
||||||
if (err) return cb(err);
|
if (err) return cb(err);
|
||||||
root.getBitpayDebitCards(function(err, data) {
|
root.getBitpayDebitCards(function(err, data) {
|
||||||
if (err) return cb(err);
|
if (err) return cb(err);
|
||||||
var card = lodash.find(data.cards, {id : cardId});
|
var card = lodash.find(data, {id : cardId});
|
||||||
if (!card) return cb(_setError('Not card found'));
|
if (!card) return cb(_setError('Not card found'));
|
||||||
// Get invoices
|
// Get invoices
|
||||||
$http(_post('/api/v2/' + card.token, json, credentials)).then(function(data) {
|
$http(_post('/api/v2/' + card.token, json, credentials)).then(function(data) {
|
||||||
|
|
@ -211,7 +211,7 @@ angular.module('copayApp.services').factory('bitpayCardService', function($http,
|
||||||
if (err) return cb(err);
|
if (err) return cb(err);
|
||||||
root.getBitpayDebitCards(function(err, data) {
|
root.getBitpayDebitCards(function(err, data) {
|
||||||
if (err) return cb(err);
|
if (err) return cb(err);
|
||||||
var card = lodash.find(data.cards, {id : cardId});
|
var card = lodash.find(data, {id : cardId});
|
||||||
if (!card) return cb(_setError('Not card found'));
|
if (!card) return cb(_setError('Not card found'));
|
||||||
$http(_post('/api/v2/' + card.token, json, credentials)).then(function(data) {
|
$http(_post('/api/v2/' + card.token, json, credentials)).then(function(data) {
|
||||||
$log.info('BitPay TopUp: SUCCESS');
|
$log.info('BitPay TopUp: SUCCESS');
|
||||||
|
|
@ -288,13 +288,11 @@ angular.module('copayApp.services').factory('bitpayCardService', function($http,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
root.remove = function(cb) {
|
root.remove = function(card, cb) {
|
||||||
storageService.removeBitpayCardCredentials(BITPAY_CARD_NETWORK, function(err) {
|
storageService.removeBitpayDebitCard(BITPAY_CARD_NETWORK, card, function(err) {
|
||||||
storageService.removeBitpayDebitCards(BITPAY_CARD_NETWORK, function(err) {
|
storageService.removeBitpayDebitCardHistory(BITPAY_CARD_NETWORK, card, function(err) {
|
||||||
storageService.removeBitpayDebitCardsHistory(BITPAY_CARD_NETWORK, function(err) {
|
$log.info('BitPay Debit Card(s) Removed: SUCCESS');
|
||||||
$log.info('BitPay Debit Cards Removed: SUCCESS');
|
return cb();
|
||||||
return cb();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
angular.module('copayApp.services')
|
angular.module('copayApp.services')
|
||||||
.factory('storageService', function(logHeader, fileStorageService, localStorageService, sjcl, $log, lodash, platformInfo) {
|
.factory('storageService', function(logHeader, fileStorageService, localStorageService, sjcl, $log, lodash, platformInfo, $timeout) {
|
||||||
|
|
||||||
var root = {};
|
var root = {};
|
||||||
|
|
||||||
|
|
@ -74,7 +74,90 @@ angular.module('copayApp.services')
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// UPGRADING STORAGE
|
||||||
|
//
|
||||||
|
// 1. Write a function to upgrade the desired storage key(s). The function should have the protocol:
|
||||||
|
//
|
||||||
|
// _upgrade_x(key, network, cb), where:
|
||||||
|
//
|
||||||
|
// `x` is the name of the storage key
|
||||||
|
// `key` is the name of the storage key being upgraded
|
||||||
|
// `network` is one of 'livenet', 'testnet'
|
||||||
|
//
|
||||||
|
// 2. Add the storage key to `_upgraders` object using the name of the key as the `_upgrader` object key
|
||||||
|
// with the value being the name of the upgrade function (e.g., _upgrade_x). In order to avoid conflicts
|
||||||
|
// when a storage key is involved in multiple upgraders as well as predicte the order in which upgrades
|
||||||
|
// occur the `_upgrader` object key should be prefixed with '##_' (e.g., '01_') to create a unique and
|
||||||
|
// sortable name. This format is interpreted by the _upgrade() function.
|
||||||
|
//
|
||||||
|
// Upgraders are executed in numerical order per the '##_' object key prefix.
|
||||||
|
//
|
||||||
|
var _upgraders = {
|
||||||
|
'00_bitpayDebitCards' : _upgrade_bitpayDebitCards // 2016-11: Upgrade bitpayDebitCards-x to bitpayAccounts-x
|
||||||
|
};
|
||||||
|
|
||||||
|
function _upgrade_bitpayDebitCards(key, network, cb) {
|
||||||
|
key += '-' + network;
|
||||||
|
storage.get(key, function(err, data) {
|
||||||
|
if (err) return cb(err);
|
||||||
|
if (data != null) {
|
||||||
|
// Needs upgrade
|
||||||
|
if (lodash.isString(data)) {
|
||||||
|
data = JSON.parse(data);
|
||||||
|
}
|
||||||
|
data = data || {};
|
||||||
|
root.setBitpayDebitCards(network, data, function(err) {
|
||||||
|
if (err) return cb(err);
|
||||||
|
storage.remove(key, function() {
|
||||||
|
cb(null, 'replaced with \'bitpayAccounts\'');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
cb();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// IMPORTANT: This function is designed to block execution until it completes.
|
||||||
|
// Ideally storage should not be used until it has been verified.
|
||||||
|
root.verify = function(cb) {
|
||||||
|
_upgrade(function(err) {
|
||||||
|
cb(err);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
function _handleUpgradeError(key, err) {
|
||||||
|
$log.error('Failed to upgrade storage for \'' + key + '\': ' + err);
|
||||||
|
};
|
||||||
|
|
||||||
|
function _handleUpgradeSuccess(key, msg) {
|
||||||
|
$log.info('Storage upgraded for \'' + key + '\': ' + msg);
|
||||||
|
};
|
||||||
|
|
||||||
|
function _upgrade(cb) {
|
||||||
|
var errorCount = 0;
|
||||||
|
var errorMessage = undefined;
|
||||||
|
var keys = Object.keys(_upgraders).sort();
|
||||||
|
var networks = ['livenet', 'testnet'];
|
||||||
|
keys.forEach(function(key) {
|
||||||
|
networks.forEach(function(network) {
|
||||||
|
var storagekey = key.split('_')[1];
|
||||||
|
_upgraders[key](storagekey, network, function(err, msg) {
|
||||||
|
if (err) {
|
||||||
|
_handleUpgradeError(storagekey, err);
|
||||||
|
errorCount++;
|
||||||
|
errorMessage = errorCount + ' storage upgrade failures';
|
||||||
|
}
|
||||||
|
if (msg) _handleUpgradeSuccess(storagekey, msg);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
cb(errorMessage);
|
||||||
|
};
|
||||||
|
|
||||||
root.tryToMigrate = function(cb) {
|
root.tryToMigrate = function(cb) {
|
||||||
if (!shouldUseFileStorage) return cb();
|
if (!shouldUseFileStorage) return cb();
|
||||||
|
|
@ -333,20 +416,76 @@ angular.module('copayApp.services')
|
||||||
storage.get('bitpayDebitCardsHistory-' + network, cb);
|
storage.get('bitpayDebitCardsHistory-' + network, cb);
|
||||||
};
|
};
|
||||||
|
|
||||||
root.removeBitpayDebitCardsHistory = function(network, cb) {
|
root.removeBitpayDebitCardHistory = function(network, card, cb) {
|
||||||
storage.remove('bitpayDebitCardsHistory-' + network, cb);
|
root.getBitpayDebitCardsHistory(network, function(err, data) {
|
||||||
|
if (err) return cb(err);
|
||||||
|
if (lodash.isString(data)) {
|
||||||
|
data = JSON.parse(data);
|
||||||
|
}
|
||||||
|
data = data || {};
|
||||||
|
delete data[card.eid];
|
||||||
|
root.setBitpayDebitCardsHistory(network, JSON.stringify(data), cb);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
root.setBitpayDebitCards = function(network, data, cb) {
|
root.setBitpayDebitCards = function(network, data, cb) {
|
||||||
storage.set('bitpayDebitCards-' + network, data, cb);
|
if (lodash.isString(data)) {
|
||||||
|
data = JSON.parse(data);
|
||||||
|
}
|
||||||
|
data = data || {};
|
||||||
|
if (lodash.isEmpty(data) || !data.email) return cb('No card(s) to set');
|
||||||
|
storage.get('bitpayAccounts-' + network, function(err, bitpayAccounts) {
|
||||||
|
if (err) return cb(err);
|
||||||
|
bitpayAccounts = JSON.parse(bitpayAccounts) || {};
|
||||||
|
bitpayAccounts[data.email] = bitpayAccounts[data.email] || {};
|
||||||
|
bitpayAccounts[data.email]['bitpayDebitCards-' + network] = data;
|
||||||
|
storage.set('bitpayAccounts-' + network, JSON.stringify(bitpayAccounts), cb);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
root.getBitpayDebitCards = function(network, cb) {
|
root.getBitpayDebitCards = function(network, cb) {
|
||||||
storage.get('bitpayDebitCards-' + network, cb);
|
storage.get('bitpayAccounts-' + network, function(err, bitpayAccounts) {
|
||||||
|
bitpayAccounts = JSON.parse(bitpayAccounts) || {};
|
||||||
|
var cards = [];
|
||||||
|
Object.keys(bitpayAccounts).forEach(function(email) {
|
||||||
|
// For the UI, add the account email to the card object.
|
||||||
|
var acctCards = bitpayAccounts[email]['bitpayDebitCards-' + network].cards;
|
||||||
|
for (var i = 0; i < acctCards.length; i++) {
|
||||||
|
acctCards[i].email = email;
|
||||||
|
}
|
||||||
|
cards = cards.concat(acctCards);
|
||||||
|
});
|
||||||
|
cb(err, cards);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
root.removeBitpayDebitCards = function(network, cb) {
|
root.removeBitpayDebitCard = function(network, card, cb) {
|
||||||
storage.remove('bitpayDebitCards-' + network, cb);
|
if (lodash.isString(card)) {
|
||||||
|
card = JSON.parse(card);
|
||||||
|
}
|
||||||
|
card = card || {};
|
||||||
|
if (lodash.isEmpty(card) || !card.eid) return cb('No card to remove');
|
||||||
|
storage.get('bitpayAccounts-' + network, function(err, bitpayAccounts) {
|
||||||
|
if (err) cb(err);
|
||||||
|
bitpayAccounts = JSON.parse(bitpayAccounts) || {};
|
||||||
|
Object.keys(bitpayAccounts).forEach(function(userId) {
|
||||||
|
var data = bitpayAccounts[userId]['bitpayDebitCards-' + network];
|
||||||
|
var newCards = lodash.reject(data.cards, {'eid': card.eid});
|
||||||
|
data.cards = newCards;
|
||||||
|
root.setBitpayDebitCards(network, data, function(err) {
|
||||||
|
if (err) cb(err);
|
||||||
|
// If there are no more cards in storage then re-enable the next step entry.
|
||||||
|
root.getBitpayDebitCards(network, function(err, cards){
|
||||||
|
if (err) cb(err);
|
||||||
|
if (cards.length == 0) {
|
||||||
|
root.removeNextStep('BitpayCard', cb);
|
||||||
|
} else {
|
||||||
|
cb();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
root.setBitpayCardCredentials = function(network, data, cb) {
|
root.setBitpayCardCredentials = function(network, data, cb) {
|
||||||
|
|
|
||||||
15
src/sass/views/bitpayCardPreferences.scss
Normal file
15
src/sass/views/bitpayCardPreferences.scss
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
#bitpayCardPreferences {
|
||||||
|
.item {
|
||||||
|
.item-title {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.item-subtitle {
|
||||||
|
display: block;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
color: $light-gray;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
@import "advancedSettings";
|
@import "advancedSettings";
|
||||||
@import "bitpayCard";
|
@import "bitpayCard";
|
||||||
@import "bitpayCardIntro";
|
@import "bitpayCardIntro";
|
||||||
|
@import "bitpayCardPreferences";
|
||||||
@import "address-book";
|
@import "address-book";
|
||||||
@import "wallet-backup-phrase";
|
@import "wallet-backup-phrase";
|
||||||
@import "zero-state";
|
@import "zero-state";
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<ion-nav-bar class="bar-royal">
|
<ion-nav-bar class="bar-royal">
|
||||||
<ion-nav-back-button>
|
<ion-nav-back-button>
|
||||||
</ion-nav-back-button>
|
</ion-nav-back-button>
|
||||||
<ion-nav-title>BitPay Visa<sup>®</sup> Card</ion-nav-title>
|
<ion-nav-title>BitPay Visa<sup>®</sup> Card ({{card.lastFourDigits}})</ion-nav-title>
|
||||||
<ion-nav-buttons side="secondary">
|
<ion-nav-buttons side="secondary">
|
||||||
<button class="button no-border" ui-sref="tabs.bitpayCard.preferences">
|
<button class="button no-border" ui-sref="tabs.bitpayCard.preferences">
|
||||||
<i class="icon ion-ios-settings"></i>
|
<i class="icon ion-ios-settings"></i>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<ion-view>
|
<ion-view id="bitpayCardPreferences">
|
||||||
<ion-nav-bar class="bar-royal">
|
<ion-nav-bar class="bar-royal">
|
||||||
<ion-nav-back-button>
|
<ion-nav-back-button>
|
||||||
</ion-nav-back-button>
|
</ion-nav-back-button>
|
||||||
|
|
@ -10,12 +10,14 @@
|
||||||
<div class="item item-divider" translate>
|
<div class="item item-divider" translate>
|
||||||
Cards
|
Cards
|
||||||
</div>
|
</div>
|
||||||
<div class="item" ng-repeat="card in bitpayCards">
|
<div class="item item-icon-right" ng-click="remove(card)" ng-repeat="card in bitpayCards">
|
||||||
xxxx-xxxx-xxxx-{{card.lastFourDigits}}
|
<span class="item-title">
|
||||||
</div>
|
xxxx-xxxx-xxxx-{{card.lastFourDigits}}
|
||||||
<div class="item item-divider"></div>
|
</span>
|
||||||
<div class="item assertive" ng-click="remove()">
|
<span class="item-subtitle">
|
||||||
Removes all data from this device
|
{{card.email}}
|
||||||
|
</span>
|
||||||
|
<i class="icon ion-trash-b assertive"></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|
|
||||||
|
|
@ -93,28 +93,25 @@
|
||||||
</p>
|
</p>
|
||||||
<i class="icon bp-arrow-right"></i>
|
<i class="icon bp-arrow-right"></i>
|
||||||
</a>
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="list card" ng-if="bitpayCardEnabled && bitpayCards[0] && externalServices.BitpayCard">
|
||||||
|
<div class="item item-icon-right item-heading">
|
||||||
|
<span translate>Cards</span>
|
||||||
|
<a ui-sref="tabs.bitpayCardIntro"><i class="icon ion-ios-plus-empty list-add-button"></i></a>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
<a ng-repeat="card in bitpayCards"
|
<a ng-repeat="card in bitpayCards"
|
||||||
ui-sref="tabs.bitpayCard({id:card.id})"
|
ui-sref="tabs.bitpayCard({id:card.id})"
|
||||||
ng-if="bitpayCardEnabled && bitpayCards[0]"
|
|
||||||
class="item item-sub item-icon-left item-big-icon-left item-icon-right">
|
class="item item-sub item-icon-left item-big-icon-left item-icon-right">
|
||||||
<i class="icon big-icon-svg">
|
<i class="icon big-icon-svg">
|
||||||
<div class="bg icon-bitpay-card"></div>
|
<div class="bg icon-bitpay-card"></div>
|
||||||
</i>
|
</i>
|
||||||
<span>BitPay Visa® Card</span>
|
<span>BitPay Visa® Card ({{card.lastFourDigits}})</span>
|
||||||
<p>{{cardsHistory[card.id].balance ? '$' + cardsHistory[card.id].balance : 'Add funds to get started'|translate}}</p>
|
<p>{{cardsHistory[card.id].balance ? '$' + cardsHistory[card.id].balance : 'Add funds to get started'|translate}}</p>
|
||||||
<i class="icon bp-arrow-right"></i>
|
<i class="icon bp-arrow-right"></i>
|
||||||
</a>
|
</a>
|
||||||
<a ui-sref="tabs.bitpayCardIntro"
|
|
||||||
ng-if="bitpayCardEnabled && !bitpayCards[0] && externalServices.BitpayCard"
|
|
||||||
class="item item-sub item-icon-left item-big-icon-left item-icon-right">
|
|
||||||
<i class="icon big-icon-svg">
|
|
||||||
<div class="bg icon-bitpay-card"></div>
|
|
||||||
</i>
|
|
||||||
<span>BitPay Visa® Card</span>
|
|
||||||
<p translate>Add your card</p>
|
|
||||||
<i class="icon bp-arrow-right"></i>
|
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue