Adds support for EUR and GBP currencies
This commit is contained in:
parent
8b28e708bc
commit
e0eb06156e
5 changed files with 30 additions and 5 deletions
|
|
@ -184,6 +184,7 @@ angular.module('copayApp.controllers').controller('bitpayCardController', functi
|
|||
|
||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||
$scope.cardId = data.stateParams.id;
|
||||
$scope.currency = bitpayCardService.getAvailableCurrency();
|
||||
|
||||
if (!$scope.cardId) {
|
||||
$ionicHistory.nextViewOptions({
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('topUpController', function($scope, $log, $state, $timeout, $ionicHistory, $ionicConfig, lodash, popupService, profileService, ongoingProcess, walletService, configService, platformInfo, bitpayService, bitpayCardService, payproService, bwcError, txFormatService, sendMaxService) {
|
||||
angular.module('copayApp.controllers').controller('topUpController', function($scope, $log, $state, $timeout, $ionicHistory, $ionicConfig, $sce, lodash, popupService, profileService, ongoingProcess, walletService, configService, platformInfo, bitpayService, bitpayCardService, payproService, bwcError, txFormatService, sendMaxService) {
|
||||
|
||||
var amount;
|
||||
var currency;
|
||||
|
|
@ -91,7 +91,19 @@ angular.module('copayApp.controllers').controller('topUpController', function($s
|
|||
}
|
||||
$scope.onWalletSelect($scope.wallets[0]); // Default first wallet
|
||||
|
||||
bitpayCardService.getRates('USD', function(err, data) {
|
||||
var currencyCode = bitpayCardService.getAvailableCurrency();
|
||||
var code;
|
||||
switch(currencyCode) {
|
||||
case 'EUR':
|
||||
code = '€';
|
||||
break;
|
||||
case 'GBP':
|
||||
code = '£';
|
||||
break;
|
||||
default : code = '$';
|
||||
};
|
||||
$scope.htmlCurrencyCode = $sce.trustAsHtml(code);
|
||||
bitpayCardService.getRates(currencyCode, function(err, data) {
|
||||
if (err) $log.error(err);
|
||||
$scope.rate = data.rate;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue