Merge pull request #6316 from cmgustavo/bug/bitpay-card-sendmax

Ref topup. Fix sendmax
This commit is contained in:
Gabriel Edgardo Bazán 2017-06-28 16:16:26 -03:00 committed by GitHub
commit 758c4abdcf
6 changed files with 302 additions and 218 deletions

View File

@ -2,9 +2,13 @@
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, gettextCatalog) { 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, gettextCatalog) {
var dataSrc = {}; $scope.isCordova = platformInfo.isCordova;
var cardId; var cardId;
var sendMax; var useSendMax;
var amount;
var currency;
var createdTx;
var message;
var configWallet = configService.getSync().wallet; var configWallet = configService.getSync().wallet;
var showErrorAndBack = function(title, msg) { var showErrorAndBack = function(title, msg) {
@ -17,12 +21,19 @@ angular.module('copayApp.controllers').controller('topUpController', function($s
}); });
}; };
var showError = function(title, msg) { var showError = function(title, msg, cb) {
cb = cb || function() {};
title = title || gettextCatalog.getString('Error'); title = title || gettextCatalog.getString('Error');
$scope.sendStatus = ''; $scope.sendStatus = '';
$log.error(msg); $log.error(msg);
msg = msg.errors ? msg.errors[0].message : msg; msg = msg.errors ? msg.errors[0].message : msg;
popupService.showAlert(title, msg); popupService.showAlert(title, msg, cb);
};
var satToFiat = function(sat, cb) {
txFormatService.toFiat(sat, $scope.currencyIsoCode, function(value) {
return cb(value);
});
}; };
var publishAndSign = function (wallet, txp, onSendStatusChange, cb) { var publishAndSign = function (wallet, txp, onSendStatusChange, cb) {
@ -40,7 +51,7 @@ angular.module('copayApp.controllers').controller('topUpController', function($s
var statusChangeHandler = function (processName, showName, isOn) { var statusChangeHandler = function (processName, showName, isOn) {
$log.debug('statusChangeHandler: ', processName, showName, isOn); $log.debug('statusChangeHandler: ', processName, showName, isOn);
if ( processName == 'sendingTx' && !isOn) { if (processName == 'topup' && !isOn) {
$scope.sendStatus = 'success'; $scope.sendStatus = 'success';
$timeout(function() { $timeout(function() {
$scope.$digest(); $scope.$digest();
@ -50,31 +61,165 @@ angular.module('copayApp.controllers').controller('topUpController', function($s
} }
}; };
var createInvoice = function() { var setTotalAmount = function(amountSat, invoiceFeeSat, networkFeeSat) {
$scope.expirationTime = null; satToFiat(amountSat, function(a) {
ongoingProcess.set('creatingInvoice', true); $scope.amount = Number(a);
bitpayCardService.topUp(cardId, dataSrc, function(err, invoiceId) {
satToFiat(invoiceFeeSat, function(i) {
$scope.invoiceFee = Number(i);
satToFiat(networkFeeSat, function(n) {
$scope.networkFee = Number(n);
$scope.totalAmount = $scope.amount + $scope.invoiceFee + $scope.networkFee;
$timeout(function() {
$scope.$digest();
});
});
});
});
};
var createInvoice = function(data, cb) {
bitpayCardService.topUp(cardId, data, function(err, invoiceId) {
if (err) { if (err) {
ongoingProcess.set('creatingInvoice', false); return cb({
showErrorAndBack(gettextCatalog.getString('Could not create the invoice'), err); title: gettextCatalog.getString('Could not create the invoice'),
return; message: err
});
} }
bitpayCardService.getInvoice(invoiceId, function(err, inv) { bitpayCardService.getInvoice(invoiceId, function(err, inv) {
ongoingProcess.set('creatingInvoice', false);
if (err) { if (err) {
showError(gettextCatalog.getString('Could not get the invoice'), err); return cb({
return; title: gettextCatalog.getString('Could not get the invoice'),
message: err
});
} }
$scope.invoice = inv; return cb(null, inv);
$scope.expirationTime = ($scope.invoice.expirationTime - $scope.invoice.invoiceTime) / 1000;
$timeout(function() {
$scope.$digest();
}, 1);
}); });
}); });
}; };
var createTx = function(wallet, invoice, message, cb) {
var payProUrl = (invoice && invoice.paymentUrls) ? invoice.paymentUrls.BIP73 : null;
if (!payProUrl) {
return cb({
title: gettextCatalog.getString('Error in Payment Protocol'),
message: gettextCatalog.getString('Invalid URL')
});
}
var outputs = [];
var toAddress = invoice.bitcoinAddress;
var amountSat = parseInt(invoice.btcDue * 100000000); // BTC to Satoshi
outputs.push({
'toAddress': toAddress,
'amount': amountSat,
'message': message
});
var txp = {
toAddress: toAddress,
amount: amountSat,
outputs: outputs,
message: message,
payProUrl: payProUrl,
excludeUnconfirmedUtxos: configWallet.spendUnconfirmed ? false : true,
feeLevel: configWallet.settings.feeLevel || 'normal'
};
walletService.createTx(wallet, txp, function(err, ctxp) {
if (err) {
return cb({
title: gettextCatalog.getString('Could not create transaction'),
message: bwcError.msg(err)
});
}
return cb(null, ctxp);
});
};
var calculateAmount = function(wallet, cb) {
// Global variables defined beforeEnter
var a = amount;
var c = currency;
if (useSendMax) {
sendMaxService.getInfo(wallet, function(err, maxValues) {
if (err) {
return cb({
title: null,
message: err
})
}
if (maxValues.amount == 0) {
return cb({message: gettextCatalog.getString('Insufficient funds for fee')});
}
var maxAmountBtc = Number((maxValues.amount / 100000000).toFixed(8));
createInvoice({amount: maxAmountBtc, currency: 'BTC'}, function(err, inv) {
if (err) return cb(err);
var invoiceFeeSat = parseInt((inv.buyerPaidBtcMinerFee * 100000000).toFixed());
var newAmountSat = maxValues.amount - invoiceFeeSat;
if (newAmountSat <= 0) {
return cb({message: gettextCatalog.getString('Insufficient funds for fee')});
}
return cb(null, newAmountSat, 'sat');
});
});
} else {
return cb(null, a, c);
}
};
var initializeTopUp = function(wallet, parsedAmount) {
$scope.amountUnitStr = parsedAmount.amountUnitStr;
var dataSrc = {
amount: parsedAmount.amount,
currency: parsedAmount.currency
};
ongoingProcess.set('loadingTxInfo', true);
createInvoice(dataSrc, function(err, invoice) {
if (err) {
ongoingProcess.set('loadingTxInfo', false);
showErrorAndBack(err.title, err.message);
return;
}
var invoiceFeeSat = (invoice.buyerPaidBtcMinerFee * 100000000).toFixed();
message = gettextCatalog.getString("Top up {{amountStr}} to debit card ({{cardLastNumber}})", {
amountStr: $scope.amountUnitStr,
cardLastNumber: $scope.lastFourDigits
});
createTx(wallet, invoice, message, function(err, ctxp) {
ongoingProcess.set('loadingTxInfo', false);
if (err) {
showErrorAndBack(err.title, err.message);
return;
}
// Save TX in memory
createdTx = ctxp;
$scope.totalAmountStr = txFormatService.formatAmountStr(ctxp.amount);
setTotalAmount(parsedAmount.amountSat, invoiceFeeSat, ctxp.fee);
});
});
};
$scope.$on("$ionicView.beforeLeave", function(event, data) { $scope.$on("$ionicView.beforeLeave", function(event, data) {
$ionicConfig.views.swipeBackEnabled(true); $ionicConfig.views.swipeBackEnabled(true);
}); });
@ -84,136 +229,68 @@ angular.module('copayApp.controllers').controller('topUpController', function($s
}); });
$scope.$on("$ionicView.beforeEnter", function(event, data) { $scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.wallet = null;
$scope.isCordova = platformInfo.isCordova;
cardId = data.stateParams.id; cardId = data.stateParams.id;
sendMax = data.stateParams.useSendMax; useSendMax = data.stateParams.useSendMax;
amount = data.stateParams.amount;
if (!cardId) { currency = data.stateParams.currency;
showErrorAndBack(null, gettextCatalog.getString('No card selected'));
return;
}
var parsedAmount = txFormatService.parseAmount(
data.stateParams.amount,
data.stateParams.currency);
dataSrc['amount'] = parsedAmount.amount;
dataSrc['currency'] = parsedAmount.currency;
$scope.amountUnitStr = parsedAmount.amountUnitStr;
$scope.network = bitpayService.getEnvironment().network;
$scope.wallets = profileService.getWallets({
onlyComplete: true,
network: $scope.network,
hasFunds: true,
minAmount: parsedAmount.amountSat
});
if (lodash.isEmpty($scope.wallets)) {
showErrorAndBack(null, gettextCatalog.getString('Insufficient funds'));
return;
}
$scope.onWalletSelect($scope.wallets[0]); // Default first wallet
bitpayCardService.get({ cardId: cardId, noRefresh: true }, function(err, card) { bitpayCardService.get({ cardId: cardId, noRefresh: true }, function(err, card) {
if (err) { if (err) {
showErrorAndBack(null, err); showErrorAndBack(null, err);
return; return;
} }
$scope.cardInfo = card[0]; bitpayCardService.setCurrencySymbol(card[0]);
bitpayCardService.setCurrencySymbol($scope.cardInfo); $scope.lastFourDigits = card[0].lastFourDigits;
bitpayCardService.getRates($scope.cardInfo.currency, function(err, data) { $scope.currencySymbol = card[0].currencySymbol;
if (err) $log.error(err); $scope.currencyIsoCode = card[0].currency;
$scope.rate = data.rate;
$scope.wallets = profileService.getWallets({
onlyComplete: true,
network: bitpayService.getEnvironment().network,
hasFunds: true
}); });
});
}); if (lodash.isEmpty($scope.wallets)) {
showErrorAndBack(null, gettextCatalog.getString('No wallets with funds'));
$scope.topUpConfirm = function() {
var title;
var message = gettextCatalog.getString("Top up {{amountStr}} to debit card ({{cardLastNumber}})", {
amountStr: $scope.amountUnitStr,
cardLastNumber: $scope.cardInfo.lastFourDigits
});
var okText = gettextCatalog.getString('Continue');
var cancelText = gettextCatalog.getString('Cancel');
popupService.showConfirm(title, message, okText, cancelText, function(ok) {
if (!ok) return;
ongoingProcess.set('topup', true, statusChangeHandler);
var payProUrl = ($scope.invoice && $scope.invoice.paymentUrls) ? $scope.invoice.paymentUrls.BIP73 : null;
if (!payProUrl) {
ongoingProcess.set('topup', false, statusChangeHandler);
showError(gettextCatalog.getString('Error in Payment Protocol'), gettextCatalog.getString('Invalid URL'));
return; return;
} }
payproService.getPayProDetails(payProUrl, function(err, payProDetails) { bitpayCardService.getRates($scope.currencyIsoCode, function(err, r) {
if (err) $log.error(err);
$scope.rate = r.rate;
});
$scope.onWalletSelect($scope.wallets[0]); // Default first wallet
});
});
$scope.topUpConfirm = function() {
if (!createdTx) {
showError(null, gettextCatalog.getString('Transaction has not been created'));
return;
}
var title = gettextCatalog.getString('Confirm');
var okText = gettextCatalog.getString('OK');
var cancelText = gettextCatalog.getString('Cancel');
popupService.showConfirm(title, message, okText, cancelText, function(ok) {
if (!ok) {
$scope.sendStatus = '';
return;
}
ongoingProcess.set('topup', true, statusChangeHandler);
publishAndSign($scope.wallet, createdTx, function() {}, function(err, txSent) {
if (err) { if (err) {
ongoingProcess.set('topup', false, statusChangeHandler); ongoingProcess.set('topup', false);
showError(gettextCatalog.getString('Error fetching invoice'), err); $scope.sendStatus = '';
showError(gettextCatalog.getString('Could not send transaction'), err);
return; return;
} }
ongoingProcess.set('topup', false, statusChangeHandler);
var outputs = []; });
var toAddress = payProDetails.toAddress;
var amountSat = payProDetails.amount;
outputs.push({
'toAddress': toAddress,
'amount': amountSat,
'message': message
});
var txp = {
toAddress: toAddress,
amount: amountSat,
outputs: outputs,
message: message,
payProUrl: payProUrl,
excludeUnconfirmedUtxos: configWallet.spendUnconfirmed ? false : true,
feeLevel: configWallet.settings.feeLevel || 'normal'
};
walletService.createTx($scope.wallet, txp, function(err, ctxp) {
if (err) {
ongoingProcess.set('topup', false, statusChangeHandler);
showError(gettextCatalog.getString('Could not create transaction'), bwcError.msg(err));
return;
}
title = gettextCatalog.getString('Sending {{amountStr}} from {{walletName}}', {
amountStr: txFormatService.formatAmountStr(ctxp.amount, true),
walletName: $scope.wallet.name
});
message = gettextCatalog.getString("{{fee}} will be deducted for bitcoin networking fees.", {
fee: txFormatService.formatAmountStr(ctxp.fee)
});
okText = gettextCatalog.getString('Confirm');
popupService.showConfirm(title, message, okText, cancelText, function(ok) {
ongoingProcess.set('topup', false, statusChangeHandler);
if (!ok) {
$scope.sendStatus = '';
return;
}
$scope.expirationTime = null; // Disable countdown
ongoingProcess.set('sendingTx', true, statusChangeHandler);
publishAndSign($scope.wallet, ctxp, function() {}, function(err, txSent) {
ongoingProcess.set('sendingTx', false, statusChangeHandler);
if (err) {
showError(gettextCatalog.getString('Could not send transaction'), err);
return;
}
});
});
});
}, true); // Disable loader
}); });
}; };
@ -223,38 +300,20 @@ angular.module('copayApp.controllers').controller('topUpController', function($s
}; };
$scope.onWalletSelect = function(wallet) { $scope.onWalletSelect = function(wallet) {
if ($scope.wallet && (wallet.id == $scope.wallet.id)) return;
$scope.wallet = wallet; $scope.wallet = wallet;
if (sendMax) { ongoingProcess.set('retrievingInputs', true);
ongoingProcess.set('retrievingInputs', true); calculateAmount(wallet, function(err, a, c) {
sendMaxService.getInfo($scope.wallet, function(err, values) { ongoingProcess.set('retrievingInputs', false);
ongoingProcess.set('retrievingInputs', false); if (err) {
if (err) { createdTx = message = $scope.totalAmountStr = $scope.amountUnitStr = $scope.wallet = null;
showErrorAndBack(null, err); showError(err.title, err.message, function() {
return; $scope.showWalletSelector();
} });
var unitName = configWallet.settings.unitName; return;
var amountUnit = txFormatService.satToUnit(values.amount); }
var parsedAmount = txFormatService.parseAmount( var parsedAmount = txFormatService.parseAmount(a, c);
amountUnit, initializeTopUp(wallet, parsedAmount);
unitName); });
dataSrc['amount'] = parsedAmount.amount;
dataSrc['currency'] = parsedAmount.currency;
$scope.amountUnitStr = parsedAmount.amountUnitStr;
createInvoice();
$timeout(function() {
$scope.$digest();
}, 100);
});
} else {
createInvoice();
}
};
$scope.invoiceExpired = function() {
$scope.sendStatus = '';
showErrorAndBack(gettextCatalog.getString('Invoice Expired'), gettextCatalog.getString('This invoice has expired. An invoice is only valid for 15 minutes.'));
}; };
$scope.goBackHome = function() { $scope.goBackHome = function() {

View File

@ -45,8 +45,7 @@ angular.module('copayApp.services').factory('ongoingProcess', function($log, $ti
'cancelingGiftCard': 'Canceling Gift Card...', 'cancelingGiftCard': 'Canceling Gift Card...',
'creatingGiftCard': 'Creating Gift Card...', 'creatingGiftCard': 'Creating Gift Card...',
'buyingGiftCard': 'Buying Gift Card...', 'buyingGiftCard': 'Buying Gift Card...',
'topup': gettext('Top up in progress...'), 'topup': gettext('Top up in progress...')
'creatingInvoice': gettext('Creating invoice...')
}; };
root.clear = function() { root.clear = function() {

View File

@ -10,7 +10,7 @@ angular.module('copayApp.services').service('sendMaxService', function(feeServic
* *
*/ */
this.getInfo = function(wallet, cb) { this.getInfo = function(wallet, cb) {
feeService.getCurrentFeeRate(wallet.credentials.network, null, function(err, feePerKb) { feeService.getCurrentFeeRate(wallet.credentials.network, function(err, feePerKb) {
if (err) return cb(err); if (err) return cb(err);
var config = configService.getSync().wallet; var config = configService.getSync().wallet;

View File

@ -23,6 +23,26 @@ angular.module('copayApp.services').factory('txFormatService', function($filter,
return root.formatAmount(satoshis) + ' ' + config.unitName; return root.formatAmount(satoshis) + ' ' + config.unitName;
}; };
root.toFiat = function(satoshis, code, cb) {
if (isNaN(satoshis)) return;
var val = function() {
var v1 = rateService.toFiat(satoshis, code);
if (!v1) return null;
return v1.toFixed(2);
};
// Async version
if (cb) {
rateService.whenAvailable(function() {
return cb(val());
});
} else {
if (!rateService.isAvailable()) return null;
return val();
};
};
root.formatToUSD = function(satoshis, cb) { root.formatToUSD = function(satoshis, cb) {
if (isNaN(satoshis)) return; if (isNaN(satoshis)) return;
var val = function() { var val = function() {
@ -169,9 +189,15 @@ angular.module('copayApp.services').factory('txFormatService', function($filter,
var alternativeIsoCode = config.alternativeIsoCode; var alternativeIsoCode = config.alternativeIsoCode;
// If fiat currency // If fiat currency
if (currency != 'bits' && currency != 'BTC') { if (currency != 'bits' && currency != 'BTC' && currency != 'sat') {
amountUnitStr = $filter('formatFiatAmount')(amount) + ' ' + currency; amountUnitStr = $filter('formatFiatAmount')(amount) + ' ' + currency;
amountSat = rateService.fromFiat(amount, currency).toFixed(0); amountSat = rateService.fromFiat(amount, currency).toFixed(0);
} else if (currency == 'sat') {
amountSat = amount;
amountUnitStr = root.formatAmountStr(amountSat);
// convert sat to BTC
amount = (amountSat * satToBtc).toFixed(8);
currency = 'BTC';
} else { } else {
amountSat = parseInt((amount * unitToSatoshi).toFixed(0)); amountSat = parseInt((amount * unitToSatoshi).toFixed(0));
amountUnitStr = root.formatAmountStr(amountSat); amountUnitStr = root.formatAmountStr(amountSat);
@ -181,8 +207,8 @@ angular.module('copayApp.services').factory('txFormatService', function($filter,
} }
return { return {
amount: amount, amount: amount,
currency: currency, currency: currency,
alternativeIsoCode: alternativeIsoCode, alternativeIsoCode: alternativeIsoCode,
amountSat: amountSat, amountSat: amountSat,
amountUnitStr: amountUnitStr amountUnitStr: amountUnitStr

View File

@ -55,6 +55,10 @@
span { span {
text-transform: capitalize; text-transform: capitalize;
} }
.big-icon-svg {
padding: 0 12px 0 0;
}
} }
.amount-label{ .amount-label{
line-height: 30px; line-height: 30px;

View File

@ -2,25 +2,27 @@
<ion-nav-bar class="bar-royal"> <ion-nav-bar class="bar-royal">
<ion-nav-back-button> <ion-nav-back-button>
</ion-nav-back-button> </ion-nav-back-button>
<ion-nav-title>Add funds</ion-nav-title> <ion-nav-title>
{{'Add funds' | translate}}
</ion-nav-title>
</ion-nav-bar> </ion-nav-bar>
<ion-content class="add-bottom-for-cta"> <ion-content class="add-bottom-for-cta">
<!-- SELL --> <!-- SELL -->
<div class="list" ng-if="cardInfo"> <div class="list">
<div class="item head"> <div class="item head">
<div class="sending-label"> <div class="sending-label">
<i class="icon big-icon-svg"> <i class="icon big-icon-svg">
<div class="bg icon-bitpay-card"></div> <div class="bg icon-bitpay-card"></div>
</i> </i>
<span>BitPay Card - Visa &reg; Prepaid Debit</span> <span>BitPay Visa&reg; Card ({{lastFourDigits}})</span>
</div> </div>
<div class="amount-label"> <div class="amount-label">
<div class="amount-final">{{amountUnitStr}}</div> <div class="amount-final">{{amountUnitStr}}</div>
<div class="alternative"> <div class="alternative" ng-show="amountUnitStr">
<span ng-if="rate">@ <span ng-if="rate">@
{{rate | currency:cardInfo.currencySymbol:2}} per BTC</span> {{rate | currency:currencySymbol:2}} {{currencyIsoCode}} per BTC</span>
<span ng-if="!rate">...</span> <span ng-if="!rate">...</span>
</div> </div>
</div> </div>
@ -39,45 +41,39 @@
<i class="icon bp-arrow-right"></i> <i class="icon bp-arrow-right"></i>
</div> </div>
<div class="item item-divider" translate> <div ng-show="totalAmountStr">
Deposit into <div class="item item-divider" translate>
Details
</div>
<div class="item">
<span translate>Funds to be added</span>
<span class="item-note">
<span ng-if="amount">{{amount | currency:currencySymbol:2}} {{currencyIsoCode}}</span>
<span ng-if="!amount">...</span>
</span>
</div>
<div class="item">
<span translate>Invoice Fee</span>
<span class="item-note">
<span ng-if="invoiceFee">{{invoiceFee | currency:currencySymbol:2}} {{currencyIsoCode}}</span>
<span ng-if="!invoiceFee">...</span>
</span>
</div>
<div class="item">
<span translate>Network Fee</span>
<span class="item-note">
<span ng-if="networkFee">{{networkFee | currency:currencySymbol:2}} {{currencyIsoCode}}</span>
<span ng-if="!networkFee">...</span>
</span>
</div>
<div class="item">
<span translate>Total</span>
<span class="item-note">
<span ng-if="totalAmount">{{totalAmount | currency:currencySymbol:2}} {{currencyIsoCode}}</span>
<span ng-if="totalAmountStr">({{totalAmountStr}})</span>
</span>
</div>
</div> </div>
<div class="item">
<span translate>Card</span>
<span class="item-note">
xxxx-xxxx-xxxx-{{cardInfo.lastFourDigits}}
</span>
</div>
<div class="item">
<span translate>Account</span>
<span class="item-note">
{{cardInfo.email}}
</span>
</div>
<div class="item item-divider" translate>
Invoice
</div>
<div class="item">
<span translate>Expire in</span>
<span class="item-note" ng-if="expirationTime">
<timer countdown="expirationTime" interval="1000" active="true" output-format="mm:ss"
on-zero-callback="invoiceExpired">{{formatted}}</timer>
</span>
</div>
<div class="item">
<span translate>Fee</span>
<span class="item-note">
{{invoice.buyerPaidBtcMinerFee}}
</span>
</div>
<div class="item">
<span translate>Total</span>
<span class="item-note total">
{{invoice.buyerTotalBtcAmount}}
</span>
</div>
<div class="item item-divider"></div>
</div> </div>
</div> </div>
@ -85,16 +81,16 @@
<click-to-accept <click-to-accept
ng-click="topUpConfirm()" ng-click="topUpConfirm()"
ng-if="!isCordova && cardInfo" ng-if="!isCordova"
click-send-status="sendStatus" click-send-status="sendStatus"
is-disabled="!cardInfo || !wallet"> is-disabled="!wallet || !totalAmountStr">
Add funds Add funds
</click-to-accept> </click-to-accept>
<slide-to-accept <slide-to-accept
ng-if="isCordova && cardInfo" ng-if="isCordova && (!wallet || !totalAmountStr)"
slide-on-confirm="topUpConfirm()" slide-on-confirm="topUpConfirm()"
slide-send-status="sendStatus" slide-send-status="sendStatus"
is-disabled="!cardInfo || !wallet"> is-disabled="!wallet || !totalAmountStr">
Slide to confirm Slide to confirm
</slide-to-accept> </slide-to-accept>
<slide-to-accept-success <slide-to-accept-success