Use different wording in popups for cash deposit and postal money order

This commit is contained in:
Manfred Karrer 2016-08-29 13:36:53 +02:00
parent 0ff4e0051a
commit 3bb30b43c4
2 changed files with 61 additions and 22 deletions

View file

@ -29,10 +29,7 @@ import io.bitsquare.gui.main.portfolio.pendingtrades.steps.TradeStepView;
import io.bitsquare.gui.util.Layout; import io.bitsquare.gui.util.Layout;
import io.bitsquare.locale.BSResources; import io.bitsquare.locale.BSResources;
import io.bitsquare.locale.CurrencyUtil; import io.bitsquare.locale.CurrencyUtil;
import io.bitsquare.payment.CashDepositAccountContractData; import io.bitsquare.payment.*;
import io.bitsquare.payment.CryptoCurrencyAccountContractData;
import io.bitsquare.payment.PaymentAccountContractData;
import io.bitsquare.payment.PaymentMethod;
import io.bitsquare.trade.Trade; import io.bitsquare.trade.Trade;
import javafx.scene.control.Button; import javafx.scene.control.Button;
import javafx.scene.control.Label; import javafx.scene.control.Label;
@ -91,8 +88,21 @@ public class BuyerStep2View extends TradeStepView {
"DO NOT use any additional notice in the \"reason for payment\" text like " + "DO NOT use any additional notice in the \"reason for payment\" text like " +
"Bitcoin, Btc or Bitsquare.\n\n" + "Bitcoin, Btc or Bitsquare.\n\n" +
"If your bank charges fees you have to cover those fees.\n\n" + "If your bank charges fees you have to cover those fees.\n\n" +
"IMPORTANT REQUIREMENT:\n" +
"After you have done the payment write on the paper receipt: NO REFUNDS.\n" + "After you have done the payment write on the paper receipt: NO REFUNDS.\n" +
"Then tear it in 2 parts, make a photo and send it to the BTC seller's email address."; "Then tear it in 2 parts, make a photo and send it to the BTC seller's email address.";
else if (paymentAccountContractData instanceof USPostalMoneyOrderAccountContractData)
message = "Your trade has reached at least one blockchain confirmation.\n" +
"(You can wait for more confirmations if you want - 6 confirmations are considered as very secure.)\n\n" +
"Please send " +
model.formatter.formatVolumeWithCode(trade.getTradeVolume()) + " by \"US Postal Money Order\" to the BTC seller.\n\n" +
"Here are the payment account details of the BTC seller:\n" +
"" + paymentAccountContractData.getPaymentDetailsForTradePopup() + ".\n" +
"(You can copy & paste the values from the main screen after closing that popup.)\n\n" +
"Please don't forget to add the trade ID \"" + trade.getShortId() +
"\" as \"reason for payment\" so the receiver can assign your payment to this trade.\n\n" +
"DO NOT use any additional notice in the \"reason for payment\" text like " +
"Bitcoin, Btc or Bitsquare.";
else else
message = "Your trade has reached at least one blockchain confirmation.\n" + message = "Your trade has reached at least one blockchain confirmation.\n" +
"(You can wait for more confirmations if you want - 6 confirmations are considered as very secure.)\n\n" + "(You can wait for more confirmations if you want - 6 confirmations are considered as very secure.)\n\n" +
@ -246,6 +256,33 @@ public class BuyerStep2View extends TradeStepView {
private void onPaymentStarted() { private void onPaymentStarted() {
if (model.p2PService.isBootstrapped()) { if (model.p2PService.isBootstrapped()) {
if (model.dataModel.getSellersPaymentAccountContractData() instanceof CashDepositAccountContractData) {
String key = "confirmPaperReceiptSent";
if (!DevFlags.DEV_MODE && preferences.showAgain(key)) {
Popup popup = new Popup();
popup.headLine("Did you sent the paper receipt to the BTC seller?")
.feedback("Remember:\n" +
"You need to write on the paper receipt: NO REFUNDS.\n" +
"Then tear it in 2 parts, make a photo and send it to the BTC seller's email address.")
.actionButtonText("Yes, I have sent the paper receipt")
.onAction(this::showConfirmPaymentStartedPopup)
.closeButtonText("No")
.onClose(popup::hide)
.dontShowAgainId(key, preferences)
.show();
} else {
showConfirmPaymentStartedPopup();
}
} else {
showConfirmPaymentStartedPopup();
}
} else {
new Popup().information("You need to wait until you are fully connected to the network.\n" +
"That might take up to about 2 minutes at startup.").show();
}
}
private void showConfirmPaymentStartedPopup() {
String key = "confirmPaymentStarted"; String key = "confirmPaymentStarted";
if (!DevFlags.DEV_MODE && preferences.showAgain(key)) { if (!DevFlags.DEV_MODE && preferences.showAgain(key)) {
Popup popup = new Popup(); Popup popup = new Popup();
@ -262,10 +299,6 @@ public class BuyerStep2View extends TradeStepView {
} else { } else {
confirmPaymentStarted(); confirmPaymentStarted();
} }
} else {
new Popup().information("You need to wait until you are fully connected to the network.\n" +
"That might take up to about 2 minutes at startup.").show();
}
} }
private void confirmPaymentStarted() { private void confirmPaymentStarted() {

View file

@ -80,6 +80,12 @@ public class SellerStep3View extends TradeStepView {
"You can copy & paste your " + currencyName + " address from the main screen after " + "You can copy & paste your " + currencyName + " address from the main screen after " +
"closing that popup."; "closing that popup.";
} else { } else {
if (paymentAccountContractData instanceof USPostalMoneyOrderAccountContractData)
message = "Your trading partner has confirmed that he initiated the " + currencyName + " payment.\n\n" +
"Please check if you have received " +
tradeVolumeWithCode + " with \"US Postal Money Order\" from the BTC buyer.\n\n" +
"The trade ID (\"reason for payment\" text) of the transaction is: \"" + trade.getShortId() + "\"";
else
message = "Your trading partner has confirmed that he initiated the " + currencyName + " payment.\n\n" + message = "Your trading partner has confirmed that he initiated the " + currencyName + " payment.\n\n" +
"Please go to your online banking web page and check if you have received " + "Please go to your online banking web page and check if you have received " +
tradeVolumeWithCode + " from the BTC buyer.\n\n" + tradeVolumeWithCode + " from the BTC buyer.\n\n" +