mirror of
https://github.com/bisq-network/bisq.git
synced 2025-03-13 11:09:10 +01:00
add payment methods Bizum and Pix
This commit is contained in:
parent
2cca574427
commit
b156f034ad
14 changed files with 597 additions and 2 deletions
core/src/main
java/bisq/core
resources/i18n
desktop/src/main/java/bisq/desktop
components/paymentmethods
main
account/content/fiataccounts
portfolio/pendingtrades/steps/buyer
proto/src/main/proto
56
core/src/main/java/bisq/core/payment/BizumAccount.java
Normal file
56
core/src/main/java/bisq/core/payment/BizumAccount.java
Normal 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.BizumAccountPayload;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public final class BizumAccount extends CountryBasedPaymentAccount {
|
||||
public BizumAccount() {
|
||||
super(PaymentMethod.BIZUM);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PaymentAccountPayload createPayload() {
|
||||
return new BizumAccountPayload(paymentMethod.getId(), id);
|
||||
}
|
||||
|
||||
public void setMobileNr(String mobileNr) {
|
||||
((BizumAccountPayload) paymentAccountPayload).setMobileNr(mobileNr);
|
||||
}
|
||||
|
||||
public String getMobileNr() {
|
||||
return ((BizumAccountPayload) paymentAccountPayload).getMobileNr();
|
||||
}
|
||||
|
||||
public String getMessageForBuyer() {
|
||||
return "payment.bizum.info.buyer";
|
||||
}
|
||||
|
||||
public String getMessageForSeller() {
|
||||
return "payment.bizum.info.seller";
|
||||
}
|
||||
|
||||
public String getMessageForAccountCreation() {
|
||||
return "payment.bizum.info.account";
|
||||
}
|
||||
}
|
|
@ -98,6 +98,10 @@ public class PaymentAccountFactory {
|
|||
return new PaytmAccount();
|
||||
case PaymentMethod.NEQUI_ID:
|
||||
return new NequiAccount();
|
||||
case PaymentMethod.BIZUM_ID:
|
||||
return new BizumAccount();
|
||||
case PaymentMethod.PIX_ID:
|
||||
return new PixAccount();
|
||||
case PaymentMethod.AMAZON_GIFT_CARD_ID:
|
||||
return new AmazonGiftCardAccount();
|
||||
case PaymentMethod.BLOCK_CHAINS_INSTANT_ID:
|
||||
|
|
56
core/src/main/java/bisq/core/payment/PixAccount.java
Normal file
56
core/src/main/java/bisq/core/payment/PixAccount.java
Normal 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.PixAccountPayload;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public final class PixAccount extends CountryBasedPaymentAccount {
|
||||
public PixAccount() {
|
||||
super(PaymentMethod.PIX);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PaymentAccountPayload createPayload() {
|
||||
return new PixAccountPayload(paymentMethod.getId(), id);
|
||||
}
|
||||
|
||||
public void setPixKey(String pixKey) {
|
||||
((PixAccountPayload) paymentAccountPayload).setPixKey(pixKey);
|
||||
}
|
||||
|
||||
public String getPixKey() {
|
||||
return ((PixAccountPayload) paymentAccountPayload).getPixKey();
|
||||
}
|
||||
|
||||
public String getMessageForBuyer() {
|
||||
return "payment.pix.info.buyer";
|
||||
}
|
||||
|
||||
public String getMessageForSeller() {
|
||||
return "payment.pix.info.seller";
|
||||
}
|
||||
|
||||
public String getMessageForAccountCreation() {
|
||||
return "payment.pix.info.account";
|
||||
}
|
||||
}
|
|
@ -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 BizumAccountPayload extends CountryBasedPaymentAccountPayload {
|
||||
private String mobileNr = "";
|
||||
|
||||
public BizumAccountPayload(String paymentMethod, String id) {
|
||||
super(paymentMethod, id);
|
||||
}
|
||||
|
||||
private BizumAccountPayload(String paymentMethod,
|
||||
String id,
|
||||
String countryCode,
|
||||
String mobileNr,
|
||||
long maxTradePeriod,
|
||||
Map<String, String> excludeFromJsonDataMap) {
|
||||
super(paymentMethod,
|
||||
id,
|
||||
countryCode,
|
||||
maxTradePeriod,
|
||||
excludeFromJsonDataMap);
|
||||
|
||||
this.mobileNr = mobileNr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Message toProtoMessage() {
|
||||
protobuf.BizumAccountPayload.Builder builder = protobuf.BizumAccountPayload.newBuilder()
|
||||
.setMobileNr(mobileNr);
|
||||
final protobuf.CountryBasedPaymentAccountPayload.Builder countryBasedPaymentAccountPayload = getPaymentAccountPayloadBuilder()
|
||||
.getCountryBasedPaymentAccountPayloadBuilder()
|
||||
.setBizumAccountPayload(builder);
|
||||
return getPaymentAccountPayloadBuilder()
|
||||
.setCountryBasedPaymentAccountPayload(countryBasedPaymentAccountPayload)
|
||||
.build();
|
||||
}
|
||||
|
||||
public static BizumAccountPayload fromProto(protobuf.PaymentAccountPayload proto) {
|
||||
protobuf.CountryBasedPaymentAccountPayload countryBasedPaymentAccountPayload = proto.getCountryBasedPaymentAccountPayload();
|
||||
protobuf.BizumAccountPayload paytmAccountPayloadPB = countryBasedPaymentAccountPayload.getBizumAccountPayload();
|
||||
return new BizumAccountPayload(proto.getPaymentMethodId(),
|
||||
proto.getId(),
|
||||
countryBasedPaymentAccountPayload.getCountryCode(),
|
||||
paytmAccountPayloadPB.getMobileNr(),
|
||||
proto.getMaxTradePeriod(),
|
||||
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPaymentDetails() {
|
||||
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.mobile") + " " + mobileNr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPaymentDetailsForTradePopup() {
|
||||
return getPaymentDetails();
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getAgeWitnessInputData() {
|
||||
return super.getAgeWitnessInputData(mobileNr.getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
}
|
|
@ -104,6 +104,8 @@ public final class PaymentMethod implements PersistablePayload, Comparable<Payme
|
|||
public static final String UPI_ID = "UPI";
|
||||
public static final String PAYTM_ID = "PAYTM";
|
||||
public static final String NEQUI_ID = "NEQUI";
|
||||
public static final String BIZUM_ID = "BIZUM";
|
||||
public static final String PIX_ID = "PIX";
|
||||
public static final String AMAZON_GIFT_CARD_ID = "AMAZON_GIFT_CARD";
|
||||
public static final String BLOCK_CHAINS_INSTANT_ID = "BLOCK_CHAINS_INSTANT";
|
||||
public static final String CASH_BY_MAIL_ID = "CASH_BY_MAIL";
|
||||
|
@ -156,6 +158,8 @@ public final class PaymentMethod implements PersistablePayload, Comparable<Payme
|
|||
public static PaymentMethod UPI;
|
||||
public static PaymentMethod PAYTM;
|
||||
public static PaymentMethod NEQUI;
|
||||
public static PaymentMethod BIZUM;
|
||||
public static PaymentMethod PIX;
|
||||
public static PaymentMethod AMAZON_GIFT_CARD;
|
||||
public static PaymentMethod BLOCK_CHAINS_INSTANT;
|
||||
public static PaymentMethod CASH_BY_MAIL;
|
||||
|
@ -221,6 +225,8 @@ public final class PaymentMethod implements PersistablePayload, Comparable<Payme
|
|||
UPI = new PaymentMethod(UPI_ID, DAY, Coin.parseCoin("0.05")),
|
||||
PAYTM = new PaymentMethod(PAYTM_ID, DAY, Coin.parseCoin("0.05")),
|
||||
NEQUI = new PaymentMethod(NEQUI_ID, DAY, DEFAULT_TRADE_LIMIT_HIGH_RISK),
|
||||
BIZUM = new PaymentMethod(BIZUM_ID, DAY, Coin.parseCoin("0.04")),
|
||||
PIX = new PaymentMethod(PIX_ID, DAY, DEFAULT_TRADE_LIMIT_HIGH_RISK),
|
||||
CAPITUAL = new PaymentMethod(CAPITUAL_ID, DAY, DEFAULT_TRADE_LIMIT_HIGH_RISK),
|
||||
CELPAY = new PaymentMethod(CELPAY_ID, DAY, DEFAULT_TRADE_LIMIT_HIGH_RISK),
|
||||
SWIFT = new PaymentMethod(SWIFT_ID, 7 * DAY, DEFAULT_TRADE_LIMIT_MID_RISK),
|
||||
|
@ -341,7 +347,7 @@ public final class PaymentMethod implements PersistablePayload, Comparable<Payme
|
|||
if (currencyCode.equals("SF"))
|
||||
return Coin.parseCoin("4");
|
||||
// payment methods which define their own trade limits
|
||||
if (id.equals(NEFT_ID) || id.equals(UPI_ID) || id.equals(PAYTM_ID)) {
|
||||
if (id.equals(NEFT_ID) || id.equals(UPI_ID) || id.equals(PAYTM_ID) || id.equals(BIZUM_ID)) {
|
||||
return Coin.valueOf(maxTradeLimit);
|
||||
}
|
||||
|
||||
|
|
|
@ -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 PixAccountPayload extends CountryBasedPaymentAccountPayload {
|
||||
private String pixKey = "";
|
||||
|
||||
public PixAccountPayload(String paymentMethod, String id) {
|
||||
super(paymentMethod, id);
|
||||
}
|
||||
|
||||
private PixAccountPayload(String paymentMethod,
|
||||
String id,
|
||||
String countryCode,
|
||||
String pixKey,
|
||||
long maxTradePeriod,
|
||||
Map<String, String> excludeFromJsonDataMap) {
|
||||
super(paymentMethod,
|
||||
id,
|
||||
countryCode,
|
||||
maxTradePeriod,
|
||||
excludeFromJsonDataMap);
|
||||
|
||||
this.pixKey = pixKey;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Message toProtoMessage() {
|
||||
protobuf.PixAccountPayload.Builder builder = protobuf.PixAccountPayload.newBuilder()
|
||||
.setPixKey(pixKey);
|
||||
final protobuf.CountryBasedPaymentAccountPayload.Builder countryBasedPaymentAccountPayload = getPaymentAccountPayloadBuilder()
|
||||
.getCountryBasedPaymentAccountPayloadBuilder()
|
||||
.setPixAccountPayload(builder);
|
||||
return getPaymentAccountPayloadBuilder()
|
||||
.setCountryBasedPaymentAccountPayload(countryBasedPaymentAccountPayload)
|
||||
.build();
|
||||
}
|
||||
|
||||
public static PixAccountPayload fromProto(protobuf.PaymentAccountPayload proto) {
|
||||
protobuf.CountryBasedPaymentAccountPayload countryBasedPaymentAccountPayload = proto.getCountryBasedPaymentAccountPayload();
|
||||
protobuf.PixAccountPayload paytmAccountPayloadPB = countryBasedPaymentAccountPayload.getPixAccountPayload();
|
||||
return new PixAccountPayload(proto.getPaymentMethodId(),
|
||||
proto.getId(),
|
||||
countryBasedPaymentAccountPayload.getCountryCode(),
|
||||
paytmAccountPayloadPB.getPixKey(),
|
||||
proto.getMaxTradePeriod(),
|
||||
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPaymentDetails() {
|
||||
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.pix.key") + " " + pixKey;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPaymentDetailsForTradePopup() {
|
||||
return getPaymentDetails();
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getAgeWitnessInputData() {
|
||||
return super.getAgeWitnessInputData(pixKey.getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
}
|
|
@ -25,6 +25,7 @@ import bisq.core.payment.payload.AdvancedCashAccountPayload;
|
|||
import bisq.core.payment.payload.AliPayAccountPayload;
|
||||
import bisq.core.payment.payload.AmazonGiftCardAccountPayload;
|
||||
import bisq.core.payment.payload.AustraliaPayidPayload;
|
||||
import bisq.core.payment.payload.BizumAccountPayload;
|
||||
import bisq.core.payment.payload.CapitualAccountPayload;
|
||||
import bisq.core.payment.payload.CashAppAccountPayload;
|
||||
import bisq.core.payment.payload.CashByMailAccountPayload;
|
||||
|
@ -51,6 +52,7 @@ import bisq.core.payment.payload.PaymentAccountPayload;
|
|||
import bisq.core.payment.payload.PayseraAccountPayload;
|
||||
import bisq.core.payment.payload.PaytmAccountPayload;
|
||||
import bisq.core.payment.payload.PerfectMoneyAccountPayload;
|
||||
import bisq.core.payment.payload.PixAccountPayload;
|
||||
import bisq.core.payment.payload.PopmoneyAccountPayload;
|
||||
import bisq.core.payment.payload.PromptPayAccountPayload;
|
||||
import bisq.core.payment.payload.RevolutAccountPayload;
|
||||
|
@ -131,6 +133,10 @@ public class CoreProtoResolver implements ProtoResolver {
|
|||
return PaytmAccountPayload.fromProto(proto);
|
||||
case NEQUI_ACCOUNT_PAYLOAD:
|
||||
return NequiAccountPayload.fromProto(proto);
|
||||
case BIZUM_ACCOUNT_PAYLOAD:
|
||||
return BizumAccountPayload.fromProto(proto);
|
||||
case PIX_ACCOUNT_PAYLOAD:
|
||||
return PixAccountPayload.fromProto(proto);
|
||||
case IFSC_BASED_ACCOUNT_PAYLOAD:
|
||||
final protobuf.IfscBasedAccountPayload.MessageCase messageCaseIfsc = proto.getCountryBasedPaymentAccountPayload().getIfscBasedAccountPayload().getMessageCase();
|
||||
switch (messageCaseIfsc) {
|
||||
|
|
|
@ -163,7 +163,9 @@ public final class TradeStatistics3 implements ProcessOncePersistableNetworkPayl
|
|||
UPI,
|
||||
PAYTM,
|
||||
CELPAY,
|
||||
NEQUI
|
||||
NEQUI,
|
||||
BIZUM,
|
||||
PIX
|
||||
}
|
||||
|
||||
@Getter
|
||||
|
|
|
@ -3630,6 +3630,29 @@ If you intend to trade amount of over 7,000,000 COP per trade you will need to c
|
|||
of around 15,000 COP. After this all transactions will incur a 0.4% of tax. Please ensure you are aware of the latest taxes.\n\n\
|
||||
Users should also be aware of account limits. Trades above Nequi account limits will likely have to be cancelled.
|
||||
|
||||
payment.bizum.info.account=To use Bizum you need a bank account (IBAN) in Spain and to be registered for the service.\n\n\
|
||||
Bizum can be used for trades between €0.50 and €1,000.\n\n\
|
||||
The maximum amount of transactions you can send/receive using Bizum is €2,000 Euros per day.\n\n\
|
||||
Bizum users can have a maximum of 150 operations per month.\n\n\
|
||||
Each bank however may establish its own limits, within the above limits, for its clients.\n\n\
|
||||
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.bizum.info.buyer=Please send payment only to the BTC Seller's mobile phone number as provided in Bisq.\n\n\
|
||||
The maximum trade size is €1,000 maximum per payment. The maximum amount of transactions you can send using Bizum is €2,000 Euros per day.\n\n\
|
||||
If you trade over the above limits your trade might be cancelled and there could be a penalty.
|
||||
payment.bizum.info.seller=Please make sure your payment is received from the BTC Buyer's mobile phone number as provided in Bisq.\n\n\
|
||||
The maximum trade size is €1,000 maximum per payment. The maximum amount of transactions you can receive using Bizum is €2,000 Euros per day.\n\n\
|
||||
If you trade over the above limits your trade might be cancelled and there could be a penalty.
|
||||
|
||||
payment.pix.info.account=Please make sure to include your chosen Pix Key. There are four types of keys: \
|
||||
CPF (Natural Persons Register) or CNPJ (National Registry of Legal Entities), e-mail address, telephone number or a \
|
||||
random key generated by the system called a universally unique identifier (UUID). A different key must be used for \
|
||||
each Pix account your have. Individuals can create up to five keys for each account they own.\n\n\
|
||||
When trading on Bisq, BTC Buyers should use their Pix Keys as the payment description so that it is easy for the BTC Sellers to identify the payment as coming from themselves.
|
||||
payment.pix.info.buyer=Please send payment only the Pix Key provided in the BTC Seller's Bisq account.\n\n\
|
||||
Please use your Pix Key as the payment reference so that it is easy for the BTC Seller to identify the payment as coming from yourself.
|
||||
payment.pix.info.seller=Please check that the payment received description matches the Pix Key provided in the BTC Buyer's Bisq account.
|
||||
payment.pix.key=Pix Key (CPF, CNPJ, Email, Phone number or UUID)
|
||||
|
||||
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 Seller’s name in both the Payer and the Payee’s fields & take a high-resolution photo of the USPMO and envelope with proof of tracking before sending.\n\
|
||||
|
@ -3808,6 +3831,10 @@ PAYTM=India/PayTM
|
|||
# suppress inspection "UnusedProperty"
|
||||
NEQUI=Nequi
|
||||
# suppress inspection "UnusedProperty"
|
||||
BIZUM=Bizum
|
||||
# suppress inspection "UnusedProperty"
|
||||
PIX=Pix
|
||||
# suppress inspection "UnusedProperty"
|
||||
AMAZON_GIFT_CARD=Amazon eGift Card
|
||||
# suppress inspection "UnusedProperty"
|
||||
BLOCK_CHAINS_INSTANT=Altcoins Instant
|
||||
|
@ -3882,6 +3909,10 @@ PAYTM_SHORT=PayTM
|
|||
# suppress inspection "UnusedProperty"
|
||||
NEQUI_SHORT=Nequi
|
||||
# suppress inspection "UnusedProperty"
|
||||
BIZUM_SHORT=Bizum
|
||||
# suppress inspection "UnusedProperty"
|
||||
PIX_SHORT=Pix
|
||||
# suppress inspection "UnusedProperty"
|
||||
AMAZON_GIFT_CARD_SHORT=Amazon eGift Card
|
||||
# suppress inspection "UnusedProperty"
|
||||
BLOCK_CHAINS_INSTANT_SHORT=Altcoins Instant
|
||||
|
|
|
@ -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.BizumAccount;
|
||||
import bisq.core.payment.payload.PaymentAccountPayload;
|
||||
import bisq.core.payment.payload.BizumAccountPayload;
|
||||
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 BizumForm extends PaymentMethodForm {
|
||||
private final BizumAccount account;
|
||||
private InputTextField mobileNrInputTextField;
|
||||
|
||||
public static int addFormForBuyer(GridPane gridPane, int gridRow,
|
||||
PaymentAccountPayload paymentAccountPayload) {
|
||||
addTopLabelTextFieldWithCopyIcon(gridPane, gridRow, 1, Res.get("payment.mobile"),
|
||||
((BizumAccountPayload) paymentAccountPayload).getMobileNr(), Layout.COMPACT_FIRST_ROW_AND_GROUP_DISTANCE);
|
||||
return gridRow;
|
||||
}
|
||||
|
||||
public BizumForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService,
|
||||
InputValidator inputValidator, GridPane gridPane,
|
||||
int gridRow, CoinFormatter formatter) {
|
||||
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
|
||||
this.account = (BizumAccount) paymentAccount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addFormForAddAccount() {
|
||||
// this payment method is only for Spain/EUR
|
||||
account.setSingleTradeCurrency(new FiatCurrency("EUR"));
|
||||
CountryUtil.findCountryByCode("ES").ifPresent(c -> account.setCountry(c));
|
||||
|
||||
gridRowFrom = gridRow + 1;
|
||||
|
||||
mobileNrInputTextField = FormBuilder.addInputTextField(gridPane, ++gridRow, Res.get("payment.mobile"));
|
||||
mobileNrInputTextField.setValidator(inputValidator);
|
||||
mobileNrInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
|
||||
account.setMobileNr(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(mobileNrInputTextField.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.mobile"),
|
||||
account.getMobileNr()).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.getMobileNr()).isValid);
|
||||
}
|
||||
}
|
|
@ -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.PixAccount;
|
||||
import bisq.core.payment.payload.PaymentAccountPayload;
|
||||
import bisq.core.payment.payload.PixAccountPayload;
|
||||
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 PixForm extends PaymentMethodForm {
|
||||
private final PixAccount account;
|
||||
private InputTextField pixKeyInputTextField;
|
||||
|
||||
public static int addFormForBuyer(GridPane gridPane, int gridRow,
|
||||
PaymentAccountPayload paymentAccountPayload) {
|
||||
addTopLabelTextFieldWithCopyIcon(gridPane, gridRow, 1, Res.get("payment.pix.key"),
|
||||
((PixAccountPayload) paymentAccountPayload).getPixKey(), Layout.COMPACT_FIRST_ROW_AND_GROUP_DISTANCE);
|
||||
return gridRow;
|
||||
}
|
||||
|
||||
public PixForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService,
|
||||
InputValidator inputValidator, GridPane gridPane,
|
||||
int gridRow, CoinFormatter formatter) {
|
||||
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
|
||||
this.account = (PixAccount) paymentAccount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addFormForAddAccount() {
|
||||
// this payment method is only for Brazil/BRL
|
||||
account.setSingleTradeCurrency(new FiatCurrency("BRL"));
|
||||
CountryUtil.findCountryByCode("BR").ifPresent(c -> account.setCountry(c));
|
||||
|
||||
gridRowFrom = gridRow + 1;
|
||||
|
||||
pixKeyInputTextField = FormBuilder.addInputTextField(gridPane, ++gridRow, Res.get("payment.pix.key"));
|
||||
pixKeyInputTextField.setValidator(inputValidator);
|
||||
pixKeyInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
|
||||
account.setPixKey(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(pixKeyInputTextField.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.pix.key"),
|
||||
account.getPixKey()).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.getPixKey()).isValid);
|
||||
}
|
||||
}
|
|
@ -23,6 +23,7 @@ import bisq.desktop.components.paymentmethods.AdvancedCashForm;
|
|||
import bisq.desktop.components.paymentmethods.AliPayForm;
|
||||
import bisq.desktop.components.paymentmethods.AmazonGiftCardForm;
|
||||
import bisq.desktop.components.paymentmethods.AustraliaPayidForm;
|
||||
import bisq.desktop.components.paymentmethods.BizumForm;
|
||||
import bisq.desktop.components.paymentmethods.CapitualForm;
|
||||
import bisq.desktop.components.paymentmethods.CashByMailForm;
|
||||
import bisq.desktop.components.paymentmethods.CashDepositForm;
|
||||
|
@ -43,6 +44,7 @@ import bisq.desktop.components.paymentmethods.NequiForm;
|
|||
import bisq.desktop.components.paymentmethods.PaymentMethodForm;
|
||||
import bisq.desktop.components.paymentmethods.PaytmForm;
|
||||
import bisq.desktop.components.paymentmethods.PerfectMoneyForm;
|
||||
import bisq.desktop.components.paymentmethods.PixForm;
|
||||
import bisq.desktop.components.paymentmethods.PopmoneyForm;
|
||||
import bisq.desktop.components.paymentmethods.PromptPayForm;
|
||||
import bisq.desktop.components.paymentmethods.RevolutForm;
|
||||
|
@ -565,6 +567,10 @@ public class FiatAccountsView extends PaymentAccountsView<GridPane, FiatAccounts
|
|||
return new PaytmForm(paymentAccount, accountAgeWitnessService, inputValidator, root, gridRow, formatter);
|
||||
case PaymentMethod.NEQUI_ID:
|
||||
return new NequiForm(paymentAccount, accountAgeWitnessService, inputValidator, root, gridRow, formatter);
|
||||
case PaymentMethod.BIZUM_ID:
|
||||
return new BizumForm(paymentAccount, accountAgeWitnessService, inputValidator, root, gridRow, formatter);
|
||||
case PaymentMethod.PIX_ID:
|
||||
return new PixForm(paymentAccount, accountAgeWitnessService, inputValidator, root, gridRow, formatter);
|
||||
case PaymentMethod.AMAZON_GIFT_CARD_ID:
|
||||
return new AmazonGiftCardForm(paymentAccount, accountAgeWitnessService, inputValidator, root, gridRow, formatter);
|
||||
case PaymentMethod.CAPITUAL_ID:
|
||||
|
|
|
@ -25,6 +25,7 @@ import bisq.desktop.components.paymentmethods.AdvancedCashForm;
|
|||
import bisq.desktop.components.paymentmethods.AliPayForm;
|
||||
import bisq.desktop.components.paymentmethods.AmazonGiftCardForm;
|
||||
import bisq.desktop.components.paymentmethods.AssetsForm;
|
||||
import bisq.desktop.components.paymentmethods.BizumForm;
|
||||
import bisq.desktop.components.paymentmethods.CapitualForm;
|
||||
import bisq.desktop.components.paymentmethods.CashByMailForm;
|
||||
import bisq.desktop.components.paymentmethods.CashDepositForm;
|
||||
|
@ -46,6 +47,7 @@ import bisq.desktop.components.paymentmethods.PaxumForm;
|
|||
import bisq.desktop.components.paymentmethods.PayseraForm;
|
||||
import bisq.desktop.components.paymentmethods.PaytmForm;
|
||||
import bisq.desktop.components.paymentmethods.PerfectMoneyForm;
|
||||
import bisq.desktop.components.paymentmethods.PixForm;
|
||||
import bisq.desktop.components.paymentmethods.PopmoneyForm;
|
||||
import bisq.desktop.components.paymentmethods.PromptPayForm;
|
||||
import bisq.desktop.components.paymentmethods.RevolutForm;
|
||||
|
@ -356,6 +358,12 @@ public class BuyerStep2View extends TradeStepView {
|
|||
case PaymentMethod.NEQUI_ID:
|
||||
gridRow = NequiForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload);
|
||||
break;
|
||||
case PaymentMethod.BIZUM_ID:
|
||||
gridRow = BizumForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload);
|
||||
break;
|
||||
case PaymentMethod.PIX_ID:
|
||||
gridRow = PixForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload);
|
||||
break;
|
||||
case PaymentMethod.AMAZON_GIFT_CARD_ID:
|
||||
gridRow = AmazonGiftCardForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload);
|
||||
break;
|
||||
|
|
|
@ -1036,6 +1036,8 @@ message CountryBasedPaymentAccountPayload {
|
|||
PaytmAccountPayload paytm_account_payload = 10;
|
||||
IfscBasedAccountPayload ifsc_based_account_payload = 11;
|
||||
NequiAccountPayload nequi_account_payload = 12;
|
||||
BizumAccountPayload bizum_account_payload = 13;
|
||||
PixAccountPayload pix_account_payload = 14;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1274,6 +1276,14 @@ message NequiAccountPayload {
|
|||
string mobile_nr = 1;
|
||||
}
|
||||
|
||||
message BizumAccountPayload {
|
||||
string mobile_nr = 1;
|
||||
}
|
||||
|
||||
message PixAccountPayload {
|
||||
string pix_key = 1;
|
||||
}
|
||||
|
||||
message SwiftAccountPayload {
|
||||
string beneficiary_name = 1;
|
||||
string beneficiary_account_nr = 2;
|
||||
|
|
Loading…
Add table
Reference in a new issue