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)
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() {
super(PaymentMethod.WECHAT_PAY);
setSingleTradeCurrency(SUPPORTED_CURRENCIES.get(0));
}
@Override

View File

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