mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-23 23:06:39 +01:00
Fix text. Improve logging. Add check for BankAccount
This commit is contained in:
parent
1a3bdf0f71
commit
2583ddf044
4 changed files with 15 additions and 12 deletions
|
@ -1632,7 +1632,7 @@ to get in contact with the {1} buyer by using the provided email address or mobi
|
||||||
is really the owner of the Zelle (ClearXchange) account.
|
is really the owner of the Zelle (ClearXchange) account.
|
||||||
|
|
||||||
payment.westernUnion.info=When using Western Union the BTC buyer has to send the MTCN (tracking number) and a photo of the receipt by email to the BTC seller. \
|
payment.westernUnion.info=When using Western Union the BTC buyer has to send the MTCN (tracking number) and a photo of the receipt by email to the BTC seller. \
|
||||||
The receipt must clearly show the seller's full name, city, country and the amount. The buyer will get displayed the seller's email in the trade process.
|
The receipt must clearly show the seller''s full name, city, country and the amount. The buyer will get displayed the seller''s email in the trade process.
|
||||||
|
|
||||||
# We use constants from the code so we do not use our normal naming convention
|
# We use constants from the code so we do not use our normal naming convention
|
||||||
# dynamic values are not recognized by IntelliJ
|
# dynamic values are not recognized by IntelliJ
|
||||||
|
|
|
@ -66,8 +66,8 @@ public class PaymentAccountUtil {
|
||||||
|
|
||||||
if (paymentAccount instanceof SepaAccount || offer.getPaymentMethod().equals(PaymentMethod.SEPA)) {
|
if (paymentAccount instanceof SepaAccount || offer.getPaymentMethod().equals(PaymentMethod.SEPA)) {
|
||||||
return arePaymentMethodsEqual;
|
return arePaymentMethodsEqual;
|
||||||
} else if (offer.getPaymentMethod().equals(PaymentMethod.SAME_BANK) ||
|
} else if (paymentAccount instanceof BankAccount && (offer.getPaymentMethod().equals(PaymentMethod.SAME_BANK) ||
|
||||||
offer.getPaymentMethod().equals(PaymentMethod.SPECIFIC_BANKS)) {
|
offer.getPaymentMethod().equals(PaymentMethod.SPECIFIC_BANKS))) {
|
||||||
|
|
||||||
final List<String> acceptedBankIds = offer.getAcceptedBankIds();
|
final List<String> acceptedBankIds = offer.getAcceptedBankIds();
|
||||||
checkNotNull(acceptedBankIds, "offer.getAcceptedBankIds() must not be null");
|
checkNotNull(acceptedBankIds, "offer.getAcceptedBankIds() must not be null");
|
||||||
|
@ -82,6 +82,7 @@ public class PaymentAccountUtil {
|
||||||
return bankId != null && acceptedBankIds.contains(bankId);
|
return bankId != null && acceptedBankIds.contains(bankId);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
//TODO check if that case can be reached
|
||||||
if (paymentAccount instanceof SpecificBanksAccount) {
|
if (paymentAccount instanceof SpecificBanksAccount) {
|
||||||
// check if we have a matching bank
|
// check if we have a matching bank
|
||||||
final ArrayList<String> acceptedBanks = ((SpecificBanksAccount) paymentAccount).getAcceptedBanks();
|
final ArrayList<String> acceptedBanks = ((SpecificBanksAccount) paymentAccount).getAcceptedBanks();
|
||||||
|
@ -95,7 +96,6 @@ public class PaymentAccountUtil {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return arePaymentMethodsEqual;
|
return arePaymentMethodsEqual;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,8 @@ public class CoreProtoResolver implements ProtoResolver {
|
||||||
@Override
|
@Override
|
||||||
public PaymentAccountPayload fromProto(PB.PaymentAccountPayload proto) {
|
public PaymentAccountPayload fromProto(PB.PaymentAccountPayload proto) {
|
||||||
if (proto != null) {
|
if (proto != null) {
|
||||||
switch (proto.getMessageCase()) {
|
final PB.PaymentAccountPayload.MessageCase messageCase = proto.getMessageCase();
|
||||||
|
switch (messageCase) {
|
||||||
case ALI_PAY_ACCOUNT_PAYLOAD:
|
case ALI_PAY_ACCOUNT_PAYLOAD:
|
||||||
return AliPayAccountPayload.fromProto(proto);
|
return AliPayAccountPayload.fromProto(proto);
|
||||||
case CHASE_QUICK_PAY_ACCOUNT_PAYLOAD:
|
case CHASE_QUICK_PAY_ACCOUNT_PAYLOAD:
|
||||||
|
@ -21,9 +22,11 @@ public class CoreProtoResolver implements ProtoResolver {
|
||||||
case CLEAR_XCHANGE_ACCOUNT_PAYLOAD:
|
case CLEAR_XCHANGE_ACCOUNT_PAYLOAD:
|
||||||
return ClearXchangeAccountPayload.fromProto(proto);
|
return ClearXchangeAccountPayload.fromProto(proto);
|
||||||
case COUNTRY_BASED_PAYMENT_ACCOUNT_PAYLOAD:
|
case COUNTRY_BASED_PAYMENT_ACCOUNT_PAYLOAD:
|
||||||
switch (proto.getCountryBasedPaymentAccountPayload().getMessageCase()) {
|
final PB.CountryBasedPaymentAccountPayload.MessageCase messageCaseCountry = proto.getCountryBasedPaymentAccountPayload().getMessageCase();
|
||||||
|
switch (messageCaseCountry) {
|
||||||
case BANK_ACCOUNT_PAYLOAD:
|
case BANK_ACCOUNT_PAYLOAD:
|
||||||
switch (proto.getCountryBasedPaymentAccountPayload().getBankAccountPayload().getMessageCase()) {
|
final PB.BankAccountPayload.MessageCase messageCaseBank = proto.getCountryBasedPaymentAccountPayload().getBankAccountPayload().getMessageCase();
|
||||||
|
switch (messageCaseBank) {
|
||||||
case NATIONAL_BANK_ACCOUNT_PAYLOAD:
|
case NATIONAL_BANK_ACCOUNT_PAYLOAD:
|
||||||
return NationalBankAccountPayload.fromProto(proto);
|
return NationalBankAccountPayload.fromProto(proto);
|
||||||
case SAME_BANK_ACCONT_PAYLOAD:
|
case SAME_BANK_ACCONT_PAYLOAD:
|
||||||
|
@ -33,7 +36,7 @@ public class CoreProtoResolver implements ProtoResolver {
|
||||||
default:
|
default:
|
||||||
throw new ProtobufferException("Unknown proto message case" +
|
throw new ProtobufferException("Unknown proto message case" +
|
||||||
"(PB.PaymentAccountPayload.CountryBasedPaymentAccountPayload.BankAccountPayload). " +
|
"(PB.PaymentAccountPayload.CountryBasedPaymentAccountPayload.BankAccountPayload). " +
|
||||||
"messageCase=" + proto.getMessageCase());
|
"messageCase=" + messageCaseBank);
|
||||||
}
|
}
|
||||||
case WESTERN_UNION_ACCOUNT_PAYLOAD:
|
case WESTERN_UNION_ACCOUNT_PAYLOAD:
|
||||||
return WesternUnionAccountPayload.fromProto(proto);
|
return WesternUnionAccountPayload.fromProto(proto);
|
||||||
|
@ -44,7 +47,7 @@ public class CoreProtoResolver implements ProtoResolver {
|
||||||
default:
|
default:
|
||||||
throw new ProtobufferException("Unknown proto message case" +
|
throw new ProtobufferException("Unknown proto message case" +
|
||||||
"(PB.PaymentAccountPayload.CountryBasedPaymentAccountPayload)." +
|
"(PB.PaymentAccountPayload.CountryBasedPaymentAccountPayload)." +
|
||||||
" messageCase=" + proto.getMessageCase());
|
" messageCase=" + messageCaseCountry);
|
||||||
}
|
}
|
||||||
case CRYPTO_CURRENCY_ACCOUNT_PAYLOAD:
|
case CRYPTO_CURRENCY_ACCOUNT_PAYLOAD:
|
||||||
return CryptoCurrencyAccountPayload.fromProto(proto);
|
return CryptoCurrencyAccountPayload.fromProto(proto);
|
||||||
|
@ -61,7 +64,7 @@ public class CoreProtoResolver implements ProtoResolver {
|
||||||
case U_S_POSTAL_MONEY_ORDER_ACCOUNT_PAYLOAD:
|
case U_S_POSTAL_MONEY_ORDER_ACCOUNT_PAYLOAD:
|
||||||
return USPostalMoneyOrderAccountPayload.fromProto(proto);
|
return USPostalMoneyOrderAccountPayload.fromProto(proto);
|
||||||
default:
|
default:
|
||||||
throw new ProtobufferException("Unknown proto message case(PB.PaymentAccountPayload). messageCase=" + proto.getMessageCase());
|
throw new ProtobufferException("Unknown proto message case(PB.PaymentAccountPayload). messageCase=" + messageCase);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.error("PersistableEnvelope.fromProto: PB.PaymentAccountPayload is null");
|
log.error("PersistableEnvelope.fromProto: PB.PaymentAccountPayload is null");
|
||||||
|
|
|
@ -196,8 +196,8 @@ class CreateOfferViewModel extends ActivatableWithDataModel<CreateOfferDataModel
|
||||||
UserThread.runAfter(() -> {
|
UserThread.runAfter(() -> {
|
||||||
switch (BisqEnvironment.getBaseCurrencyNetwork().getCurrencyCode()) {
|
switch (BisqEnvironment.getBaseCurrencyNetwork().getCurrencyCode()) {
|
||||||
case "BTC":
|
case "BTC":
|
||||||
amount.set("0.125");
|
amount.set("0.0001");
|
||||||
price.set("7400");
|
price.set("6000");
|
||||||
break;
|
break;
|
||||||
case "LTC":
|
case "LTC":
|
||||||
amount.set("50");
|
amount.set("50");
|
||||||
|
|
Loading…
Add table
Reference in a new issue