Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CelPay payment method #5721

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions core/src/main/java/bisq/core/locale/CurrencyUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,17 @@ public static List<TradeCurrency> getAllCapitualCurrencies() {
));
}

// https://github.com/bisq-network/growth/issues/231
public static List<TradeCurrency> getAllCelPayCurrencies() {
return new ArrayList<>(Arrays.asList(
new FiatCurrency("AUD"),
new FiatCurrency("CAD"),
new FiatCurrency("GBP"),
new FiatCurrency("HKD"),
new FiatCurrency("USD")
));
}

// 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(
Expand Down
56 changes: 56 additions & 0 deletions core/src/main/java/bisq/core/payment/CelPayAccount.java
Original file line number Diff line number Diff line change
@@ -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.CelPayAccountPayload;

import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
public final class CelPayAccount extends PaymentAccount {
public CelPayAccount() {
super(PaymentMethod.CELPAY);
}

@Override
protected PaymentAccountPayload createPayload() {
return new CelPayAccountPayload(paymentMethod.getId(), id);
}

public void setEmail(String accountId) {
((CelPayAccountPayload) paymentAccountPayload).setEmail(accountId);
}

public String getEmail() {
return ((CelPayAccountPayload) paymentAccountPayload).getEmail();
}

public String getMessageForBuyer() {
return "payment.celpay.info.buyer";
}

public String getMessageForSeller() {
return "payment.celpay.info.seller";
}

public String getMessageForAccountCreation() {
return "payment.celpay.info.account";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ public static PaymentAccount getPaymentAccount(PaymentMethod paymentMethod) {
return new InstantCryptoCurrencyAccount();
case PaymentMethod.CAPITUAL_ID:
return new CapitualAccount();
case PaymentMethod.CELPAY_ID:
return new CelPayAccount();
case PaymentMethod.SWIFT_ID:
return new SwiftAccount();

Expand Down
Original file line number Diff line number Diff line change
@@ -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 CelPayAccountPayload extends PaymentAccountPayload {
private String email = "";

public CelPayAccountPayload(String paymentMethod, String id) {
super(paymentMethod, id);
}

private CelPayAccountPayload(String paymentMethod,
String id,
String email,
long maxTradePeriod,
Map<String, String> excludeFromJsonDataMap) {
super(paymentMethod,
id,
maxTradePeriod,
excludeFromJsonDataMap);

this.email = email;
}

@Override
public Message toProtoMessage() {
return getPaymentAccountPayloadBuilder()
.setCelPayAccountPayload(protobuf.CelPayAccountPayload.newBuilder().setEmail(email))
.build();
}

public static CelPayAccountPayload fromProto(protobuf.PaymentAccountPayload proto) {
return new CelPayAccountPayload(proto.getPaymentMethodId(),
proto.getId(),
proto.getCelPayAccountPayload().getEmail(),
proto.getMaxTradePeriod(),
new HashMap<>(proto.getExcludeFromJsonDataMap()));
}

@Override
public String getPaymentDetails() {
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.email") + " " + email;
}

@Override
public String getPaymentDetailsForTradePopup() {
return getPaymentDetails();
}

@Override
public byte[] getAgeWitnessInputData() {
return super.getAgeWitnessInputData(email.getBytes(StandardCharsets.UTF_8));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ public final class PaymentMethod implements PersistablePayload, Comparable<Payme
public static final String BLOCK_CHAINS_INSTANT_ID = "BLOCK_CHAINS_INSTANT";
public static final String CASH_BY_MAIL_ID = "CASH_BY_MAIL";
public static final String CAPITUAL_ID = "CAPITUAL";
public static final String CELPAY_ID = "CELPAY";
public static final String SWIFT_ID = "SWIFT";

// Cannot be deleted as it would break old trade history entries
Expand Down Expand Up @@ -157,6 +158,7 @@ public final class PaymentMethod implements PersistablePayload, Comparable<Payme
public static PaymentMethod BLOCK_CHAINS_INSTANT;
public static PaymentMethod CASH_BY_MAIL;
public static PaymentMethod CAPITUAL;
public static PaymentMethod CELPAY;
public static PaymentMethod SWIFT;

// Cannot be deleted as it would break old trade history entries
Expand Down Expand Up @@ -217,6 +219,7 @@ 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")),
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),

// Japan
Expand Down
3 changes: 3 additions & 0 deletions core/src/main/java/bisq/core/proto/CoreProtoResolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import bisq.core.payment.payload.CashAppAccountPayload;
import bisq.core.payment.payload.CashByMailAccountPayload;
import bisq.core.payment.payload.CashDepositAccountPayload;
import bisq.core.payment.payload.CelPayAccountPayload;
import bisq.core.payment.payload.ChaseQuickPayAccountPayload;
import bisq.core.payment.payload.ClearXchangeAccountPayload;
import bisq.core.payment.payload.CryptoCurrencyAccountPayload;
Expand Down Expand Up @@ -192,6 +193,8 @@ public PaymentAccountPayload fromProto(protobuf.PaymentAccountPayload proto) {
return InstantCryptoCurrencyPayload.fromProto(proto);
case CAPITUAL_ACCOUNT_PAYLOAD:
return CapitualAccountPayload.fromProto(proto);
case CEL_PAY_ACCOUNT_PAYLOAD:
return CelPayAccountPayload.fromProto(proto);
case SWIFT_ACCOUNT_PAYLOAD:
return SwiftAccountPayload.fromProto(proto);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ private enum PaymentMethodMapper {
RTGS,
IMPS,
UPI,
PAYTM
PAYTM,
CELPAY
}

@Getter
Expand Down
38 changes: 38 additions & 0 deletions core/src/main/resources/i18n/displayStrings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3580,6 +3580,40 @@ Please note some banks have different limits for their customers.
payment.upi.info.seller=If you intend to receive over Rs. 100,000 per trade you should expect the buyer to have to make multiple transfers. \n\n\
Please note some banks have different limits for their customers.

payment.celpay.info.account=Please make sure to include the email your Celsius account is registered to. \
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\
CelPay users are limited to sending $2,500 (or other currency/crypto equivalent) in 24 hours.\n\n\
Trades above CelPay account limits will likely have to take place over more than one day, or, be cancelled.\n\n\
CelPay supports multiple stablecoins:\n\n\
● USD Stablecoins; DAI, TrueUSD, USDC, ZUSD, BUSD, GUSD, PAX, USDT (ERC20)\n\
● CAD Stablecoins; TrueCAD\n\
● GBP Stablecoins; TrueGBP\n\
● HKD Stablecoins; TrueHKD\n\
● AUD Stablecoins; TrueAUD\n\n\
BTC Buyers can send any matching currency stablecoin to the BTC Seller.
payment.celpay.info.buyer=Please send payment only to the email address provided by the BTC Seller by sending a payment link.\n\n\
CelPay is limited to sending $2,500 (or other currency/crypto equivalent) in 24 hours.\n\n\
Trades above CelPay account limits will likely have to take place over more than one day, or, be cancelled.\n\n\
CelPay supports multiple stablecoins:\n\n\
● USD Stablecoins; DAI, TrueUSD, USDC, ZUSD, BUSD, GUSD, PAX, USDT (ERC20)\n\
● CAD Stablecoins; TrueCAD\n\
● GBP Stablecoins; TrueGBP\n\
● HKD Stablecoins; TrueHKD\n\
● AUD Stablecoins; TrueAUD\n\n\
BTC Buyers can send any matching currency stablecoin to the BTC Seller.
payment.celpay.info.seller=BTC Sellers should expect to receive payment via a secure payment link. \
Please make sure the email payment link contains the email address provided by the BTC Buyer.\n\n\
CelPay users are limited to sending $2,500 (or other currency/crypto equivalent) in 24 hours.\n\n\
Trades above CelPay account limits will likely have to take place over more than one day, or, be cancelled.\n\n\
CelPay supports multiple stablecoins:\n\n\
● USD Stablecoins; DAI, TrueUSD, USDC, ZUSD, BUSD, GUSD, PAX, USDT (ERC20)\n\
● CAD Stablecoins; TrueCAD\n\
● GBP Stablecoins; TrueGBP\n\
● HKD Stablecoins; TrueHKD\n\
● AUD Stablecoins; TrueAUD\n\n\
BTC Sellers should expect to receive any matching currency stablecoin from the BTC Buyer. It is possible for the BTC Buyer to send any matching currency stablecoin.
payment.celpay.supportedCurrenciesForReceiver=Supported currencies (please note: all the currencies below are supported stable coins within the Celcius app. Trades are for stable coins, not fiat.)

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\
Expand Down Expand Up @@ -3763,6 +3797,8 @@ BLOCK_CHAINS_INSTANT=Altcoins Instant
# suppress inspection "UnusedProperty"
CAPITUAL=Capitual
# suppress inspection "UnusedProperty"
CELPAY=CelPay
# suppress inspection "UnusedProperty"
SWIFT=SWIFT International Wire Transfer

# Deprecated: Cannot be deleted as it would break old trade history entries
Expand Down Expand Up @@ -3833,6 +3869,8 @@ BLOCK_CHAINS_INSTANT_SHORT=Altcoins Instant
# suppress inspection "UnusedProperty"
CAPITUAL_SHORT=Capitual
# suppress inspection "UnusedProperty"
CELPAY_SHORT=CelPay
# suppress inspection "UnusedProperty"
SWIFT_SHORT=SWIFT

# Deprecated: Cannot be deleted as it would break old trade history entries
Expand Down
Loading