fix ui forms for paypal, cash app, venmo

This commit is contained in:
woodser 2024-06-09 08:26:07 -04:00
parent 7abbe1c36f
commit 9b3d78bd4b
5 changed files with 18 additions and 10 deletions

View File

@ -132,15 +132,14 @@ public class PaymentAccountFactory {
return new AchTransferAccount();
case PaymentMethod.DOMESTIC_WIRE_TRANSFER_ID:
return new DomesticWireTransferAccount();
// Cannot be deleted as it would break old trade history entries
case PaymentMethod.OK_PAY_ID:
return new OKPayAccount();
case PaymentMethod.CASH_APP_ID:
return new CashAppAccount();
case PaymentMethod.VENMO_ID:
return new VenmoAccount();
// Cannot be deleted as it would break old trade history entries
case PaymentMethod.OK_PAY_ID:
return new OKPayAccount();
default:
throw new RuntimeException("Not supported PaymentMethod: " + paymentMethod);
}

View File

@ -42,8 +42,7 @@ public class CashAppForm extends PaymentMethodForm {
private final EmailOrMobileNrOrCashtagValidator cashAppValidator;
public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) {
addCompactTopLabelTextFieldWithCopyIcon(gridPane, gridRow, 1, Res.get("payment.email.mobile.cashtag"),
((CashAppAccountPayload) paymentAccountPayload).getEmailOrMobileNrOrCashtag());
addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.email.mobile.cashtag"), ((CashAppAccountPayload) paymentAccountPayload).getEmailOrMobileNrOrCashtag());
return gridRow;
}

View File

@ -42,8 +42,7 @@ public class PayPalForm extends PaymentMethodForm {
private final EmailOrMobileNrOrUsernameValidator paypalValidator;
public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) {
addCompactTopLabelTextFieldWithCopyIcon(gridPane, gridRow, 1, Res.get("payment.email.mobile.username"),
((PayPalAccountPayload) paymentAccountPayload).getEmailOrMobileNrOrUsername());
addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.email.mobile.username"), ((PayPalAccountPayload) paymentAccountPayload).getEmailOrMobileNrOrUsername());
return gridRow;
}

View File

@ -41,8 +41,7 @@ public class VenmoForm extends PaymentMethodForm {
private final EmailOrMobileNrOrUsernameValidator venmoValidator;
public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) {
addCompactTopLabelTextFieldWithCopyIcon(gridPane, gridRow, 1, Res.get("payment.email.mobile.username"),
((VenmoAccountPayload) paymentAccountPayload).getEmailOrMobileNrOrUsername());
addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.email.mobile.username"), ((VenmoAccountPayload) paymentAccountPayload).getEmailOrMobileNrOrUsername());
return gridRow;
}

View File

@ -51,8 +51,10 @@ import haveno.desktop.components.paymentmethods.AssetsForm;
import haveno.desktop.components.paymentmethods.AustraliaPayidForm;
import haveno.desktop.components.paymentmethods.BizumForm;
import haveno.desktop.components.paymentmethods.CapitualForm;
import haveno.desktop.components.paymentmethods.CashAppForm;
import haveno.desktop.components.paymentmethods.CashAtAtmForm;
import haveno.desktop.components.paymentmethods.PayByMailForm;
import haveno.desktop.components.paymentmethods.PayPalForm;
import haveno.desktop.components.paymentmethods.CashDepositForm;
import haveno.desktop.components.paymentmethods.CelPayForm;
import haveno.desktop.components.paymentmethods.ChaseQuickPayForm;
@ -93,6 +95,7 @@ import haveno.desktop.components.paymentmethods.TransferwiseUsdForm;
import haveno.desktop.components.paymentmethods.USPostalMoneyOrderForm;
import haveno.desktop.components.paymentmethods.UpholdForm;
import haveno.desktop.components.paymentmethods.UpiForm;
import haveno.desktop.components.paymentmethods.VenmoForm;
import haveno.desktop.components.paymentmethods.VerseForm;
import haveno.desktop.components.paymentmethods.WeChatPayForm;
import haveno.desktop.components.paymentmethods.WesternUnionForm;
@ -405,6 +408,15 @@ public class BuyerStep2View extends TradeStepView {
case PaymentMethod.DOMESTIC_WIRE_TRANSFER_ID:
gridRow = DomesticWireTransferForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload);
break;
case PaymentMethod.CASH_APP_ID:
gridRow = CashAppForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload);
break;
case PaymentMethod.PAYPAL_ID:
gridRow = PayPalForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload);
break;
case PaymentMethod.VENMO_ID:
gridRow = VenmoForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload);
break;
default:
log.error("Not supported PaymentMethod: " + paymentMethodId);
}