Skip to content

Commit 342efbf

Browse files
committed
support wechat pay grpc api
1 parent 32148e7 commit 342efbf

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ public enum FormId {
7878
CASH_APP,
7979
PAYPAL,
8080
VENMO,
81-
PAYSAFE;
81+
PAYSAFE,
82+
WECHAT_PAY;
8283

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

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ public final class WeChatPayAccount extends PaymentAccount {
3838
new TraditionalCurrency("GBP")
3939
);
4040

41+
private static final List<PaymentAccountFormField.FieldId> INPUT_FIELD_IDS = List.of(
42+
PaymentAccountFormField.FieldId.ACCOUNT_NAME,
43+
PaymentAccountFormField.FieldId.ACCOUNT_NR,
44+
PaymentAccountFormField.FieldId.TRADE_CURRENCIES,
45+
PaymentAccountFormField.FieldId.SALT
46+
);
47+
4148
public WeChatPayAccount() {
4249
super(PaymentMethod.WECHAT_PAY);
4350
}
@@ -54,7 +61,7 @@ protected PaymentAccountPayload createPayload() {
5461

5562
@Override
5663
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
57-
throw new RuntimeException("Not implemented");
64+
return INPUT_FIELD_IDS;
5865
}
5966

6067
public void setAccountNr(String accountNr) {

core/src/main/java/haveno/core/payment/payload/PaymentMethod.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,8 @@ public static List<PaymentMethod> getPaymentMethods() {
369369
CASH_APP_ID,
370370
PAYPAL_ID,
371371
VENMO_ID,
372-
PAYSAFE_ID);
372+
PAYSAFE_ID,
373+
WECHAT_PAY_ID);
373374
return paymentMethods.stream().filter(paymentMethod -> paymentMethodIds.contains(paymentMethod.getId())).collect(Collectors.toList());
374375
}
375376

proto/src/main/proto/pb.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1903,6 +1903,7 @@ message PaymentAccountForm {
19031903
PAYPAL = 17;
19041904
VENMO = 18;
19051905
PAYSAFE = 19;
1906+
WECHAT_PAY = 20;
19061907
}
19071908
FormId id = 1;
19081909
repeated PaymentAccountFormField fields = 2;

0 commit comments

Comments
 (0)