Search in sources :

Example 1 with WesternUnionAccount

use of bisq.core.payment.WesternUnionAccount in project bisq-desktop by bisq-network.

the class FiatAccountsView method onSaveNewAccount.

// /////////////////////////////////////////////////////////////////////////////////////////
// UI actions
// /////////////////////////////////////////////////////////////////////////////////////////
private void onSaveNewAccount(PaymentAccount paymentAccount) {
    Coin maxTradeLimitAsCoin = paymentAccount.getPaymentMethod().getMaxTradeLimitAsCoin("USD");
    Coin maxTradeLimitSecondMonth = maxTradeLimitAsCoin.divide(2L);
    Coin maxTradeLimitFirstMonth = maxTradeLimitAsCoin.divide(4L);
    new Popup<>().information(Res.get("payment.limits.info", formatter.formatCoinWithCode(maxTradeLimitFirstMonth), formatter.formatCoinWithCode(maxTradeLimitSecondMonth), formatter.formatCoinWithCode(maxTradeLimitAsCoin))).width(700).closeButtonText(Res.get("shared.cancel")).actionButtonText(Res.get("shared.iUnderstand")).onAction(() -> {
        final String currencyName = BisqEnvironment.getBaseCurrencyNetwork().getCurrencyName();
        if (paymentAccount instanceof ClearXchangeAccount) {
            new Popup<>().information(Res.get("payment.clearXchange.info", currencyName, currencyName)).width(900).closeButtonText(Res.get("shared.cancel")).actionButtonText(Res.get("shared.iConfirm")).onAction(() -> doSaveNewAccount(paymentAccount)).show();
        } else if (paymentAccount instanceof WesternUnionAccount) {
            new Popup<>().information(Res.get("payment.westernUnion.info")).width(700).closeButtonText(Res.get("shared.cancel")).actionButtonText(Res.get("shared.iUnderstand")).onAction(() -> doSaveNewAccount(paymentAccount)).show();
        } else {
            doSaveNewAccount(paymentAccount);
        }
    }).show();
}
Also used : Coin(org.bitcoinj.core.Coin) ClearXchangeAccount(bisq.core.payment.ClearXchangeAccount) Popup(bisq.desktop.main.overlays.popups.Popup) WesternUnionAccount(bisq.core.payment.WesternUnionAccount)

Aggregations

ClearXchangeAccount (bisq.core.payment.ClearXchangeAccount)1 WesternUnionAccount (bisq.core.payment.WesternUnionAccount)1 Popup (bisq.desktop.main.overlays.popups.Popup)1 Coin (org.bitcoinj.core.Coin)1