Update Wise (TransferWise) account.

TransferWise has rebranded to Wise, rename user-facing parts.
Add HolderName (mandatory for new accounts).
This commit is contained in:
yonson2023 2023-12-11 10:58:00 -06:00
parent 5e0803a392
commit 01dc89edc5
No known key found for this signature in database
GPG Key ID: 653F31AF4087E2F2
5 changed files with 43 additions and 11 deletions

View File

@ -37,24 +37,34 @@ public final class TransferwiseAccount extends PaymentAccount {
new FiatCurrency("AED"),
new FiatCurrency("ARS"),
new FiatCurrency("AUD"),
new FiatCurrency("BDT"),
new FiatCurrency("BGN"),
new FiatCurrency("BRL"),
new FiatCurrency("BWP"),
new FiatCurrency("CAD"),
new FiatCurrency("CHF"),
new FiatCurrency("CLP"),
new FiatCurrency("CNY"),
new FiatCurrency("COP"),
new FiatCurrency("CRC"),
new FiatCurrency("CZK"),
new FiatCurrency("DKK"),
new FiatCurrency("EGP"),
new FiatCurrency("EUR"),
new FiatCurrency("FJD"),
new FiatCurrency("GBP"),
new FiatCurrency("GEL"),
new FiatCurrency("GHS"),
new FiatCurrency("HKD"),
new FiatCurrency("HRK"),
new FiatCurrency("HUF"),
new FiatCurrency("IDR"),
new FiatCurrency("ILS"),
new FiatCurrency("INR"),
new FiatCurrency("JPY"),
new FiatCurrency("KES"),
new FiatCurrency("KRW"),
new FiatCurrency("LKR"),
new FiatCurrency("MAD"),
new FiatCurrency("MXN"),
new FiatCurrency("MYR"),
@ -71,7 +81,9 @@ public final class TransferwiseAccount extends PaymentAccount {
new FiatCurrency("SGD"),
new FiatCurrency("THB"),
new FiatCurrency("TRY"),
new FiatCurrency("UAH"),
new FiatCurrency("UGX"),
new FiatCurrency("UYU"),
new FiatCurrency("VND"),
new FiatCurrency("XOF"),
new FiatCurrency("ZAR"),

View File

@ -136,6 +136,7 @@ public abstract class PaymentAccountPayload implements NetworkPayload, UsedForTr
}
public void setHolderName(String holderName) {
// an empty string must result in the mapping removing the entry.
excludeFromJsonDataMap.compute(HOLDER_NAME, (k, v) -> Strings.emptyToNull(holderName));
}

View File

@ -21,6 +21,8 @@ import bisq.core.locale.Res;
import com.google.protobuf.Message;
import org.apache.commons.lang3.ArrayUtils;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
@ -94,6 +96,10 @@ public final class TransferwiseAccountPayload extends PaymentAccountPayload {
@Override
public byte[] getAgeWitnessInputData() {
return super.getAgeWitnessInputData(email.getBytes(StandardCharsets.UTF_8));
// holderName will be included as part of the witness data.
// older accounts that don't have holderName still retain their existing witness.
return super.getAgeWitnessInputData(ArrayUtils.addAll(
email.getBytes(StandardCharsets.UTF_8),
getHolderName().getBytes(StandardCharsets.UTF_8)));
}
}

View File

@ -4166,14 +4166,14 @@ The maximum trade size is $1,000 per payment.\n\n\
If you trade over the above limits your trade might be cancelled and there could be a penalty.
payment.transferwiseUsd.info.account=Due US banking regulation, sending and receiving USD payments has more restrictions \
than most other currencies. For this reason USD was not added to Bisq TransferWise payment method.\n\n\
The TransferWise-USD payment method allows Bisq users to trade in USD.\n\n\
Anyone with a Wise, formally TransferWise account, can add TransferWise-USD as a payment method in Bisq. This will \
than most other currencies. For this reason USD was not added to Bisq Wise payment method.\n\n\
The Wise-USD payment method allows Bisq users to trade in USD.\n\n\
Anyone with a Wise account can add Wise-USD as a payment method in Bisq. This will \
allow them to buy and sell BTC with USD.\n\n\
When trading on Bisq BTC Buyers should not use any reference for reason for payment. If reason for payment is required \
they should only use the full name of the TransferWise-USD account owner.
payment.transferwiseUsd.info.buyer=Please send payment only to the email address in the BTC Seller's Bisq TransferWise-USD account.
payment.transferwiseUsd.info.seller=Please check that the payment received matches the BTC Buyer's name of the TransferWise-USD account in Bisq.
they should only use the full name of the Wise-USD account owner.
payment.transferwiseUsd.info.buyer=Please send payment only to the email address in the BTC Seller's Bisq Wise-USD account.
payment.transferwiseUsd.info.seller=Please check that the payment received matches the BTC Buyer's name of the Wise-USD account in Bisq.
payment.usPostalMoneyOrder.info=Trading using US Postal Money Orders (USPMO) on Bisq requires that you understand the following:\n\
\n\
@ -4339,9 +4339,9 @@ PROMPT_PAY=PromptPay
# suppress inspection "UnusedProperty"
ADVANCED_CASH=Advanced Cash
# suppress inspection "UnusedProperty"
TRANSFERWISE=TransferWise
TRANSFERWISE=Wise
# suppress inspection "UnusedProperty"
TRANSFERWISE_USD=TransferWise-USD
TRANSFERWISE_USD=Wise-USD
# suppress inspection "UnusedProperty"
PAYSERA=Paysera
# suppress inspection "UnusedProperty"
@ -4437,9 +4437,9 @@ PROMPT_PAY_SHORT=PromptPay
# suppress inspection "UnusedProperty"
ADVANCED_CASH_SHORT=Advanced Cash
# suppress inspection "UnusedProperty"
TRANSFERWISE_SHORT=TransferWise
TRANSFERWISE_SHORT=Wise
# suppress inspection "UnusedProperty"
TRANSFERWISE_USD_SHORT=TransferWise-USD
TRANSFERWISE_USD_SHORT=Wise-USD
# suppress inspection "UnusedProperty"
PAYSERA_SHORT=Paysera
# suppress inspection "UnusedProperty"

View File

@ -45,6 +45,8 @@ public class TransferwiseForm extends PaymentMethodForm {
PaymentAccountPayload paymentAccountPayload) {
addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.email"),
((TransferwiseAccountPayload) paymentAccountPayload).getEmail());
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"),
paymentAccountPayload.getHolderName());
return gridRow;
}
@ -67,6 +69,14 @@ public class TransferwiseForm extends PaymentMethodForm {
updateFromInputs();
});
InputTextField holderNameInputTextField = FormBuilder.addInputTextField(gridPane, ++gridRow,
Res.get("payment.account.owner"));
holderNameInputTextField.setValidator(inputValidator);
holderNameInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
account.setHolderName(newValue);
updateFromInputs();
});
addCurrenciesGrid(true);
addLimitations(false);
addAccountNameTextFieldWithAutoFillToggleButton();
@ -100,6 +110,8 @@ public class TransferwiseForm extends PaymentMethodForm {
TextField field = addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.email"),
account.getEmail()).second;
field.setMouseTransparent(false);
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"),
account.getHolderName());
addLimitations(true);
addCurrenciesGrid(false);
}
@ -108,6 +120,7 @@ public class TransferwiseForm extends PaymentMethodForm {
public void updateAllInputsValid() {
allInputsValid.set(isAccountNameValid()
&& validator.validate(account.getEmail()).isValid
&& inputValidator.validate(account.getHolderName()).isValid
&& account.getTradeCurrencies().size() > 0);
}
}