WeChat Pay supports CNY, USD, EUR, and GBP

This commit is contained in:
woodser 2025-01-21 09:49:42 -05:00
parent 535b71adc5
commit 3847d1bd3a
2 changed files with 13 additions and 2 deletions

View file

@ -31,11 +31,15 @@ import java.util.List;
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
public final class WeChatPayAccount extends PaymentAccount { public final class WeChatPayAccount extends PaymentAccount {
public static final List<TradeCurrency> SUPPORTED_CURRENCIES = List.of(new TraditionalCurrency("CNY")); public static final List<TradeCurrency> SUPPORTED_CURRENCIES = List.of(
new TraditionalCurrency("CNY"),
new TraditionalCurrency("USD"),
new TraditionalCurrency("EUR"),
new TraditionalCurrency("GBP")
);
public WeChatPayAccount() { public WeChatPayAccount() {
super(PaymentMethod.WECHAT_PAY); super(PaymentMethod.WECHAT_PAY);
setSingleTradeCurrency(SUPPORTED_CURRENCIES.get(0));
} }
@Override @Override

View file

@ -26,6 +26,7 @@ import haveno.core.payment.payload.WeChatPayAccountPayload;
import haveno.core.payment.validation.WeChatPayValidator; import haveno.core.payment.validation.WeChatPayValidator;
import haveno.core.util.coin.CoinFormatter; import haveno.core.util.coin.CoinFormatter;
import haveno.core.util.validation.InputValidator; import haveno.core.util.validation.InputValidator;
import javafx.collections.FXCollections;
import javafx.scene.layout.GridPane; import javafx.scene.layout.GridPane;
import static haveno.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; import static haveno.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon;
@ -44,6 +45,12 @@ public class WeChatPayForm extends GeneralAccountNumberForm {
this.weChatPayAccount = (WeChatPayAccount) paymentAccount; this.weChatPayAccount = (WeChatPayAccount) paymentAccount;
} }
@Override
public void addTradeCurrency() {
addTradeCurrencyComboBox();
currencyComboBox.setItems(FXCollections.observableArrayList(weChatPayAccount.getSupportedCurrencies()));
}
@Override @Override
void setAccountNumber(String newValue) { void setAccountNumber(String newValue) {
weChatPayAccount.setAccountNr(newValue); weChatPayAccount.setAccountNr(newValue);