Set thirdParty on the sendflow
This commit is contained in:
parent
7a78eb1261
commit
621c60a2ce
3 changed files with 54 additions and 54 deletions
|
|
@ -30,7 +30,7 @@ function amountController(configService, $filter, gettextCatalog, $ionicHistory,
|
||||||
vm.sendableFunds = '';
|
vm.sendableFunds = '';
|
||||||
vm.showSendMaxButton = false;
|
vm.showSendMaxButton = false;
|
||||||
vm.showSendLimitMaxButton = false;
|
vm.showSendLimitMaxButton = false;
|
||||||
vm.thirdParty = false;
|
vm.thirdParty = null;
|
||||||
vm.unit = '';
|
vm.unit = '';
|
||||||
|
|
||||||
// Functions
|
// Functions
|
||||||
|
|
@ -88,11 +88,16 @@ function amountController(configService, $filter, gettextCatalog, $ionicHistory,
|
||||||
sendFlowService.state.pop();
|
sendFlowService.state.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
initCurrencies();
|
initCurrencies();
|
||||||
|
|
||||||
passthroughParams = sendFlowService.state.getClone();
|
passthroughParams = sendFlowService.state.getClone();
|
||||||
console.log('amount onBeforeEnter after back sendflow ', passthroughParams);
|
console.log('amount onBeforeEnter after back sendflow ', passthroughParams);
|
||||||
|
|
||||||
|
// Init thirdParty, should be done for all the variable
|
||||||
|
vm.thirdParty = null;
|
||||||
|
|
||||||
vm.fromWalletId = passthroughParams.fromWalletId;
|
vm.fromWalletId = passthroughParams.fromWalletId;
|
||||||
vm.toWalletId = passthroughParams.toWalletId;
|
vm.toWalletId = passthroughParams.toWalletId;
|
||||||
vm.minAmount = parseFloat(passthroughParams.minAmount);
|
vm.minAmount = parseFloat(passthroughParams.minAmount);
|
||||||
|
|
|
||||||
|
|
@ -9,33 +9,6 @@ angular
|
||||||
function reviewController(addressbookService, bitcoinCashJsService, bitcore, bitcoreCash, bwcError, clipboardService, configService, feeService, gettextCatalog, $interval, $ionicHistory, $ionicModal, ionicToast, lodash, $log, ongoingProcess, platformInfo, popupService, profileService, $scope, sendFlowService, shapeshiftService, soundService, $state, $timeout, txConfirmNotification, txFormatService, walletService) {
|
function reviewController(addressbookService, bitcoinCashJsService, bitcore, bitcoreCash, bwcError, clipboardService, configService, feeService, gettextCatalog, $interval, $ionicHistory, $ionicModal, ionicToast, lodash, $log, ongoingProcess, platformInfo, popupService, profileService, $scope, sendFlowService, shapeshiftService, soundService, $state, $timeout, txConfirmNotification, txFormatService, walletService) {
|
||||||
var vm = this;
|
var vm = this;
|
||||||
|
|
||||||
// Functions
|
|
||||||
vm.goBack = goBack;
|
|
||||||
vm.onSuccessConfirm = onSuccessConfirm;
|
|
||||||
vm.onShareTransaction = onShareTransaction;
|
|
||||||
|
|
||||||
var sendFlowData;
|
|
||||||
var config = null;
|
|
||||||
var coin = '';
|
|
||||||
var countDown = null;
|
|
||||||
var defaults = {};
|
|
||||||
var usingCustomFee = false;
|
|
||||||
var usingMerchantFee = false;
|
|
||||||
var destinationWalletId = '';
|
|
||||||
var lastTxId = '';
|
|
||||||
var originWalletId = '';
|
|
||||||
var priceDisplayIsFiat = true;
|
|
||||||
var satoshis = null;
|
|
||||||
var toAddress = '';
|
|
||||||
var tx = {};
|
|
||||||
var txPayproData = null;
|
|
||||||
var unitFromSat = 0;
|
|
||||||
|
|
||||||
var FEE_TOO_HIGH_LIMIT_PERCENTAGE = 15;
|
|
||||||
|
|
||||||
$scope.$on("$ionicView.beforeEnter", onBeforeEnter);
|
|
||||||
|
|
||||||
function initVariables() {
|
|
||||||
vm.buttonText = '';
|
vm.buttonText = '';
|
||||||
vm.destination = {
|
vm.destination = {
|
||||||
address: '',
|
address: '',
|
||||||
|
|
@ -79,13 +52,38 @@ angular
|
||||||
vm.thirdParty = null;
|
vm.thirdParty = null;
|
||||||
vm.wallet = null;
|
vm.wallet = null;
|
||||||
vm.memoExpanded = false;
|
vm.memoExpanded = false;
|
||||||
}
|
|
||||||
|
// Functions
|
||||||
|
vm.goBack = goBack;
|
||||||
|
vm.onSuccessConfirm = onSuccessConfirm;
|
||||||
|
vm.onShareTransaction = onShareTransaction;
|
||||||
|
|
||||||
|
var sendFlowData;
|
||||||
|
var config = null;
|
||||||
|
var coin = '';
|
||||||
|
var countDown = null;
|
||||||
|
var defaults = {};
|
||||||
|
var usingCustomFee = false;
|
||||||
|
var usingMerchantFee = false;
|
||||||
|
var destinationWalletId = '';
|
||||||
|
var lastTxId = '';
|
||||||
|
var originWalletId = '';
|
||||||
|
var priceDisplayIsFiat = true;
|
||||||
|
var satoshis = null;
|
||||||
|
var toAddress = '';
|
||||||
|
var tx = {};
|
||||||
|
var txPayproData = null;
|
||||||
|
var unitFromSat = 0;
|
||||||
|
|
||||||
|
var FEE_TOO_HIGH_LIMIT_PERCENTAGE = 15;
|
||||||
|
|
||||||
|
$scope.$on("$ionicView.beforeEnter", onBeforeEnter);
|
||||||
|
|
||||||
function onBeforeEnter(event, data) {
|
function onBeforeEnter(event, data) {
|
||||||
$log.debug('reviewController onBeforeEnter sendflow ', sendFlowService.state);
|
$log.debug('reviewController onBeforeEnter sendflow ', sendFlowService.state);
|
||||||
|
|
||||||
// Reset from last time
|
// Reset from last time
|
||||||
initVariables();
|
vm.thirdParty = null;
|
||||||
|
|
||||||
defaults = configService.getDefaults();
|
defaults = configService.getDefaults();
|
||||||
sendFlowData = sendFlowService.state.getClone();
|
sendFlowData = sendFlowService.state.getClone();
|
||||||
|
|
|
||||||
|
|
@ -52,9 +52,6 @@ angular
|
||||||
$scope.specificAmount = $scope.specificAlternativeAmount = '';
|
$scope.specificAmount = $scope.specificAlternativeAmount = '';
|
||||||
$scope.isPaymentRequest = true;
|
$scope.isPaymentRequest = true;
|
||||||
}
|
}
|
||||||
if ($scope.params.thirdParty) {
|
|
||||||
$scope.thirdParty = $scope.params.thirdParty;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function onEnter (event, data) {
|
function onEnter (event, data) {
|
||||||
|
|
@ -62,7 +59,7 @@ angular
|
||||||
$scope.selectedPriceDisplay = config.wallet.settings.priceDisplay;
|
$scope.selectedPriceDisplay = config.wallet.settings.priceDisplay;
|
||||||
});
|
});
|
||||||
|
|
||||||
if ($scope.thirdParty) {
|
if ($scope.params.thirdParty) {
|
||||||
// Third party services specific logic
|
// Third party services specific logic
|
||||||
handleThirdPartyIfShapeshift();
|
handleThirdPartyIfShapeshift();
|
||||||
}
|
}
|
||||||
|
|
@ -102,8 +99,8 @@ angular
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleThirdPartyIfShapeshift() {
|
function handleThirdPartyIfShapeshift() {
|
||||||
console.log($scope.thirdParty, $scope.coin);
|
console.log($scope.params.thirdParty, $scope.coin);
|
||||||
if ($scope.thirdParty.id === 'shapeshift' && $scope.type === 'destination') { // Shapeshift wants to know the
|
if ($scope.params.thirdParty.id === 'shapeshift' && $scope.type === 'destination') { // Shapeshift wants to know the
|
||||||
$scope.coin = profileService.getWallet(fromWalletId).coin;
|
$scope.coin = profileService.getWallet(fromWalletId).coin;
|
||||||
if ($scope.coin === 'bch') {
|
if ($scope.coin === 'bch') {
|
||||||
$scope.coin = 'btc';
|
$scope.coin = 'btc';
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue