mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 01:41:11 +01:00
Restore proto order and add backward compatibility
This commit is contained in:
parent
2809e8d768
commit
8dfe2601df
@ -19,6 +19,8 @@ package bisq.core.payment.payload;
|
||||
|
||||
import bisq.core.locale.Res;
|
||||
|
||||
import bisq.common.util.JsonExclude;
|
||||
|
||||
import com.google.protobuf.Message;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
@ -39,6 +41,9 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
public final class UpholdAccountPayload extends PaymentAccountPayload {
|
||||
private String accountId = "";
|
||||
|
||||
// For backward compatibility we need to exclude the new field from the contract json.
|
||||
@JsonExclude
|
||||
private String accountOwner = "";
|
||||
|
||||
public UpholdAccountPayload(String paymentMethod, String id) {
|
||||
@ -95,9 +100,15 @@ public final class UpholdAccountPayload extends PaymentAccountPayload {
|
||||
|
||||
@Override
|
||||
public String getPaymentDetailsForTradePopup() {
|
||||
return
|
||||
Res.get("payment.account") + ": " + accountId + "\n" +
|
||||
Res.get("payment.account.owner") + ": " + accountOwner;
|
||||
if (accountOwner != "") {
|
||||
return
|
||||
Res.get("payment.account") + ": " + accountId + "\n" +
|
||||
Res.get("payment.account.owner") + ": " + accountOwner;
|
||||
} else {
|
||||
return
|
||||
Res.get("payment.account") + ": " + accountId + "\n" +
|
||||
Res.get("payment.account.owner") + ": N/A";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -47,10 +47,16 @@ public class UpholdForm extends PaymentMethodForm {
|
||||
|
||||
public static int addFormForBuyer(GridPane gridPane, int gridRow,
|
||||
PaymentAccountPayload paymentAccountPayload) {
|
||||
String accountOwner = ((UpholdAccountPayload) paymentAccountPayload).getAccountOwner();
|
||||
if (accountOwner.isEmpty()) {
|
||||
accountOwner = Res.get("payment.ask");
|
||||
}
|
||||
addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.account.owner"),
|
||||
((UpholdAccountPayload) paymentAccountPayload).getAccountOwner());
|
||||
accountOwner);
|
||||
|
||||
addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.uphold.accountId"),
|
||||
((UpholdAccountPayload) paymentAccountPayload).getAccountId());
|
||||
|
||||
return gridRow;
|
||||
}
|
||||
|
||||
|
@ -1132,8 +1132,8 @@ message OKPayAccountPayload {
|
||||
}
|
||||
|
||||
message UpholdAccountPayload {
|
||||
string account_owner = 1;
|
||||
string account_id = 2;
|
||||
string account_id = 1;
|
||||
string account_owner = 2;
|
||||
}
|
||||
|
||||
// Deprecated, not used anymore
|
||||
|
Loading…
Reference in New Issue
Block a user