send flow fixes
This commit is contained in:
parent
e44a305269
commit
ff4b93acbe
5 changed files with 43 additions and 24 deletions
|
|
@ -15,8 +15,13 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
||||||
|
|
||||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||||
$scope.isGiftCard = data.stateParams.isGiftCard;
|
$scope.isGiftCard = data.stateParams.isGiftCard;
|
||||||
|
|
||||||
|
// Glidera parameters
|
||||||
$scope.isGlidera = data.stateParams.isGlidera;
|
$scope.isGlidera = data.stateParams.isGlidera;
|
||||||
$scope.glideraAccessToken = data.stateParams.glideraAccessToken;
|
$scope.glideraAccessToken = data.stateParams.glideraAccessToken;
|
||||||
|
$scope.glideraBuy = data.stateParams.glideraBuy;
|
||||||
|
$scope.glideraSell = data.stateParams.glideraSell;
|
||||||
|
|
||||||
$scope.cardId = data.stateParams.cardId;
|
$scope.cardId = data.stateParams.cardId;
|
||||||
$scope.showMenu = $ionicHistory.backView().stateName == 'tabs.send';
|
$scope.showMenu = $ionicHistory.backView().stateName == 'tabs.send';
|
||||||
$scope.isWallet = data.stateParams.isWallet;
|
$scope.isWallet = data.stateParams.isWallet;
|
||||||
|
|
@ -337,7 +342,8 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
||||||
} else if ($scope.isGlidera) {
|
} else if ($scope.isGlidera) {
|
||||||
$state.transitionTo('tabs.buyandsell.glidera.confirm', {
|
$state.transitionTo('tabs.buyandsell.glidera.confirm', {
|
||||||
toAmount: (amount * unitToSatoshi).toFixed(0),
|
toAmount: (amount * unitToSatoshi).toFixed(0),
|
||||||
glideraBuy: true,
|
glideraBuy: $scope.glideraBuy,
|
||||||
|
glideraSell: $scope.glideraSell,
|
||||||
glideraAccessToken: $scope.glideraAccessToken
|
glideraAccessToken: $scope.glideraAccessToken
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -69,20 +69,20 @@ angular.module('copayApp.controllers').controller('buyGlideraController',
|
||||||
// });
|
// });
|
||||||
// };
|
// };
|
||||||
|
|
||||||
this.get2faCode = function(token) {
|
// this.get2faCode = function(token) {
|
||||||
var self = this;
|
// var self = this;
|
||||||
ongoingProcess.set('Sending 2FA code...', true);
|
// ongoingProcess.set('Sending 2FA code...', true);
|
||||||
$timeout(function() {
|
// $timeout(function() {
|
||||||
glideraService.get2faCode(token, function(err, sent) {
|
// glideraService.get2faCode(token, function(err, sent) {
|
||||||
ongoingProcess.set('Sending 2FA code...', false);
|
// ongoingProcess.set('Sending 2FA code...', false);
|
||||||
if (err) {
|
// if (err) {
|
||||||
popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Could not send confirmation code to your phone'));
|
// popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Could not send confirmation code to your phone'));
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
self.show2faCodeInput = sent;
|
// self.show2faCodeInput = sent;
|
||||||
});
|
// });
|
||||||
}, 100);
|
// }, 100);
|
||||||
};
|
// };
|
||||||
|
|
||||||
this.sendRequest = function(token, permissions, twoFaCode) {
|
this.sendRequest = function(token, permissions, twoFaCode) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,8 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
||||||
giftCardUUID = data.stateParams.giftCardUUID;
|
giftCardUUID = data.stateParams.giftCardUUID;
|
||||||
|
|
||||||
// Glidera parameters
|
// Glidera parameters
|
||||||
|
$scope.isGlidera = data.stateParams.isGlidera;
|
||||||
|
$scope.glideraAccessToken = data.stateParams.glideraAccessToken;
|
||||||
|
|
||||||
toAmount = data.stateParams.toAmount;
|
toAmount = data.stateParams.toAmount;
|
||||||
cachedSendMax = {};
|
cachedSendMax = {};
|
||||||
|
|
|
||||||
|
|
@ -912,7 +912,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.state('tabs.buyandsell.glidera.amount', {
|
.state('tabs.buyandsell.glidera.amount', {
|
||||||
url: '/amount/:glideraBuy/:glideraAccessToken',
|
url: '/amount/:glideraBuy/:glideraSell/:glideraAccessToken',
|
||||||
views: {
|
views: {
|
||||||
'tab-home@tabs': {
|
'tab-home@tabs': {
|
||||||
controller: 'amountController',
|
controller: 'amountController',
|
||||||
|
|
|
||||||
|
|
@ -42,14 +42,25 @@
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<span translate>Amount</span>
|
<span translate>Amount</span>
|
||||||
<span ng-show="isGiftCard">(Purchase Amount is limited to USD 500 per day)</span>
|
<span ng-show="isGiftCard">(Purchase Amount is limited to USD 500 per day)</span>
|
||||||
<div ng-show="isGlidera" class="limits">
|
<div ng-show="isGlidera">
|
||||||
<span>Daily buy limit</span>:
|
<div class="limits" ng-show="limits && glideraBuy">
|
||||||
{{limits.dailyBuy|currency:'':2}} {{limits.currency}}
|
<span>Daily buy limit</span>:
|
||||||
(remaining {{limits.dailyBuyRemaining|currency:'':2}} {{limits.currency}})
|
{{limits.dailyBuy|currency:'':2}} {{limits.currency}}
|
||||||
<br>
|
(remaining {{limits.dailyBuyRemaining|currency:'':2}} {{limits.currency}})
|
||||||
<span>Monthly buy limit</span>:
|
<br>
|
||||||
{{limits.monthlyBuy|currency:'':2}} {{limits.currency}}
|
<span>Monthly buy limit</span>:
|
||||||
(remaining {{limits.monthlyBuyRemaining|currency:'':2}} {{limits.currency}})
|
{{limits.monthlyBuy|currency:'':2}} {{limits.currency}}
|
||||||
|
(remaining {{limits.monthlyBuyRemaining|currency:'':2}} {{limits.currency}})
|
||||||
|
</div>
|
||||||
|
<div class="limits" ng-show="limits && glideraSell">
|
||||||
|
<span>Daily sell limit</span>:
|
||||||
|
{{limits.dailySell|currency:'':2}} {{limits.currency}}
|
||||||
|
(remaining {{limits.dailySellRemaining|currency:'':2}} {{limits.currency}})
|
||||||
|
<br>
|
||||||
|
<span>Monthly sell limit</span>:
|
||||||
|
{{limits.monthlySell|currency:'':2}} {{limits.currency}}
|
||||||
|
(remaining {{limits.monthlySellRemaining|currency:'':2}} {{limits.currency}})
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue