New flow to link the bitpay card
This commit is contained in:
parent
4f5c814c50
commit
35cd6ce4cc
19 changed files with 385 additions and 384 deletions
|
|
@ -17,13 +17,13 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
|||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||
|
||||
$scope.isWallet = data.stateParams.isWallet;
|
||||
$scope.isCard = data.stateParams.isCard;
|
||||
$scope.cardId = data.stateParams.cardId;
|
||||
$scope.toAddress = data.stateParams.toAddress;
|
||||
$scope.toName = data.stateParams.toName;
|
||||
$scope.toEmail = data.stateParams.toEmail;
|
||||
$scope.showAlternativeAmount = !!$scope.isCard;
|
||||
$scope.showAlternativeAmount = !!$scope.cardId;
|
||||
|
||||
if (!$scope.isCard && !$stateParams.toAddress) {
|
||||
if (!$scope.cardId && !$stateParams.toAddress) {
|
||||
$log.error('Bad params at amount')
|
||||
throw ('bad params');
|
||||
}
|
||||
|
|
@ -189,7 +189,7 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
|||
$scope.finish = function() {
|
||||
var _amount = evaluate(format($scope.amount));
|
||||
|
||||
if ($scope.isCard) {
|
||||
if ($scope.cardId) {
|
||||
var amountUSD = $scope.showAlternativeAmount ? _amount : $filter('formatFiatAmount')(toFiat(_amount));
|
||||
|
||||
var dataSrc = {
|
||||
|
|
@ -199,7 +199,7 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
|||
ongoingProcess.set('Processing Transaction...', true);
|
||||
$timeout(function() {
|
||||
|
||||
bitpayCardService.topUp(dataSrc, function(err, invoiceId) {
|
||||
bitpayCardService.topUp($scope.cardId, dataSrc, function(err, invoiceId) {
|
||||
if (err) {
|
||||
ongoingProcess.set('Processing Transaction...', false);
|
||||
popupService.showAlert(gettextCatalog.getString('Error'), bwcError.msg(err));
|
||||
|
|
@ -215,7 +215,7 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
|||
var payProUrl = data.paymentUrls.BIP73;
|
||||
|
||||
$state.transitionTo('tabs.bitpayCard.confirm', {
|
||||
isCard: $scope.isCard,
|
||||
cardId: $scope.cardId,
|
||||
toName: $scope.toName,
|
||||
paypro: payProUrl
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue