mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-06-23 06:14:11 -04:00
Bring payment method support for GRPC in-line with
payment methods for the desktop application.
This commit is contained in:
parent
050e6b907a
commit
295709912d
38 changed files with 347 additions and 53 deletions
|
@ -40,7 +40,71 @@ public class GetPaymentMethodsTest extends MethodTest {
|
|||
.stream()
|
||||
.map(PaymentMethod::getId)
|
||||
.collect(Collectors.toList());
|
||||
assertTrue(paymentMethodIds.size() >= 20);
|
||||
assertTrue(paymentMethodIds.size() >= 55);
|
||||
|
||||
// List of expected payment method IDs
|
||||
List<String> expectedIds = List.of(
|
||||
"HAL_CASH",
|
||||
"MONEY_BEAM",
|
||||
"SWISH",
|
||||
"POPMONEY",
|
||||
"US_POSTAL_MONEY_ORDER",
|
||||
"INTERAC_E_TRANSFER",
|
||||
"CASH_DEPOSIT",
|
||||
"CASH_AT_ATM",
|
||||
"WESTERN_UNION",
|
||||
"NATIONAL_BANK",
|
||||
"SAME_BANK",
|
||||
"SPECIFIC_BANKS",
|
||||
"AMAZON_GIFT_CARD",
|
||||
"PERFECT_MONEY",
|
||||
"ADVANCED_CASH",
|
||||
"PAYSERA",
|
||||
"NEFT",
|
||||
"RTGS",
|
||||
"IMPS",
|
||||
"UPI",
|
||||
"PAYTM",
|
||||
"NEQUI",
|
||||
"BIZUM",
|
||||
"PIX",
|
||||
"CAPITUAL",
|
||||
"CELPAY",
|
||||
"MONESE",
|
||||
"SATISPAY",
|
||||
"TIKKIE",
|
||||
"VERSE",
|
||||
"ACH_TRANSFER",
|
||||
"DOMESTIC_WIRE_TRANSFER",
|
||||
"JAPAN_BANK",
|
||||
"ALI_PAY",
|
||||
"WECHAT_PAY",
|
||||
"PROMPT_PAY",
|
||||
"PAY_BY_MAIL",
|
||||
"CARD_LESS_CASH",
|
||||
"MONEY_GRAM",
|
||||
"F2F",
|
||||
"AUSTRALIA_PAYID",
|
||||
"UPHOLD",
|
||||
"REVOLUT",
|
||||
"SEPA",
|
||||
"SEPA_INSTANT",
|
||||
"FASTER_PAYMENTS",
|
||||
"ZELLE",
|
||||
"BLOCK_CHAINS",
|
||||
"WISE",
|
||||
"PAXUM",
|
||||
"STRIKE",
|
||||
"SWIFT",
|
||||
"CASH_APP",
|
||||
"VENMO",
|
||||
"PAYPAL",
|
||||
"PAYSAFE"
|
||||
);
|
||||
|
||||
for (String id : expectedIds) {
|
||||
assertTrue(paymentMethodIds.contains(id), "Missing payment method: " + id);
|
||||
}
|
||||
}
|
||||
|
||||
@AfterAll
|
||||
|
|
|
@ -78,7 +78,42 @@ public final class PaymentAccountForm implements PersistablePayload {
|
|||
CASH_APP,
|
||||
PAYPAL,
|
||||
VENMO,
|
||||
PAYSAFE;
|
||||
PAYSAFE,
|
||||
HAL_CASH,
|
||||
MONEY_BEAM,
|
||||
SWISH,
|
||||
POPMONEY,
|
||||
US_POSTAL_MONEY_ORDER,
|
||||
INTERAC_E_TRANSFER,
|
||||
CASH_DEPOSIT,
|
||||
WESTERN_UNION,
|
||||
NATIONAL_BANK,
|
||||
SAME_BANK,
|
||||
SPECIFIC_BANKS,
|
||||
AMAZON_GIFT_CARD,
|
||||
PERFECT_MONEY,
|
||||
ADVANCED_CASH,
|
||||
PAYSERA,
|
||||
NEFT,
|
||||
RTGS,
|
||||
IMPS,
|
||||
UPI,
|
||||
PAYTM,
|
||||
NEQUI,
|
||||
BIZUM,
|
||||
PIX,
|
||||
CAPITUAL,
|
||||
CELPAY,
|
||||
MONESE,
|
||||
SATISPAY,
|
||||
TIKKIE,
|
||||
VERSE,
|
||||
ACH_TRANSFER,
|
||||
DOMESTIC_WIRE_TRANSFER,
|
||||
JAPAN_BANK,
|
||||
ALI_PAY,
|
||||
WECHAT_PAY,
|
||||
PROMPT_PAY;
|
||||
|
||||
public static PaymentAccountForm.FormId fromProto(protobuf.PaymentAccountForm.FormId formId) {
|
||||
return ProtoUtil.enumFromProto(PaymentAccountForm.FormId.class, formId.name());
|
||||
|
|
|
@ -100,7 +100,8 @@ public final class PaymentAccountFormField implements PersistablePayload {
|
|||
TRADE_CURRENCIES,
|
||||
USERNAME,
|
||||
EMAIL_OR_MOBILE_NR_OR_USERNAME,
|
||||
EMAIL_OR_MOBILE_NR_OR_CASHTAG;
|
||||
EMAIL_OR_MOBILE_NR_OR_CASHTAG,
|
||||
VIRTUAL_PAYMENT_ADDRESS;
|
||||
|
||||
public static PaymentAccountFormField.FieldId fromProto(protobuf.PaymentAccountFormField.FieldId fieldId) {
|
||||
return ProtoUtil.enumFromProto(PaymentAccountFormField.FieldId.class, fieldId.name());
|
||||
|
|
|
@ -79,6 +79,13 @@ public final class AchTransferAccount extends CountryBasedPaymentAccount impleme
|
|||
|
||||
@Override
|
||||
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
throw new RuntimeException("Not implemented");
|
||||
return List.of(
|
||||
PaymentAccountFormField.FieldId.HOLDER_NAME,
|
||||
PaymentAccountFormField.FieldId.BANK_NAME,
|
||||
PaymentAccountFormField.FieldId.BRANCH_ID,
|
||||
PaymentAccountFormField.FieldId.ACCOUNT_NR,
|
||||
PaymentAccountFormField.FieldId.ACCOUNT_TYPE,
|
||||
PaymentAccountFormField.FieldId.HOLDER_ADDRESS
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ public final class AdvancedCashAccount extends PaymentAccount {
|
|||
@NotNull
|
||||
@Override
|
||||
public List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
throw new RuntimeException("Not implemented");
|
||||
return List.of(PaymentAccountFormField.FieldId.ACCOUNT_NR);
|
||||
}
|
||||
|
||||
public void setAccountNr(String accountNr) {
|
||||
|
|
|
@ -25,7 +25,7 @@ import haveno.core.locale.TradeCurrency;
|
|||
import haveno.core.payment.payload.AmazonGiftCardAccountPayload;
|
||||
import haveno.core.payment.payload.PaymentAccountPayload;
|
||||
import haveno.core.payment.payload.PaymentMethod;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import lombok.NonNull;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
@ -59,13 +59,16 @@ public final class AmazonGiftCardAccount extends PaymentAccount {
|
|||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<TradeCurrency> getSupportedCurrencies() {
|
||||
public @NonNull List<TradeCurrency> getSupportedCurrencies() {
|
||||
return SUPPORTED_CURRENCIES;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
throw new RuntimeException("Not implemented");
|
||||
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
return List.of(
|
||||
PaymentAccountFormField.FieldId.EMAIL_OR_MOBILE_NR,
|
||||
PaymentAccountFormField.FieldId.COUNTRY
|
||||
);
|
||||
}
|
||||
|
||||
public String getEmailOrMobileNr() {
|
||||
|
@ -89,7 +92,7 @@ public final class AmazonGiftCardAccount extends PaymentAccount {
|
|||
return country;
|
||||
}
|
||||
|
||||
public void setCountry(@NotNull Country country) {
|
||||
public void setCountry(@NonNull Country country) {
|
||||
this.country = country;
|
||||
getAmazonGiftCardAccountPayload().setCountryCode(country.code);
|
||||
}
|
||||
|
|
|
@ -72,6 +72,6 @@ public final class BizumAccount extends CountryBasedPaymentAccount {
|
|||
|
||||
@Override
|
||||
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
throw new RuntimeException("Not implemented");
|
||||
return List.of(PaymentAccountFormField.FieldId.MOBILE_NR);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ import haveno.core.payment.payload.CapitualAccountPayload;
|
|||
import haveno.core.payment.payload.PaymentAccountPayload;
|
||||
import haveno.core.payment.payload.PaymentMethod;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import lombok.NonNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -47,16 +47,16 @@ public final class CapitualAccount extends PaymentAccount {
|
|||
return new CapitualAccountPayload(paymentMethod.getId(), id);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@NonNull
|
||||
@Override
|
||||
public List<TradeCurrency> getSupportedCurrencies() {
|
||||
return SUPPORTED_CURRENCIES;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@NonNull
|
||||
@Override
|
||||
public List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
throw new RuntimeException("Not implemented");
|
||||
return List.of(PaymentAccountFormField.FieldId.ACCOUNT_NR);
|
||||
}
|
||||
|
||||
public void setAccountNr(String accountNr) {
|
||||
|
|
|
@ -48,7 +48,7 @@ public final class CashDepositAccount extends CountryBasedPaymentAccount impleme
|
|||
|
||||
@Override
|
||||
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
throw new RuntimeException("Not implemented");
|
||||
return List.of(PaymentAccountFormField.FieldId.BANK_ID, PaymentAccountFormField.FieldId.REQUIREMENTS);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -24,7 +24,7 @@ import haveno.core.payment.payload.CelPayAccountPayload;
|
|||
import haveno.core.payment.payload.PaymentAccountPayload;
|
||||
import haveno.core.payment.payload.PaymentMethod;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import lombok.NonNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -73,12 +73,12 @@ public final class CelPayAccount extends PaymentAccount {
|
|||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<TradeCurrency> getSupportedCurrencies() {
|
||||
public @NonNull List<TradeCurrency> getSupportedCurrencies() {
|
||||
return SUPPORTED_CURRENCIES;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
throw new RuntimeException("Not implemented");
|
||||
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
return List.of(PaymentAccountFormField.FieldId.EMAIL);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,6 +79,12 @@ public final class DomesticWireTransferAccount extends CountryBasedPaymentAccoun
|
|||
|
||||
@Override
|
||||
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
throw new RuntimeException("Not implemented");
|
||||
return List.of(
|
||||
PaymentAccountFormField.FieldId.HOLDER_NAME,
|
||||
PaymentAccountFormField.FieldId.BANK_NAME,
|
||||
PaymentAccountFormField.FieldId.BRANCH_ID,
|
||||
PaymentAccountFormField.FieldId.ACCOUNT_NR,
|
||||
PaymentAccountFormField.FieldId.HOLDER_ADDRESS
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ public final class HalCashAccount extends PaymentAccount {
|
|||
|
||||
@Override
|
||||
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
throw new RuntimeException("Not implemented");
|
||||
return List.of(PaymentAccountFormField.FieldId.MOBILE_NR);
|
||||
}
|
||||
|
||||
public void setMobileNr(String mobileNr) {
|
||||
|
|
|
@ -64,6 +64,10 @@ public final class ImpsAccount extends CountryBasedPaymentAccount {
|
|||
|
||||
@Override
|
||||
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
throw new RuntimeException("Not implemented");
|
||||
return List.of(
|
||||
PaymentAccountFormField.FieldId.HOLDER_NAME,
|
||||
PaymentAccountFormField.FieldId.ACCOUNT_NR,
|
||||
PaymentAccountFormField.FieldId.BRANCH_ID
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ import haveno.core.payment.payload.InteracETransferAccountPayload;
|
|||
import haveno.core.payment.payload.PaymentAccountPayload;
|
||||
import haveno.core.payment.payload.PaymentMethod;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import lombok.NonNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -44,13 +44,18 @@ public final class InteracETransferAccount extends PaymentAccount {
|
|||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<TradeCurrency> getSupportedCurrencies() {
|
||||
public @NonNull List<TradeCurrency> getSupportedCurrencies() {
|
||||
return SUPPORTED_CURRENCIES;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
throw new RuntimeException("Not implemented");
|
||||
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
return List.of(
|
||||
PaymentAccountFormField.FieldId.EMAIL,
|
||||
PaymentAccountFormField.FieldId.ANSWER,
|
||||
PaymentAccountFormField.FieldId.QUESTION,
|
||||
PaymentAccountFormField.FieldId.HOLDER_NAME
|
||||
);
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
|
|
|
@ -48,7 +48,15 @@ public final class JapanBankAccount extends PaymentAccount {
|
|||
|
||||
@Override
|
||||
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
throw new RuntimeException("Not implemented");
|
||||
return List.of(
|
||||
PaymentAccountFormField.FieldId.BANK_NAME,
|
||||
PaymentAccountFormField.FieldId.BANK_CODE,
|
||||
PaymentAccountFormField.FieldId.BANK_BRANCH_NAME,
|
||||
PaymentAccountFormField.FieldId.BANK_BRANCH_CODE,
|
||||
PaymentAccountFormField.FieldId.BANK_ACCOUNT_TYPE,
|
||||
PaymentAccountFormField.FieldId.BANK_ACCOUNT_NAME,
|
||||
PaymentAccountFormField.FieldId.BANK_ACCOUNT_NUMBER
|
||||
);
|
||||
}
|
||||
|
||||
// bank code
|
||||
|
|
|
@ -85,6 +85,9 @@ public final class MoneseAccount extends PaymentAccount {
|
|||
|
||||
@Override
|
||||
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
throw new RuntimeException("Not implemented");
|
||||
return List.of(
|
||||
PaymentAccountFormField.FieldId.MOBILE_NR,
|
||||
PaymentAccountFormField.FieldId.HOLDER_NAME
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ public final class MoneyBeamAccount extends PaymentAccount {
|
|||
|
||||
@Override
|
||||
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
throw new RuntimeException("Not implemented");
|
||||
return List.of(PaymentAccountFormField.FieldId.ACCOUNT_ID);
|
||||
}
|
||||
|
||||
public void setAccountId(String accountId) {
|
||||
|
|
|
@ -50,7 +50,17 @@ public final class NationalBankAccount extends CountryBasedPaymentAccount implem
|
|||
|
||||
@Override
|
||||
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
throw new RuntimeException("Not implemented");
|
||||
return List.of(
|
||||
PaymentAccountFormField.FieldId.HOLDER_NAME,
|
||||
PaymentAccountFormField.FieldId.BANK_NAME,
|
||||
PaymentAccountFormField.FieldId.BANK_ID,
|
||||
PaymentAccountFormField.FieldId.BRANCH_ID,
|
||||
PaymentAccountFormField.FieldId.ACCOUNT_NR,
|
||||
PaymentAccountFormField.FieldId.ACCOUNT_TYPE,
|
||||
PaymentAccountFormField.FieldId.HOLDER_TAX_ID,
|
||||
PaymentAccountFormField.FieldId.NATIONAL_ACCOUNT_ID,
|
||||
PaymentAccountFormField.FieldId.COUNTRY
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -17,10 +17,14 @@
|
|||
|
||||
package haveno.core.payment;
|
||||
|
||||
import haveno.core.api.model.PaymentAccountFormField;
|
||||
import haveno.core.payment.payload.NeftAccountPayload;
|
||||
import haveno.core.payment.payload.PaymentAccountPayload;
|
||||
import haveno.core.payment.payload.PaymentMethod;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NonNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public final class NeftAccount extends IfscBasedAccount {
|
||||
|
@ -46,4 +50,12 @@ public final class NeftAccount extends IfscBasedAccount {
|
|||
return "payment.neft.info.account";
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
return List.of(
|
||||
PaymentAccountFormField.FieldId.HOLDER_NAME,
|
||||
PaymentAccountFormField.FieldId.ACCOUNT_NR,
|
||||
PaymentAccountFormField.FieldId.BRANCH_ID
|
||||
);
|
||||
}
|
||||
}
|
|
@ -72,6 +72,6 @@ public final class NequiAccount extends CountryBasedPaymentAccount {
|
|||
|
||||
@Override
|
||||
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
throw new RuntimeException("Not implemented");
|
||||
return List.of(PaymentAccountFormField.FieldId.MOBILE_NR);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -821,6 +821,10 @@ public abstract class PaymentAccount implements PersistablePayload {
|
|||
field.setMinLength(10);
|
||||
field.setMaxLength(150);
|
||||
break;
|
||||
case VIRTUAL_PAYMENT_ADDRESS:
|
||||
field.setComponent(PaymentAccountFormField.Component.TEXT);
|
||||
field.setLabel(Res.get("payment.upi.virtualPaymentAddress"));
|
||||
break;
|
||||
default:
|
||||
throw new RuntimeException("Unhandled form field: " + field);
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ import haveno.core.payment.payload.PaymentAccountPayload;
|
|||
import haveno.core.payment.payload.PaymentMethod;
|
||||
import haveno.core.payment.payload.PayseraAccountPayload;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import lombok.NonNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -76,13 +76,13 @@ public final class PayseraAccount extends PaymentAccount {
|
|||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<TradeCurrency> getSupportedCurrencies() {
|
||||
public @NonNull List<TradeCurrency> getSupportedCurrencies() {
|
||||
return SUPPORTED_CURRENCIES;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
throw new RuntimeException("Not implemented");
|
||||
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
return List.of(PaymentAccountFormField.FieldId.EMAIL);
|
||||
}
|
||||
|
||||
public void setEmail(String accountId) {
|
||||
|
|
|
@ -16,11 +16,13 @@
|
|||
*/
|
||||
|
||||
package haveno.core.payment;
|
||||
|
||||
import haveno.core.api.model.PaymentAccountFormField;
|
||||
import haveno.core.payment.payload.PaymentAccountPayload;
|
||||
import haveno.core.payment.payload.PaymentMethod;
|
||||
import haveno.core.payment.payload.PaytmAccountPayload;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NonNull;
|
||||
import java.util.List;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public final class PaytmAccount extends IfscBasedAccount {
|
||||
|
@ -33,6 +35,11 @@ public final class PaytmAccount extends IfscBasedAccount {
|
|||
return new PaytmAccountPayload(paymentMethod.getId(), id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
return List.of(PaymentAccountFormField.FieldId.EMAIL_OR_MOBILE_NR);
|
||||
}
|
||||
|
||||
public void setEmailOrMobileNr(String emailOrMobileNr) {
|
||||
((PaytmAccountPayload) paymentAccountPayload).setEmailOrMobileNr(emailOrMobileNr);
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ public final class PerfectMoneyAccount extends PaymentAccount {
|
|||
|
||||
@Override
|
||||
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
throw new RuntimeException("Not implemented");
|
||||
return List.of(PaymentAccountFormField.FieldId.ACCOUNT_NR);
|
||||
}
|
||||
|
||||
public void setAccountNr(String accountNr) {
|
||||
|
|
|
@ -72,6 +72,6 @@ public final class PixAccount extends CountryBasedPaymentAccount {
|
|||
|
||||
@Override
|
||||
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
throw new RuntimeException("Not implemented");
|
||||
return List.of(PaymentAccountFormField.FieldId.PIX_KEY);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,7 +51,10 @@ public final class PopmoneyAccount extends PaymentAccount {
|
|||
|
||||
@Override
|
||||
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
throw new RuntimeException("Not implemented");
|
||||
return List.of(
|
||||
PaymentAccountFormField.FieldId.ACCOUNT_ID,
|
||||
PaymentAccountFormField.FieldId.HOLDER_NAME
|
||||
);
|
||||
}
|
||||
|
||||
public void setAccountId(String accountId) {
|
||||
|
|
|
@ -17,10 +17,14 @@
|
|||
|
||||
package haveno.core.payment;
|
||||
|
||||
import haveno.core.api.model.PaymentAccountFormField;
|
||||
import haveno.core.payment.payload.PaymentAccountPayload;
|
||||
import haveno.core.payment.payload.PaymentMethod;
|
||||
import haveno.core.payment.payload.RtgsAccountPayload;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NonNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public final class RtgsAccount extends IfscBasedAccount {
|
||||
|
@ -45,4 +49,13 @@ public final class RtgsAccount extends IfscBasedAccount {
|
|||
public String getMessageForAccountCreation() {
|
||||
return "payment.rtgs.info.account";
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
return List.of(
|
||||
PaymentAccountFormField.FieldId.HOLDER_NAME,
|
||||
PaymentAccountFormField.FieldId.ACCOUNT_NR,
|
||||
PaymentAccountFormField.FieldId.BRANCH_ID
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,7 +50,17 @@ public final class SameBankAccount extends CountryBasedPaymentAccount implements
|
|||
|
||||
@Override
|
||||
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
throw new RuntimeException("Not implemented");
|
||||
return List.of(
|
||||
PaymentAccountFormField.FieldId.HOLDER_NAME,
|
||||
PaymentAccountFormField.FieldId.BANK_NAME,
|
||||
PaymentAccountFormField.FieldId.BANK_ID,
|
||||
PaymentAccountFormField.FieldId.BRANCH_ID,
|
||||
PaymentAccountFormField.FieldId.ACCOUNT_NR,
|
||||
PaymentAccountFormField.FieldId.ACCOUNT_TYPE,
|
||||
PaymentAccountFormField.FieldId.HOLDER_TAX_ID,
|
||||
PaymentAccountFormField.FieldId.NATIONAL_ACCOUNT_ID,
|
||||
PaymentAccountFormField.FieldId.COUNTRY
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -80,6 +80,9 @@ public final class SatispayAccount extends CountryBasedPaymentAccount {
|
|||
|
||||
@Override
|
||||
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
throw new RuntimeException("Not implemented");
|
||||
return List.of(
|
||||
PaymentAccountFormField.FieldId.MOBILE_NR,
|
||||
PaymentAccountFormField.FieldId.HOLDER_NAME
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,7 +50,18 @@ public final class SpecificBanksAccount extends CountryBasedPaymentAccount imple
|
|||
|
||||
@Override
|
||||
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
throw new RuntimeException("Not implemented");
|
||||
return List.of(
|
||||
PaymentAccountFormField.FieldId.HOLDER_NAME,
|
||||
PaymentAccountFormField.FieldId.BANK_NAME,
|
||||
PaymentAccountFormField.FieldId.BANK_ID,
|
||||
PaymentAccountFormField.FieldId.BRANCH_ID,
|
||||
PaymentAccountFormField.FieldId.ACCOUNT_NR,
|
||||
PaymentAccountFormField.FieldId.ACCOUNT_TYPE,
|
||||
PaymentAccountFormField.FieldId.HOLDER_TAX_ID,
|
||||
PaymentAccountFormField.FieldId.NATIONAL_ACCOUNT_ID,
|
||||
PaymentAccountFormField.FieldId.COUNTRY
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
// TODO change to List
|
||||
|
|
|
@ -50,7 +50,7 @@ public final class SwishAccount extends PaymentAccount {
|
|||
|
||||
@Override
|
||||
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
throw new RuntimeException("Not implemented");
|
||||
return List.of(PaymentAccountFormField.FieldId.MOBILE_NR, PaymentAccountFormField.FieldId.HOLDER_NAME);
|
||||
}
|
||||
|
||||
public void setMobileNr(String mobileNr) {
|
||||
|
|
|
@ -24,7 +24,7 @@ import haveno.core.payment.payload.PaymentAccountPayload;
|
|||
import haveno.core.payment.payload.PaymentMethod;
|
||||
import haveno.core.payment.payload.TikkieAccountPayload;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import lombok.NonNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -68,12 +68,12 @@ public final class TikkieAccount extends CountryBasedPaymentAccount {
|
|||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<TradeCurrency> getSupportedCurrencies() {
|
||||
public @NonNull List<TradeCurrency> getSupportedCurrencies() {
|
||||
return SUPPORTED_CURRENCIES;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
throw new RuntimeException("Not implemented");
|
||||
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
return List.of(PaymentAccountFormField.FieldId.IBAN);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ public final class USPostalMoneyOrderAccount extends PaymentAccount {
|
|||
|
||||
@Override
|
||||
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
throw new RuntimeException("Not implemented");
|
||||
return List.of(PaymentAccountFormField.FieldId.POSTAL_ADDRESS, PaymentAccountFormField.FieldId.HOLDER_NAME);
|
||||
}
|
||||
|
||||
public void setPostalAddress(String postalAddress) {
|
||||
|
|
|
@ -17,10 +17,14 @@
|
|||
|
||||
package haveno.core.payment;
|
||||
|
||||
import haveno.core.api.model.PaymentAccountFormField;
|
||||
import haveno.core.payment.payload.PaymentAccountPayload;
|
||||
import haveno.core.payment.payload.PaymentMethod;
|
||||
import haveno.core.payment.payload.UpiAccountPayload;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NonNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public final class UpiAccount extends IfscBasedAccount {
|
||||
|
@ -33,6 +37,11 @@ public final class UpiAccount extends IfscBasedAccount {
|
|||
return new UpiAccountPayload(paymentMethod.getId(), id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
return List.of(PaymentAccountFormField.FieldId.VIRTUAL_PAYMENT_ADDRESS);
|
||||
}
|
||||
|
||||
public void setVirtualPaymentAddress(String virtualPaymentAddress) {
|
||||
((UpiAccountPayload) paymentAccountPayload).setVirtualPaymentAddress(virtualPaymentAddress);
|
||||
}
|
||||
|
|
|
@ -79,6 +79,6 @@ public final class VerseAccount extends PaymentAccount {
|
|||
|
||||
@Override
|
||||
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
throw new RuntimeException("Not implemented");
|
||||
return List.of(PaymentAccountFormField.FieldId.HOLDER_NAME);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,7 +47,12 @@ public final class WesternUnionAccount extends CountryBasedPaymentAccount {
|
|||
|
||||
@Override
|
||||
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
|
||||
throw new RuntimeException("Not implemented");
|
||||
return List.of(
|
||||
PaymentAccountFormField.FieldId.EMAIL,
|
||||
PaymentAccountFormField.FieldId.HOLDER_NAME,
|
||||
PaymentAccountFormField.FieldId.CITY,
|
||||
PaymentAccountFormField.FieldId.STATE
|
||||
);
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
|
|
|
@ -369,7 +369,42 @@ public final class PaymentMethod implements PersistablePayload, Comparable<Payme
|
|||
CASH_APP_ID,
|
||||
PAYPAL_ID,
|
||||
VENMO_ID,
|
||||
PAYSAFE_ID);
|
||||
PAYSAFE_ID,
|
||||
HAL_CASH_ID,
|
||||
MONEY_BEAM_ID,
|
||||
SWISH_ID,
|
||||
POPMONEY_ID,
|
||||
US_POSTAL_MONEY_ORDER_ID,
|
||||
INTERAC_E_TRANSFER_ID,
|
||||
CASH_DEPOSIT_ID,
|
||||
WESTERN_UNION_ID,
|
||||
NATIONAL_BANK_ID,
|
||||
SAME_BANK_ID,
|
||||
SPECIFIC_BANKS_ID,
|
||||
AMAZON_GIFT_CARD_ID,
|
||||
PERFECT_MONEY_ID,
|
||||
ADVANCED_CASH_ID,
|
||||
PAYSERA_ID,
|
||||
NEFT_ID,
|
||||
RTGS_ID,
|
||||
IMPS_ID,
|
||||
UPI_ID,
|
||||
PAYTM_ID,
|
||||
NEQUI_ID,
|
||||
BIZUM_ID,
|
||||
PIX_ID,
|
||||
CAPITUAL_ID,
|
||||
CELPAY_ID,
|
||||
MONESE_ID,
|
||||
SATISPAY_ID,
|
||||
TIKKIE_ID,
|
||||
VERSE_ID,
|
||||
ACH_TRANSFER_ID,
|
||||
DOMESTIC_WIRE_TRANSFER_ID,
|
||||
JAPAN_BANK_ID,
|
||||
ALI_PAY_ID,
|
||||
WECHAT_PAY_ID,
|
||||
PROMPT_PAY_ID);
|
||||
return paymentMethods.stream().filter(paymentMethod -> paymentMethodIds.contains(paymentMethod.getId())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
|
|
@ -1903,6 +1903,41 @@ message PaymentAccountForm {
|
|||
PAYPAL = 17;
|
||||
VENMO = 18;
|
||||
PAYSAFE = 19;
|
||||
CAPITUAL = 20;
|
||||
CELPAY = 21;
|
||||
MONESE = 22;
|
||||
SATISPAY = 23;
|
||||
TIKKIE = 24;
|
||||
VERSE = 25;
|
||||
ACH_TRANSFER = 26;
|
||||
DOMESTIC_WIRE_TRANSFER = 27;
|
||||
JAPAN_BANK = 28;
|
||||
ALI_PAY = 29;
|
||||
WECHAT_PAY = 30;
|
||||
PROMPT_PAY = 31;
|
||||
NEFT = 32;
|
||||
RTGS = 33;
|
||||
IMPS = 34;
|
||||
UPI = 35;
|
||||
PAYTM = 36;
|
||||
NEQUI = 37;
|
||||
BIZUM = 38;
|
||||
PIX = 39;
|
||||
HAL_CASH = 40;
|
||||
MONEY_BEAM = 41;
|
||||
SWISH = 42;
|
||||
POPMONEY = 43;
|
||||
US_POSTAL_MONEY_ORDER = 44;
|
||||
INTERAC_E_TRANSFER = 45;
|
||||
CASH_DEPOSIT = 46;
|
||||
WESTERN_UNION = 47;
|
||||
NATIONAL_BANK = 48;
|
||||
SAME_BANK = 49;
|
||||
SPECIFIC_BANKS = 50;
|
||||
AMAZON_GIFT_CARD = 51;
|
||||
PERFECT_MONEY = 52;
|
||||
ADVANCED_CASH = 53;
|
||||
PAYSERA = 54;
|
||||
}
|
||||
FormId id = 1;
|
||||
repeated PaymentAccountFormField fields = 2;
|
||||
|
@ -1970,6 +2005,7 @@ message PaymentAccountFormField {
|
|||
USERNAME = 57;
|
||||
EMAIL_OR_MOBILE_NR_OR_USERNAME = 58;
|
||||
EMAIL_OR_MOBILE_NR_OR_CASHTAG = 59;
|
||||
VIRTUAL_PAYMENT_ADDRESS = 60;
|
||||
}
|
||||
enum Component {
|
||||
TEXT = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue