Search in sources :

Example 1 with WesternUnionAccountPayload

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

the class SellerStep3View method showPopup.

@SuppressWarnings("PointlessBooleanExpression")
private void showPopup() {
    PaymentAccountPayload paymentAccountPayload = model.dataModel.getSellersPaymentAccountPayload();
    // noinspection UnusedAssignment
    String key = "confirmPayment" + trade.getId();
    String message = "";
    String tradeVolumeWithCode = model.btcFormatter.formatVolumeWithCode(trade.getTradeVolume());
    String currencyName = CurrencyUtil.getNameByCode(trade.getOffer().getCurrencyCode());
    String part1 = Res.get("portfolio.pending.step3_seller.part", currencyName);
    String id = trade.getShortId();
    if (paymentAccountPayload instanceof CryptoCurrencyAccountPayload) {
        String address = ((CryptoCurrencyAccountPayload) paymentAccountPayload).getAddress();
        // noinspection UnusedAssignment
        message = Res.get("portfolio.pending.step3_seller.altcoin", part1, currencyName, address, tradeVolumeWithCode, currencyName);
    } else {
        if (paymentAccountPayload instanceof USPostalMoneyOrderAccountPayload)
            message = Res.get("portfolio.pending.step3_seller.postal", part1, tradeVolumeWithCode, id);
        else if (!(paymentAccountPayload instanceof WesternUnionAccountPayload))
            message = Res.get("portfolio.pending.step3_seller.bank", currencyName, tradeVolumeWithCode, id);
        String part = Res.get("portfolio.pending.step3_seller.openDispute");
        if (paymentAccountPayload instanceof CashDepositAccountPayload)
            message = message + Res.get("portfolio.pending.step3_seller.cash", part);
        else if (paymentAccountPayload instanceof WesternUnionAccountPayload)
            message = message + Res.get("portfolio.pending.step3_seller.westernUnion", part);
        Optional<String> optionalHolderName = getOptionalHolderName();
        if (optionalHolderName.isPresent()) {
            // noinspection UnusedAssignment
            message = message + Res.get("portfolio.pending.step3_seller.bankCheck", optionalHolderName.get(), part);
        }
    }
    // noinspection ConstantConditions
    if (!DevEnv.isDevMode() && DontShowAgainLookup.showAgain(key)) {
        DontShowAgainLookup.dontShowAgain(key, true);
        new Popup<>().headLine(Res.get("popup.attention.forTradeWithId", id)).attention(message).show();
    }
}
Also used : CashDepositAccountPayload(bisq.core.payment.payload.CashDepositAccountPayload) USPostalMoneyOrderAccountPayload(bisq.core.payment.payload.USPostalMoneyOrderAccountPayload) PaymentAccountPayload(bisq.core.payment.payload.PaymentAccountPayload) WesternUnionAccountPayload(bisq.core.payment.payload.WesternUnionAccountPayload) CryptoCurrencyAccountPayload(bisq.core.payment.payload.CryptoCurrencyAccountPayload)

Example 2 with WesternUnionAccountPayload

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

the class BuyerStep2View method showPopup.

@SuppressWarnings("PointlessBooleanExpression")
private void showPopup() {
    PaymentAccountPayload paymentAccountPayload = model.dataModel.getSellersPaymentAccountPayload();
    if (paymentAccountPayload != null) {
        String paymentDetailsForTradePopup = paymentAccountPayload.getPaymentDetailsForTradePopup();
        String message = Res.get("portfolio.pending.step2.confReached");
        String copyPaste = Res.get("portfolio.pending.step2_buyer.copyPaste");
        String refTextWarn = Res.get("portfolio.pending.step2_buyer.refTextWarn");
        String accountDetails = Res.get("portfolio.pending.step2_buyer.accountDetails");
        String tradeId = Res.get("portfolio.pending.step2_buyer.tradeId");
        String assign = Res.get("portfolio.pending.step2_buyer.assign");
        String fees = Res.get("portfolio.pending.step2_buyer.fees");
        String id = trade.getShortId();
        String paddedId = " " + id + " ";
        String amount = model.btcFormatter.formatVolumeWithCode(trade.getTradeVolume());
        if (paymentAccountPayload instanceof CryptoCurrencyAccountPayload) {
            // noinspection UnusedAssignment
            message += Res.get("portfolio.pending.step2_buyer.altcoin", CurrencyUtil.getNameByCode(trade.getOffer().getCurrencyCode()), amount) + accountDetails + paymentDetailsForTradePopup + ".\n\n" + copyPaste;
        } else if (paymentAccountPayload instanceof CashDepositAccountPayload) {
            // noinspection UnusedAssignment
            message += Res.get("portfolio.pending.step2_buyer.cash", amount) + accountDetails + paymentDetailsForTradePopup + ".\n" + copyPaste + "\n\n" + tradeId + paddedId + assign + refTextWarn + "\n\n" + fees + "\n\n" + Res.get("portfolio.pending.step2_buyer.cash.extra");
        } else if (paymentAccountPayload instanceof WesternUnionAccountPayload) {
            final String email = ((WesternUnionAccountPayload) paymentAccountPayload).getEmail();
            final String extra = Res.get("portfolio.pending.step2_buyer.westernUnion.extra", email);
            message += Res.get("portfolio.pending.step2_buyer.westernUnion", amount) + accountDetails + paymentDetailsForTradePopup + ".\n" + copyPaste + "\n\n" + extra;
        } else if (paymentAccountPayload instanceof USPostalMoneyOrderAccountPayload) {
            // noinspection UnusedAssignment
            message += Res.get("portfolio.pending.step2_buyer.postal", amount) + accountDetails + paymentDetailsForTradePopup + ".\n" + copyPaste + "\n\n" + tradeId + paddedId + assign + refTextWarn;
        } else {
            // noinspection UnusedAssignment
            message += Res.get("portfolio.pending.step2_buyer.bank", amount) + accountDetails + paymentDetailsForTradePopup + ".\n" + copyPaste + "\n\n" + tradeId + paddedId + assign + refTextWarn + "\n\n" + fees;
        }
        // noinspection ConstantConditions,UnusedAssignment
        String key = "startPayment" + trade.getId();
        // noinspection ConstantConditions,ConstantConditions
        if (!DevEnv.isDevMode() && DontShowAgainLookup.showAgain(key)) {
            DontShowAgainLookup.dontShowAgain(key, true);
            new Popup<>().headLine(Res.get("popup.attention.forTradeWithId", id)).attention(message).show();
        }
    }
}
Also used : CashDepositAccountPayload(bisq.core.payment.payload.CashDepositAccountPayload) USPostalMoneyOrderAccountPayload(bisq.core.payment.payload.USPostalMoneyOrderAccountPayload) PaymentAccountPayload(bisq.core.payment.payload.PaymentAccountPayload) WesternUnionAccountPayload(bisq.core.payment.payload.WesternUnionAccountPayload) CryptoCurrencyAccountPayload(bisq.core.payment.payload.CryptoCurrencyAccountPayload)

Example 3 with WesternUnionAccountPayload

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

the class WesternUnionForm method addFormForBuyer.

public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) {
    final WesternUnionAccountPayload payload = (WesternUnionAccountPayload) paymentAccountPayload;
    addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.getWithCol("payment.account.fullName"), payload.getHolderName());
    addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.getWithCol("payment.account.city"), payload.getCity());
    if (BankUtil.isStateRequired(payload.getCountryCode()))
        addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.getWithCol("payment.account.state"), payload.getState());
    addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.getWithCol("payment.email"), payload.getEmail());
    return gridRow;
}
Also used : WesternUnionAccountPayload(bisq.core.payment.payload.WesternUnionAccountPayload)

Example 4 with WesternUnionAccountPayload

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

the class SellerStep3View method onPaymentReceived.

// //////////////////////////////////////////////////////////////////////////////////////
// UI Handlers
// /////////////////////////////////////////////////////////////////////////////////////////
@SuppressWarnings("PointlessBooleanExpression")
private void onPaymentReceived() {
    // are well connected to the Bitcoin network before triggering the broadcast.
    if (model.dataModel.isReadyForTxBroadcast()) {
        // noinspection UnusedAssignment
        String key = "confirmPaymentReceived";
        // noinspection ConstantConditions
        if (!DevEnv.isDevMode() && DontShowAgainLookup.showAgain(key)) {
            PaymentAccountPayload paymentAccountPayload = model.dataModel.getSellersPaymentAccountPayload();
            String message = Res.get("portfolio.pending.step3_seller.onPaymentReceived.part1", CurrencyUtil.getNameByCode(model.dataModel.getCurrencyCode()));
            if (!(paymentAccountPayload instanceof CryptoCurrencyAccountPayload)) {
                if (!(paymentAccountPayload instanceof WesternUnionAccountPayload))
                    message += Res.get("portfolio.pending.step3_seller.onPaymentReceived.fiat", trade.getShortId());
                Optional<String> optionalHolderName = getOptionalHolderName();
                if (optionalHolderName.isPresent()) {
                    message += Res.get("portfolio.pending.step3_seller.onPaymentReceived.name", optionalHolderName.get());
                }
            }
            message += Res.get("portfolio.pending.step3_seller.onPaymentReceived.note");
            new Popup<>().headLine(Res.get("portfolio.pending.step3_seller.onPaymentReceived.confirm.headline")).confirmation(message).width(700).actionButtonText(Res.get("portfolio.pending.step3_seller.onPaymentReceived.confirm.yes")).onAction(this::confirmPaymentReceived).closeButtonText(Res.get("shared.cancel")).show();
        } else {
            confirmPaymentReceived();
        }
    } else {
        model.dataModel.showNotReadyForTxBroadcastPopups();
    }
}
Also used : PaymentAccountPayload(bisq.core.payment.payload.PaymentAccountPayload) WesternUnionAccountPayload(bisq.core.payment.payload.WesternUnionAccountPayload) CryptoCurrencyAccountPayload(bisq.core.payment.payload.CryptoCurrencyAccountPayload)

Example 5 with WesternUnionAccountPayload

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

the class BuyerStep2View method onPaymentStarted.

// /////////////////////////////////////////////////////////////////////////////////////////
// UI Handlers
// /////////////////////////////////////////////////////////////////////////////////////////
@SuppressWarnings("PointlessBooleanExpression")
private void onPaymentStarted() {
    if (model.p2PService.isBootstrapped()) {
        if (model.dataModel.getSellersPaymentAccountPayload() instanceof CashDepositAccountPayload) {
            // noinspection UnusedAssignment
            String key = "confirmPaperReceiptSent";
            // noinspection ConstantConditions
            if (!DevEnv.isDevMode() && DontShowAgainLookup.showAgain(key)) {
                Popup popup = new Popup<>();
                popup.headLine(Res.get("portfolio.pending.step2_buyer.paperReceipt.headline")).feedback(Res.get("portfolio.pending.step2_buyer.paperReceipt.msg")).onAction(this::showConfirmPaymentStartedPopup).closeButtonText(Res.get("shared.no")).onClose(popup::hide).dontShowAgainId(key).show();
            } else {
                showConfirmPaymentStartedPopup();
            }
        } else if (model.dataModel.getSellersPaymentAccountPayload() instanceof WesternUnionAccountPayload) {
            // noinspection UnusedAssignment
            // noinspection ConstantConditions
            String key = "westernUnionMTCNSent";
            if (!DevEnv.isDevMode() && DontShowAgainLookup.showAgain(key)) {
                String email = ((WesternUnionAccountPayload) model.dataModel.getSellersPaymentAccountPayload()).getEmail();
                Popup popup = new Popup<>();
                popup.headLine(Res.get("portfolio.pending.step2_buyer.westernUnionMTCNInfo.headline")).feedback(Res.get("portfolio.pending.step2_buyer.westernUnionMTCNInfo.msg", email)).onAction(this::showConfirmPaymentStartedPopup).actionButtonText(Res.get("shared.yes")).closeButtonText(Res.get("shared.no")).onClose(popup::hide).dontShowAgainId(key).show();
            } else {
                showConfirmPaymentStartedPopup();
            }
        } else {
            showConfirmPaymentStartedPopup();
        }
    } else {
        new Popup<>().information(Res.get("popup.warning.notFullyConnected")).show();
    }
}
Also used : CashDepositAccountPayload(bisq.core.payment.payload.CashDepositAccountPayload) Popup(bisq.desktop.main.overlays.popups.Popup) WesternUnionAccountPayload(bisq.core.payment.payload.WesternUnionAccountPayload)

Aggregations

WesternUnionAccountPayload (bisq.core.payment.payload.WesternUnionAccountPayload)5 CashDepositAccountPayload (bisq.core.payment.payload.CashDepositAccountPayload)3 CryptoCurrencyAccountPayload (bisq.core.payment.payload.CryptoCurrencyAccountPayload)3 PaymentAccountPayload (bisq.core.payment.payload.PaymentAccountPayload)3 USPostalMoneyOrderAccountPayload (bisq.core.payment.payload.USPostalMoneyOrderAccountPayload)2 Popup (bisq.desktop.main.overlays.popups.Popup)1