mirror of https://github.com/BTCPrivate/copay.git
Merge pull request #6161 from cmgustavo/ref/bitpay-card-intl-01
Adds support for EUR and GBP currencies
This commit is contained in:
commit
25ce2c41ac
|
@ -203,6 +203,7 @@ angular.module('copayApp.controllers').controller('bitpayCardController', functi
|
||||||
self.balance = cards[0].balance;
|
self.balance = cards[0].balance;
|
||||||
self.currencySymbol = cards[0].currencySymbol;
|
self.currencySymbol = cards[0].currencySymbol;
|
||||||
self.updatedOn = cards[0].updatedOn;
|
self.updatedOn = cards[0].updatedOn;
|
||||||
|
self.currency = cards[0].currency;
|
||||||
}
|
}
|
||||||
self.update();
|
self.update();
|
||||||
});
|
});
|
||||||
|
|
|
@ -91,17 +91,17 @@ angular.module('copayApp.controllers').controller('topUpController', function($s
|
||||||
}
|
}
|
||||||
$scope.onWalletSelect($scope.wallets[0]); // Default first wallet
|
$scope.onWalletSelect($scope.wallets[0]); // Default first wallet
|
||||||
|
|
||||||
bitpayCardService.getRates('USD', function(err, data) {
|
|
||||||
if (err) $log.error(err);
|
|
||||||
$scope.rate = data.rate;
|
|
||||||
});
|
|
||||||
|
|
||||||
bitpayCardService.get({ cardId: cardId, noRefresh: true }, function(err, card) {
|
bitpayCardService.get({ cardId: cardId, noRefresh: true }, function(err, card) {
|
||||||
if (err) {
|
if (err) {
|
||||||
showErrorAndBack(null, err);
|
showErrorAndBack(null, err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$scope.cardInfo = card[0];
|
$scope.cardInfo = card[0];
|
||||||
|
bitpayCardService.setCurrencySymbol($scope.cardInfo);
|
||||||
|
bitpayCardService.getRates($scope.cardInfo.currency, function(err, data) {
|
||||||
|
if (err) $log.error(err);
|
||||||
|
$scope.rate = data.rate;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.services').factory('bitpayCardService', function($log, $rootScope, $filter, lodash, storageService, bitauthService, platformInfo, moment, appIdentityService, bitpayService, nextStepsService, configService, txFormatService, appConfigService) {
|
angular.module('copayApp.services').factory('bitpayCardService', function($log, $rootScope, $filter, lodash, storageService, bitauthService, platformInfo, moment, appIdentityService, bitpayService, nextStepsService, txFormatService, appConfigService) {
|
||||||
var root = {};
|
var root = {};
|
||||||
|
|
||||||
var _setError = function(msg, e) {
|
var _setError = function(msg, e) {
|
||||||
$log.error(msg);
|
$log.error(msg);
|
||||||
var error = (e && e.data && e.data.error) ? e.data.error : msg;
|
var error = (e && e.data && e.data.error) ? e.data.error : msg;
|
||||||
return error;
|
return error;
|
||||||
};
|
};
|
||||||
|
|
||||||
var _processTransactions = function(invoices, history) {
|
var _processTransactions = function(invoices, history) {
|
||||||
invoices = invoices || [];
|
invoices = invoices || [];
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
<a class="button button-primary button-small m5t size-14"
|
<a class="button button-primary button-small m5t size-14"
|
||||||
style="padding: 0.5em 1em;"
|
style="padding: 0.5em 1em;"
|
||||||
ui-sref="tabs.bitpayCard.amount({nextStep: 'tabs.bitpayCard.topup'})" no-low-fee>
|
ui-sref="tabs.bitpayCard.amount({nextStep: 'tabs.bitpayCard.topup', currency: bitpayCard.currency})" no-low-fee>
|
||||||
<i class="icon ion-plus m10r" style="vertical-align: baseline;"></i>
|
<i class="icon ion-plus m10r" style="vertical-align: baseline;"></i>
|
||||||
{{'Add Funds'|translate}}
|
{{'Add Funds'|translate}}
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -19,7 +19,8 @@
|
||||||
<div class="amount-label">
|
<div class="amount-label">
|
||||||
<div class="amount-final">{{amountUnitStr}}</div>
|
<div class="amount-final">{{amountUnitStr}}</div>
|
||||||
<div class="alternative">
|
<div class="alternative">
|
||||||
<span ng-if="rate">@ {{rate | currency:'$':2}} per BTC</span>
|
<span ng-if="rate">@
|
||||||
|
{{rate | currency:cardInfo.currencySymbol:2}} per BTC</span>
|
||||||
<span ng-if="!rate">...</span>
|
<span ng-if="!rate">...</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue