mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 15:10:44 +01:00
Do single trade currency check in api generated payment acct
This commit is contained in:
parent
e00cc86fea
commit
19e9c78f51
1 changed files with 5 additions and 2 deletions
|
@ -138,9 +138,12 @@ class CorePaymentAccountsService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void verifyPaymentAccountHasRequiredFields(PaymentAccount paymentAccount) {
|
private void verifyPaymentAccountHasRequiredFields(PaymentAccount paymentAccount) {
|
||||||
// Do checks here to make sure required fields are populated.
|
if (paymentAccount.canSupportMultipleCurrencies() && paymentAccount.getTradeCurrencies().isEmpty())
|
||||||
if (paymentAccount.isTransferwiseAccount() && paymentAccount.getTradeCurrencies().isEmpty())
|
|
||||||
throw new IllegalArgumentException(format("no trade currencies defined for %s payment account",
|
throw new IllegalArgumentException(format("no trade currencies defined for %s payment account",
|
||||||
paymentAccount.getPaymentMethod().getDisplayString().toLowerCase()));
|
paymentAccount.getPaymentMethod().getDisplayString().toLowerCase()));
|
||||||
|
|
||||||
|
if (!paymentAccount.canSupportMultipleCurrencies() && paymentAccount.getSingleTradeCurrency() == null)
|
||||||
|
throw new IllegalArgumentException(format("no trade currency defined for %s payment account",
|
||||||
|
paymentAccount.getPaymentMethod().getDisplayString().toLowerCase()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue