Clean UI. Adds amount parser for coinbaseService
This commit is contained in:
parent
89639a8d48
commit
8d1d59cb3b
9 changed files with 85 additions and 46 deletions
|
|
@ -36,14 +36,10 @@ angular.module('copayApp.controllers').controller('buyCoinbaseController', funct
|
|||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||
coinbaseService.setCredentials();
|
||||
|
||||
amount = data.stateParams.amount;
|
||||
currency = data.stateParams.currency;
|
||||
[amount, currency, $scope.amountUnitStr] = coinbaseService.parseAmount(
|
||||
data.stateParams.amount,
|
||||
data.stateParams.currency);
|
||||
|
||||
if (amount < 1) {
|
||||
showErrorAndBack('Amount must be at least 1.00 ' + currency);
|
||||
return;
|
||||
}
|
||||
|
||||
$scope.network = coinbaseService.getNetwork();
|
||||
$scope.wallets = profileService.getWallets({
|
||||
onlyComplete: true,
|
||||
|
|
@ -60,6 +56,10 @@ angular.module('copayApp.controllers').controller('buyCoinbaseController', funct
|
|||
}
|
||||
var accessToken = res.accessToken;
|
||||
|
||||
coinbaseService.buyPrice(accessToken, coinbaseService.getAvailableCurrency(), function(err, b) {
|
||||
$scope.buyPrice = b.data || null;
|
||||
});
|
||||
|
||||
$scope.paymentMethods = [];
|
||||
$scope.selectedPaymentMethodId = { value : null };
|
||||
coinbaseService.getPaymentMethods(accessToken, function(err, p) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue