Add payment methods Strike and Verse

This commit is contained in:
jmacxx 2021-10-12 14:37:26 -05:00
parent e5d73e90a7
commit b72b70ee8c
No known key found for this signature in database
GPG key ID: 155297BABFE94A1B
15 changed files with 617 additions and 1 deletions

View file

@ -445,6 +445,17 @@ public class CurrencyUtil {
));
}
// https://github.com/bisq-network/growth/issues/223
public static List<TradeCurrency> getAllVerseCurrencies() {
return new ArrayList<>(Arrays.asList(
new FiatCurrency("DKK"),
new FiatCurrency("EUR"),
new FiatCurrency("HUF"),
new FiatCurrency("PLN"),
new FiatCurrency("SEK")
));
}
// https://www.revolut.com/help/getting-started/exchanging-currencies/what-fiat-currencies-are-supported-for-holding-and-exchange
public static List<TradeCurrency> getAllRevolutCurrencies() {
ArrayList<TradeCurrency> currencies = new ArrayList<>(Arrays.asList(

View file

@ -114,6 +114,10 @@ public class PaymentAccountFactory {
return new MoneseAccount();
case PaymentMethod.SATISPAY_ID:
return new SatispayAccount();
case PaymentMethod.VERSE_ID:
return new VerseAccount();
case PaymentMethod.STRIKE_ID:
return new StrikeAccount();
case PaymentMethod.SWIFT_ID:
return new SwiftAccount();

View file

@ -0,0 +1,56 @@
/*
* This file is part of Bisq.
*
* Bisq is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version.
*
* Bisq is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
* License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.core.payment;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.payment.payload.PaymentMethod;
import bisq.core.payment.payload.StrikeAccountPayload;
import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
public final class StrikeAccount extends CountryBasedPaymentAccount {
public StrikeAccount() {
super(PaymentMethod.STRIKE);
}
@Override
protected PaymentAccountPayload createPayload() {
return new StrikeAccountPayload(paymentMethod.getId(), id);
}
public void setHolderName(String accountId) {
((StrikeAccountPayload) paymentAccountPayload).setHolderName(accountId);
}
public String getHolderName() {
return ((StrikeAccountPayload) paymentAccountPayload).getHolderName();
}
public String getMessageForBuyer() {
return "payment.strike.info.buyer";
}
public String getMessageForSeller() {
return "payment.strike.info.seller";
}
public String getMessageForAccountCreation() {
return "payment.strike.info.account";
}
}

View file

@ -0,0 +1,56 @@
/*
* This file is part of Bisq.
*
* Bisq is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version.
*
* Bisq is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
* License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.core.payment;
import bisq.core.payment.payload.VerseAccountPayload;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.payment.payload.PaymentMethod;
import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
public final class VerseAccount extends PaymentAccount {
public VerseAccount() {
super(PaymentMethod.VERSE);
}
@Override
protected PaymentAccountPayload createPayload() {
return new VerseAccountPayload(paymentMethod.getId(), id);
}
public void setHolderName(String accountId) {
((VerseAccountPayload) paymentAccountPayload).setHolderName(accountId);
}
public String getHolderName() {
return ((VerseAccountPayload) paymentAccountPayload).getHolderName();
}
public String getMessageForBuyer() {
return "payment.verse.info.buyer";
}
public String getMessageForSeller() {
return "payment.verse.info.seller";
}
public String getMessageForAccountCreation() {
return "payment.verse.info.account";
}
}

View file

@ -113,6 +113,8 @@ public final class PaymentMethod implements PersistablePayload, Comparable<Payme
public static final String CELPAY_ID = "CELPAY";
public static final String MONESE_ID = "MONESE";
public static final String SATISPAY_ID = "SATISPAY";
public static final String VERSE_ID = "VERSE";
public static final String STRIKE_ID = "STRIKE";
public static final String SWIFT_ID = "SWIFT";
// Cannot be deleted as it would break old trade history entries
@ -169,6 +171,8 @@ public final class PaymentMethod implements PersistablePayload, Comparable<Payme
public static PaymentMethod CELPAY;
public static PaymentMethod MONESE;
public static PaymentMethod SATISPAY;
public static PaymentMethod VERSE;
public static PaymentMethod STRIKE;
public static PaymentMethod SWIFT;
// Cannot be deleted as it would break old trade history entries
@ -235,6 +239,8 @@ public final class PaymentMethod implements PersistablePayload, Comparable<Payme
CELPAY = new PaymentMethod(CELPAY_ID, DAY, DEFAULT_TRADE_LIMIT_HIGH_RISK),
MONESE = new PaymentMethod(MONESE_ID, DAY, DEFAULT_TRADE_LIMIT_HIGH_RISK),
SATISPAY = new PaymentMethod(SATISPAY_ID, DAY, DEFAULT_TRADE_LIMIT_HIGH_RISK),
VERSE = new PaymentMethod(VERSE_ID, DAY, DEFAULT_TRADE_LIMIT_HIGH_RISK),
STRIKE = new PaymentMethod(STRIKE_ID, DAY, DEFAULT_TRADE_LIMIT_HIGH_RISK),
SWIFT = new PaymentMethod(SWIFT_ID, 7 * DAY, DEFAULT_TRADE_LIMIT_MID_RISK),
// Japan

View file

@ -0,0 +1,99 @@
/*
* This file is part of Bisq.
*
* Bisq is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version.
*
* Bisq is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
* License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.core.payment.payload;
import bisq.core.locale.Res;
import com.google.protobuf.Message;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;
@EqualsAndHashCode(callSuper = true)
@ToString
@Setter
@Getter
@Slf4j
public final class StrikeAccountPayload extends CountryBasedPaymentAccountPayload {
private String holderName = "";
public StrikeAccountPayload(String paymentMethod, String id) {
super(paymentMethod, id);
}
private StrikeAccountPayload(String paymentMethod,
String id,
String countryCode,
String holderName,
long maxTradePeriod,
Map<String, String> excludeFromJsonDataMap) {
super(paymentMethod,
id,
countryCode,
maxTradePeriod,
excludeFromJsonDataMap);
this.holderName = holderName;
}
@Override
public Message toProtoMessage() {
protobuf.StrikeAccountPayload.Builder builder = protobuf.StrikeAccountPayload.newBuilder()
.setHolderName(holderName);
final protobuf.CountryBasedPaymentAccountPayload.Builder countryBasedPaymentAccountPayload = getPaymentAccountPayloadBuilder()
.getCountryBasedPaymentAccountPayloadBuilder()
.setStrikeAccountPayload(builder);
return getPaymentAccountPayloadBuilder()
.setCountryBasedPaymentAccountPayload(countryBasedPaymentAccountPayload)
.build();
}
public static StrikeAccountPayload fromProto(protobuf.PaymentAccountPayload proto) {
protobuf.CountryBasedPaymentAccountPayload countryBasedPaymentAccountPayload = proto.getCountryBasedPaymentAccountPayload();
protobuf.StrikeAccountPayload accountPayloadPB = countryBasedPaymentAccountPayload.getStrikeAccountPayload();
return new StrikeAccountPayload(proto.getPaymentMethodId(),
proto.getId(),
countryBasedPaymentAccountPayload.getCountryCode(),
accountPayloadPB.getHolderName(),
proto.getMaxTradePeriod(),
new HashMap<>(proto.getExcludeFromJsonDataMap()));
}
@Override
public String getPaymentDetails() {
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.userName") + " " + holderName;
}
@Override
public String getPaymentDetailsForTradePopup() {
return getPaymentDetails();
}
@Override
public byte[] getAgeWitnessInputData() {
return super.getAgeWitnessInputData(holderName.getBytes(StandardCharsets.UTF_8));
}
}

View file

@ -0,0 +1,89 @@
/*
* This file is part of Bisq.
*
* Bisq is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version.
*
* Bisq is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
* License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.core.payment.payload;
import bisq.core.locale.Res;
import com.google.protobuf.Message;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;
@EqualsAndHashCode(callSuper = true)
@ToString
@Setter
@Getter
@Slf4j
public final class VerseAccountPayload extends PaymentAccountPayload {
private String holderName = "";
public VerseAccountPayload(String paymentMethod, String id) {
super(paymentMethod, id);
}
private VerseAccountPayload(String paymentMethod,
String id,
String holderName,
long maxTradePeriod,
Map<String, String> excludeFromJsonDataMap) {
super(paymentMethod,
id,
maxTradePeriod,
excludeFromJsonDataMap);
this.holderName = holderName;
}
@Override
public Message toProtoMessage() {
return getPaymentAccountPayloadBuilder()
.setVerseAccountPayload(protobuf.VerseAccountPayload.newBuilder().setHolderName(holderName))
.build();
}
public static VerseAccountPayload fromProto(protobuf.PaymentAccountPayload proto) {
return new VerseAccountPayload(proto.getPaymentMethodId(),
proto.getId(),
proto.getVerseAccountPayload().getHolderName(),
proto.getMaxTradePeriod(),
new HashMap<>(proto.getExcludeFromJsonDataMap()));
}
@Override
public String getPaymentDetails() {
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.userName") + " " + holderName;
}
@Override
public String getPaymentDetailsForTradePopup() {
return getPaymentDetails();
}
@Override
public byte[] getAgeWitnessInputData() {
return super.getAgeWitnessInputData(holderName.getBytes(StandardCharsets.UTF_8));
}
}

View file

@ -63,6 +63,7 @@ import bisq.core.payment.payload.SatispayAccountPayload;
import bisq.core.payment.payload.SepaAccountPayload;
import bisq.core.payment.payload.SepaInstantAccountPayload;
import bisq.core.payment.payload.SpecificBanksAccountPayload;
import bisq.core.payment.payload.StrikeAccountPayload;
import bisq.core.payment.payload.SwiftAccountPayload;
import bisq.core.payment.payload.SwishAccountPayload;
import bisq.core.payment.payload.TransferwiseAccountPayload;
@ -70,6 +71,7 @@ import bisq.core.payment.payload.USPostalMoneyOrderAccountPayload;
import bisq.core.payment.payload.UpholdAccountPayload;
import bisq.core.payment.payload.UpiAccountPayload;
import bisq.core.payment.payload.VenmoAccountPayload;
import bisq.core.payment.payload.VerseAccountPayload;
import bisq.core.payment.payload.WeChatPayAccountPayload;
import bisq.core.payment.payload.WesternUnionAccountPayload;
import bisq.core.trade.statistics.TradeStatistics2;
@ -141,6 +143,8 @@ public class CoreProtoResolver implements ProtoResolver {
return PixAccountPayload.fromProto(proto);
case SATISPAY_ACCOUNT_PAYLOAD:
return SatispayAccountPayload.fromProto(proto);
case STRIKE_ACCOUNT_PAYLOAD:
return StrikeAccountPayload.fromProto(proto);
case IFSC_BASED_ACCOUNT_PAYLOAD:
final protobuf.IfscBasedAccountPayload.MessageCase messageCaseIfsc = proto.getCountryBasedPaymentAccountPayload().getIfscBasedAccountPayload().getMessageCase();
switch (messageCaseIfsc) {
@ -210,6 +214,8 @@ public class CoreProtoResolver implements ProtoResolver {
return CelPayAccountPayload.fromProto(proto);
case MONESE_ACCOUNT_PAYLOAD:
return MoneseAccountPayload.fromProto(proto);
case VERSE_ACCOUNT_PAYLOAD:
return VerseAccountPayload.fromProto(proto);
case SWIFT_ACCOUNT_PAYLOAD:
return SwiftAccountPayload.fromProto(proto);

View file

@ -167,7 +167,9 @@ public final class TradeStatistics3 implements ProcessOncePersistableNetworkPayl
BIZUM,
PIX,
MONESE,
SATISPAY
SATISPAY,
VERSE,
STRIKE
}
@Getter

View file

@ -3628,6 +3628,39 @@ Satispay account limits are individually set. If you want to trade increased amo
support to increase your limits. Traders on Bisq should be aware of their limits. If you trade over the above limits \
your trade might be cancelled and there could be a penalty.
payment.verse.info.account=Verse is a multiple currency payment method that can send and receive payment in EUR, SEK, HUF, DKK, PLN.\n\n\
When setting up your Verse account in Bisq please make sure to include the username that matches your username in your \
Verse account. This will ensure that when you send funds they show from the correct account and when you receive \
funds they will be credited to your account.\n\n\
Verse users are limited to sending or receiving €10,000 per year (or equivalent foreign currency amount) for \
accumulated payments made from or received into their payment account. This can be increased by Verse on request.
payment.verse.info.buyer=Please send payment only to the username provided by the BTC Seller in their Bisq account. \
Please leave the payment description blank.\n\n\
Verse users are limited to sending or receiving €10,000 per year (or equivalent foreign currency amount) for \
accumulated payments made from or received into their payment account. This can be increased by Verse on request.
payment.verse.info.seller=BTC Sellers should expect to receive payment from the username shown in the BTC Buyer's Bisq account.\n\n\
Verse users are limited to sending or receiving €10,000 per year (or equivalent foreign currency amount) for \
accumulated payments made from or received into their payment account. This can be increased by Verse on request.
payment.strike.info.account=Please make sure to include your Strike username.\n\n\
In Bisq, Strike is used for fiat to fiat payments only.\n\n\
Please make sure you are aware of the Strike limits:\n\n\
Users who have registered with only their email, name, and phone number have the following limits:\n\n\
$100 maximum per deposit\n\
$1,000 maximum total deposits per week\n\
$100 maximum per payment\n\n\
Users can increase their limits by providing Strike more information have the following limits:\n\n\
$1,000 maximum per deposit\n\
$1,000 maximum total deposits per week\n\
$1,000 maximum per payment\n\n\
If you trade over the above limits your trade might be cancelled and there could be a penalty.
payment.strike.info.buyer=Please send payment only to the BTC Seller's Strike username as provided in Bisq.\n\n\
The maximum trade size is $1,000 maximum per payment.\n\n\
If you trade over the above limits your trade might be cancelled and there could be a penalty.
payment.strike.info.seller=Please make sure your payment is received from the BTC Buyer's Strike username as provided in Bisq.\n\n\
The maximum trade size is $1,000 maximum per payment.\n\n\
If you trade over the above limits your trade might be cancelled and there could be a penalty.
payment.usPostalMoneyOrder.info=Trading using US Postal Money Orders (USPMO) on Bisq requires that you understand the following:\n\
\n\
- BTC buyers must write the BTC Sellers name in both the Payer and the Payees fields & take a high-resolution photo of the USPMO and envelope with proof of tracking before sending.\n\
@ -3822,6 +3855,10 @@ MONESE=Monese
# suppress inspection "UnusedProperty"
SATISPAY=Satispay
# suppress inspection "UnusedProperty"
VERSE=Verse
# suppress inspection "UnusedProperty"
STRIKE=Strike
# suppress inspection "UnusedProperty"
SWIFT=SWIFT International Wire Transfer
# Deprecated: Cannot be deleted as it would break old trade history entries
@ -3904,6 +3941,10 @@ MONESE_SHORT=Monese
# suppress inspection "UnusedProperty"
SATISPAY_SHORT=Satispay
# suppress inspection "UnusedProperty"
VERSE_SHORT=Verse
# suppress inspection "UnusedProperty"
STRIKE_SHORT=Strike
# suppress inspection "UnusedProperty"
SWIFT_SHORT=SWIFT
# Deprecated: Cannot be deleted as it would break old trade history entries

View file

@ -0,0 +1,106 @@
/*
* This file is part of Bisq.
*
* Bisq is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version.
*
* Bisq is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
* License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.desktop.components.paymentmethods;
import bisq.desktop.components.InputTextField;
import bisq.desktop.util.FormBuilder;
import bisq.desktop.util.Layout;
import bisq.core.account.witness.AccountAgeWitnessService;
import bisq.core.locale.CountryUtil;
import bisq.core.locale.FiatCurrency;
import bisq.core.locale.Res;
import bisq.core.payment.PaymentAccount;
import bisq.core.payment.StrikeAccount;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.payment.payload.StrikeAccountPayload;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import javafx.scene.control.TextField;
import javafx.scene.layout.GridPane;
import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextField;
import static bisq.desktop.util.FormBuilder.addTopLabelTextField;
import static bisq.desktop.util.FormBuilder.addTopLabelTextFieldWithCopyIcon;
public class StrikeForm extends PaymentMethodForm {
private final StrikeAccount account;
private InputTextField holderNameField;
public static int addFormForBuyer(GridPane gridPane, int gridRow,
PaymentAccountPayload paymentAccountPayload) {
addTopLabelTextFieldWithCopyIcon(gridPane, gridRow, 1, Res.get("payment.account.userName"),
((StrikeAccountPayload) paymentAccountPayload).getHolderName(), Layout.COMPACT_FIRST_ROW_AND_GROUP_DISTANCE);
return gridRow;
}
public StrikeForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService,
InputValidator inputValidator, GridPane gridPane,
int gridRow, CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
this.account = (StrikeAccount) paymentAccount;
}
@Override
public void addFormForAddAccount() {
// this payment method is currently restricted to United States/USD
account.setSingleTradeCurrency(new FiatCurrency("USD"));
CountryUtil.findCountryByCode("US").ifPresent(c -> account.setCountry(c));
gridRowFrom = gridRow + 1;
holderNameField = FormBuilder.addInputTextField(gridPane, ++gridRow, Res.get("payment.account.userName"));
holderNameField.setValidator(inputValidator);
holderNameField.textProperty().addListener((ov, oldValue, newValue) -> {
account.setHolderName(newValue.trim());
updateFromInputs();
});
addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), account.getSingleTradeCurrency().getNameAndCode());
addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.country"), account.getCountry().name);
addLimitations(false);
addAccountNameTextFieldWithAutoFillToggleButton();
}
@Override
protected void autoFillNameTextField() {
setAccountNameWithString(holderNameField.getText());
}
@Override
public void addFormForDisplayAccount() {
gridRowFrom = gridRow;
addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"),
account.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"),
Res.get(account.getPaymentMethod().getId()));
TextField field = addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.userName"),
account.getHolderName()).second;
field.setMouseTransparent(false);
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), account.getSingleTradeCurrency().getNameAndCode());
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.country"), account.getCountry().name);
addLimitations(true);
}
@Override
public void updateAllInputsValid() {
allInputsValid.set(isAccountNameValid()
&& inputValidator.validate(account.getHolderName()).isValid);
}
}

View file

@ -0,0 +1,116 @@
/*
* This file is part of Bisq.
*
* Bisq is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version.
*
* Bisq is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
* License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.desktop.components.paymentmethods;
import bisq.desktop.components.InputTextField;
import bisq.desktop.util.FormBuilder;
import bisq.desktop.util.Layout;
import bisq.core.account.witness.AccountAgeWitnessService;
import bisq.core.locale.CurrencyUtil;
import bisq.core.locale.Res;
import bisq.core.payment.PaymentAccount;
import bisq.core.payment.VerseAccount;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.payment.payload.VerseAccountPayload;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import javafx.scene.control.TextField;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.GridPane;
import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextField;
import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon;
import static bisq.desktop.util.FormBuilder.addTopLabelTextField;
public class VerseForm extends PaymentMethodForm {
private final VerseAccount account;
private InputTextField holderNameInputTextField;
public static int addFormForBuyer(GridPane gridPane, int gridRow,
PaymentAccountPayload paymentAccountPayload) {
addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.account.userName"),
((VerseAccountPayload) paymentAccountPayload).getHolderName());
return gridRow;
}
public VerseForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService,
InputValidator inputValidator, GridPane gridPane,
int gridRow, CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
this.account = (VerseAccount) paymentAccount;
}
@Override
public void addFormForAddAccount() {
gridRowFrom = gridRow + 1;
holderNameInputTextField = FormBuilder.addInputTextField(gridPane, ++gridRow, Res.get("payment.account.userName"));
holderNameInputTextField.setValidator(inputValidator);
holderNameInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
account.setHolderName(newValue.trim());
updateFromInputs();
});
addCurrenciesGrid(true);
addLimitations(false);
addAccountNameTextFieldWithAutoFillToggleButton();
}
private void addCurrenciesGrid(boolean isEditable) {
FlowPane flowPane = FormBuilder.addTopLabelFlowPane(gridPane, ++gridRow,
Res.get("payment.supportedCurrencies"), 20, 20).second;
if (isEditable) {
flowPane.setId("flow-pane-checkboxes-bg");
} else {
flowPane.setId("flow-pane-checkboxes-non-editable-bg");
}
CurrencyUtil.getAllVerseCurrencies().forEach(currency ->
fillUpFlowPaneWithCurrencies(isEditable, flowPane, currency, account));
}
@Override
protected void autoFillNameTextField() {
setAccountNameWithString(holderNameInputTextField.getText());
}
@Override
public void addFormForDisplayAccount() {
gridRowFrom = gridRow;
addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"),
account.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"),
Res.get(account.getPaymentMethod().getId()));
TextField field = addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.userName"),
account.getHolderName()).second;
field.setMouseTransparent(false);
addLimitations(true);
addCurrenciesGrid(false);
}
@Override
public void updateAllInputsValid() {
allInputsValid.set(isAccountNameValid()
&& account.getHolderName() != null
&& inputValidator.validate(account.getHolderName()).isValid
&& account.getTradeCurrencies().size() > 0);
}
}

View file

@ -55,6 +55,7 @@ import bisq.desktop.components.paymentmethods.SatispayForm;
import bisq.desktop.components.paymentmethods.SepaForm;
import bisq.desktop.components.paymentmethods.SepaInstantForm;
import bisq.desktop.components.paymentmethods.SpecificBankForm;
import bisq.desktop.components.paymentmethods.StrikeForm;
import bisq.desktop.components.paymentmethods.SwiftForm;
import bisq.desktop.components.paymentmethods.SwishForm;
import bisq.desktop.components.paymentmethods.TransferwiseForm;
@ -63,6 +64,7 @@ import bisq.desktop.components.paymentmethods.PaxumForm;
import bisq.desktop.components.paymentmethods.USPostalMoneyOrderForm;
import bisq.desktop.components.paymentmethods.UpholdForm;
import bisq.desktop.components.paymentmethods.UpiForm;
import bisq.desktop.components.paymentmethods.VerseForm;
import bisq.desktop.components.paymentmethods.WeChatPayForm;
import bisq.desktop.components.paymentmethods.WesternUnionForm;
import bisq.desktop.main.account.content.PaymentAccountsView;
@ -583,6 +585,10 @@ public class FiatAccountsView extends PaymentAccountsView<GridPane, FiatAccounts
return new MoneseForm(paymentAccount, accountAgeWitnessService, inputValidator, root, gridRow, formatter);
case PaymentMethod.SATISPAY_ID:
return new SatispayForm(paymentAccount, accountAgeWitnessService, inputValidator, root, gridRow, formatter);
case PaymentMethod.VERSE_ID:
return new VerseForm(paymentAccount, accountAgeWitnessService, inputValidator, root, gridRow, formatter);
case PaymentMethod.STRIKE_ID:
return new StrikeForm(paymentAccount, accountAgeWitnessService, inputValidator, root, gridRow, formatter);
case PaymentMethod.SWIFT_ID:
return new SwiftForm(paymentAccount, accountAgeWitnessService, inputValidator, root, gridRow, formatter);
default:

View file

@ -58,12 +58,14 @@ import bisq.desktop.components.paymentmethods.SatispayForm;
import bisq.desktop.components.paymentmethods.SepaForm;
import bisq.desktop.components.paymentmethods.SepaInstantForm;
import bisq.desktop.components.paymentmethods.SpecificBankForm;
import bisq.desktop.components.paymentmethods.StrikeForm;
import bisq.desktop.components.paymentmethods.SwiftForm;
import bisq.desktop.components.paymentmethods.SwishForm;
import bisq.desktop.components.paymentmethods.TransferwiseForm;
import bisq.desktop.components.paymentmethods.USPostalMoneyOrderForm;
import bisq.desktop.components.paymentmethods.UpholdForm;
import bisq.desktop.components.paymentmethods.UpiForm;
import bisq.desktop.components.paymentmethods.VerseForm;
import bisq.desktop.components.paymentmethods.WeChatPayForm;
import bisq.desktop.components.paymentmethods.WesternUnionForm;
import bisq.desktop.main.MainView;
@ -381,6 +383,12 @@ public class BuyerStep2View extends TradeStepView {
case PaymentMethod.SATISPAY_ID:
gridRow = SatispayForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload);
break;
case PaymentMethod.VERSE_ID:
gridRow = VerseForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload);
break;
case PaymentMethod.STRIKE_ID:
gridRow = StrikeForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload);
break;
case PaymentMethod.SWIFT_ID:
gridRow = SwiftForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload, trade);
break;

View file

@ -1002,6 +1002,7 @@ message PaymentAccountPayload {
SwiftAccountPayload swift_account_payload = 36;
CelPayAccountPayload cel_pay_account_payload = 37;
MoneseAccountPayload monese_account_payload = 38;
VerseAccountPayload verse_account_payload = 39;
}
map<string, string> exclude_from_json_data = 15;
}
@ -1040,6 +1041,7 @@ message CountryBasedPaymentAccountPayload {
BizumAccountPayload bizum_account_payload = 13;
PixAccountPayload pix_account_payload = 14;
SatispayAccountPayload satispay_account_payload = 15;
StrikeAccountPayload strike_account_payload = 16;
}
}
@ -1296,6 +1298,14 @@ message SatispayAccountPayload {
string holder_name = 2;
}
message StrikeAccountPayload {
string holder_name = 1;
}
message VerseAccountPayload {
string holder_name = 1;
}
message SwiftAccountPayload {
string beneficiary_name = 1;
string beneficiary_account_nr = 2;