mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 01:41:11 +01:00
Merge pull request #7258 from cparke2/same-bank-blank-bic
Improve exception msg and handling when 'Same Bank' BIC/SWIFT blank
This commit is contained in:
commit
68f5625518
@ -30,6 +30,8 @@ import bisq.core.offer.bisq_v1.OfferPayload;
|
||||
import bisq.core.payment.CashByMailAccount;
|
||||
import bisq.core.payment.F2FAccount;
|
||||
import bisq.core.payment.PaymentAccount;
|
||||
import bisq.core.payment.SameBankAccount;
|
||||
import bisq.core.payment.SpecificBanksAccount;
|
||||
import bisq.core.payment.payload.PaymentMethod;
|
||||
import bisq.core.provider.fee.FeeService;
|
||||
import bisq.core.provider.price.MarketPrice;
|
||||
@ -60,6 +62,7 @@ import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
@ -389,7 +392,8 @@ public class OfferUtil {
|
||||
public void validateOfferData(double buyerSecurityDeposit,
|
||||
PaymentAccount paymentAccount,
|
||||
String currencyCode,
|
||||
Coin makerFeeAsCoin) {
|
||||
Coin makerFeeAsCoin,
|
||||
List<String> acceptedBanks) {
|
||||
validateBasicOfferData(paymentAccount.getPaymentMethod(), currencyCode);
|
||||
checkNotNull(makerFeeAsCoin, "makerFee must not be null");
|
||||
checkArgument(buyerSecurityDeposit <= getMaxBuyerSecurityDepositAsPercent(),
|
||||
@ -398,6 +402,9 @@ public class OfferUtil {
|
||||
checkArgument(buyerSecurityDeposit >= getMinBuyerSecurityDepositAsPercent(),
|
||||
"securityDeposit must not be less than " +
|
||||
getMinBuyerSecurityDepositAsPercent());
|
||||
if ((paymentAccount instanceof SameBankAccount) || (paymentAccount instanceof SpecificBanksAccount) ) {
|
||||
checkArgument(!acceptedBanks.contains(null), "acceptedBanks must not be null for SAME_BANK or SPECIFIC_BANKS accounts");
|
||||
}
|
||||
}
|
||||
|
||||
public void validateBasicOfferData(PaymentMethod paymentMethod, String currencyCode) {
|
||||
|
@ -177,7 +177,8 @@ public class CreateOfferService {
|
||||
buyerSecurityDepositAsDouble,
|
||||
paymentAccount,
|
||||
currencyCode,
|
||||
makerFeeAsCoin);
|
||||
makerFeeAsCoin,
|
||||
acceptedBanks);
|
||||
|
||||
OfferPayload offerPayload = new OfferPayload(offerId,
|
||||
creationTime,
|
||||
|
Loading…
Reference in New Issue
Block a user