Skip to content

Commit 4b8f090

Browse files
committed
Bring payment method support for GRPC in-line with
payment methods for the desktop application.
1 parent 050e6b9 commit 4b8f090

33 files changed

+277
-30
lines changed

apitest/src/test/java/haveno/apitest/method/payment/GetPaymentMethodsTest.java

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,71 @@ public void testGetPaymentMethods() {
4040
.stream()
4141
.map(PaymentMethod::getId)
4242
.collect(Collectors.toList());
43-
assertTrue(paymentMethodIds.size() >= 20);
43+
assertTrue(paymentMethodIds.size() >= 55);
44+
45+
// List of expected payment method IDs
46+
List<String> expectedIds = List.of(
47+
"HAL_CASH",
48+
"MONEY_BEAM",
49+
"SWISH",
50+
"POPMONEY",
51+
"US_POSTAL_MONEY_ORDER",
52+
"INTERAC_E_TRANSFER",
53+
"CASH_DEPOSIT",
54+
"CASH_AT_ATM",
55+
"WESTERN_UNION",
56+
"NATIONAL_BANK",
57+
"SAME_BANK",
58+
"SPECIFIC_BANKS",
59+
"AMAZON_GIFT_CARD",
60+
"PERFECT_MONEY",
61+
"ADVANCED_CASH",
62+
"PAYSERA",
63+
"NEFT",
64+
"RTGS",
65+
"IMPS",
66+
"UPI",
67+
"PAYTM",
68+
"NEQUI",
69+
"BIZUM",
70+
"PIX",
71+
"CAPITUAL",
72+
"CELPAY",
73+
"MONESE",
74+
"SATISPAY",
75+
"TIKKIE",
76+
"VERSE",
77+
"ACH_TRANSFER",
78+
"DOMESTIC_WIRE_TRANSFER",
79+
"JAPAN_BANK",
80+
"ALI_PAY",
81+
"WECHAT_PAY",
82+
"PROMPT_PAY",
83+
"PAY_BY_MAIL",
84+
"CARD_LESS_CASH",
85+
"MONEY_GRAM",
86+
"F2F",
87+
"AUSTRALIA_PAYID",
88+
"UPHOLD",
89+
"REVOLUT",
90+
"SEPA",
91+
"SEPA_INSTANT",
92+
"FASTER_PAYMENTS",
93+
"ZELLE",
94+
"BLOCK_CHAINS",
95+
"WISE",
96+
"PAXUM",
97+
"STRIKE",
98+
"SWIFT",
99+
"CASH_APP",
100+
"VENMO",
101+
"PAYPAL",
102+
"PAYSAFE"
103+
);
104+
105+
for (String id : expectedIds) {
106+
assertTrue(paymentMethodIds.contains(id), "Missing payment method: " + id);
107+
}
44108
}
45109

46110
@AfterAll

core/src/main/java/haveno/core/api/model/PaymentAccountForm.java

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,42 @@ public enum FormId {
7878
CASH_APP,
7979
PAYPAL,
8080
VENMO,
81-
PAYSAFE;
81+
PAYSAFE,
82+
HAL_CASH,
83+
MONEY_BEAM,
84+
SWISH,
85+
POPMONEY,
86+
US_POSTAL_MONEY_ORDER,
87+
INTERAC_E_TRANSFER,
88+
CASH_DEPOSIT,
89+
WESTERN_UNION,
90+
NATIONAL_BANK,
91+
SAME_BANK,
92+
SPECIFIC_BANKS,
93+
AMAZON_GIFT_CARD,
94+
PERFECT_MONEY,
95+
ADVANCED_CASH,
96+
PAYSERA,
97+
NEFT,
98+
RTGS,
99+
IMPS,
100+
UPI,
101+
PAYTM,
102+
NEQUI,
103+
BIZUM,
104+
PIX,
105+
CAPITUAL,
106+
CELPAY,
107+
MONESE,
108+
SATISPAY,
109+
TIKKIE,
110+
VERSE,
111+
ACH_TRANSFER,
112+
DOMESTIC_WIRE_TRANSFER,
113+
JAPAN_BANK,
114+
ALI_PAY,
115+
WECHAT_PAY,
116+
PROMPT_PAY;
82117

83118
public static PaymentAccountForm.FormId fromProto(protobuf.PaymentAccountForm.FormId formId) {
84119
return ProtoUtil.enumFromProto(PaymentAccountForm.FormId.class, formId.name());

core/src/main/java/haveno/core/payment/AchTransferAccount.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ public String getMessageForAccountCreation() {
7979

8080
@Override
8181
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
82-
throw new RuntimeException("Not implemented");
82+
return List.of(
83+
PaymentAccountFormField.FieldId.HOLDER_NAME,
84+
PaymentAccountFormField.FieldId.BANK_NAME,
85+
PaymentAccountFormField.FieldId.BRANCH_ID,
86+
PaymentAccountFormField.FieldId.ACCOUNT_NR,
87+
PaymentAccountFormField.FieldId.ACCOUNT_TYPE,
88+
PaymentAccountFormField.FieldId.HOLDER_ADDRESS
89+
);
8390
}
8491
}

core/src/main/java/haveno/core/payment/AdvancedCashAccount.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public List<TradeCurrency> getSupportedCurrencies() {
5858
@NotNull
5959
@Override
6060
public List<PaymentAccountFormField.FieldId> getInputFieldIds() {
61-
throw new RuntimeException("Not implemented");
61+
return List.of(PaymentAccountFormField.FieldId.ACCOUNT_NR);
6262
}
6363

6464
public void setAccountNr(String accountNr) {

core/src/main/java/haveno/core/payment/AmazonGiftCardAccount.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ protected PaymentAccountPayload createPayload() {
6565

6666
@Override
6767
public @NotNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
68-
throw new RuntimeException("Not implemented");
68+
return List.of(PaymentAccountFormField.FieldId.EMAIL_OR_MOBILE, PaymentAccountFormField.FieldId.COUNTRY);
6969
}
7070

7171
public String getEmailOrMobileNr() {

core/src/main/java/haveno/core/payment/BizumAccount.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,6 @@ public String getMessageForAccountCreation() {
7272

7373
@Override
7474
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
75-
throw new RuntimeException("Not implemented");
75+
return List.of(PaymentAccountFormField.FieldId.MOBILE_NR);
7676
}
7777
}

core/src/main/java/haveno/core/payment/CapitualAccount.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public List<TradeCurrency> getSupportedCurrencies() {
5656
@NotNull
5757
@Override
5858
public List<PaymentAccountFormField.FieldId> getInputFieldIds() {
59-
throw new RuntimeException("Not implemented");
59+
return List.of(PaymentAccountFormField.FieldId.ACCOUNT_NR);
6060
}
6161

6262
public void setAccountNr(String accountNr) {

core/src/main/java/haveno/core/payment/CashDepositAccount.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ protected PaymentAccountPayload createPayload() {
4848

4949
@Override
5050
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
51-
throw new RuntimeException("Not implemented");
51+
return List.of(PaymentAccountFormField.FieldId.BANK_ID, PaymentAccountFormField.FieldId.REQUIREMENTS);
5252
}
5353

5454
@Override

core/src/main/java/haveno/core/payment/CelPayAccount.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,6 @@ public String getMessageForAccountCreation() {
7979

8080
@Override
8181
public @NotNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
82-
throw new RuntimeException("Not implemented");
82+
return List.of(PaymentAccountFormField.FieldId.EMAIL);
8383
}
8484
}

core/src/main/java/haveno/core/payment/DomesticWireTransferAccount.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ public String getMessageForAccountCreation() {
7979

8080
@Override
8181
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
82-
throw new RuntimeException("Not implemented");
82+
return List.of(
83+
PaymentAccountFormField.FieldId.HOLDER_NAME,
84+
PaymentAccountFormField.FieldId.BANK_NAME,
85+
PaymentAccountFormField.FieldId.BRANCH_ID,
86+
PaymentAccountFormField.FieldId.ACCOUNT_NR,
87+
PaymentAccountFormField.FieldId.HOLDER_ADDRESS
88+
);
8389
}
8490
}

0 commit comments

Comments
 (0)