support wechat pay grpc api

This commit is contained in:
woodser 2025-06-19 09:15:12 -04:00
parent 9a5893b5d5
commit 80faa66fd6
No known key found for this signature in database
GPG key ID: 55A10DD48ADEE5EF
4 changed files with 13 additions and 3 deletions

View file

@ -78,7 +78,8 @@ public final class PaymentAccountForm implements PersistablePayload {
CASH_APP,
PAYPAL,
VENMO,
PAYSAFE;
PAYSAFE,
WECHAT_PAY;
public static PaymentAccountForm.FormId fromProto(protobuf.PaymentAccountForm.FormId formId) {
return ProtoUtil.enumFromProto(PaymentAccountForm.FormId.class, formId.name());

View file

@ -38,6 +38,13 @@ public final class WeChatPayAccount extends PaymentAccount {
new TraditionalCurrency("GBP")
);
private static final List<PaymentAccountFormField.FieldId> INPUT_FIELD_IDS = List.of(
PaymentAccountFormField.FieldId.ACCOUNT_NAME,
PaymentAccountFormField.FieldId.ACCOUNT_NR,
PaymentAccountFormField.FieldId.TRADE_CURRENCIES,
PaymentAccountFormField.FieldId.SALT
);
public WeChatPayAccount() {
super(PaymentMethod.WECHAT_PAY);
}
@ -54,7 +61,7 @@ public final class WeChatPayAccount extends PaymentAccount {
@Override
public @NonNull List<PaymentAccountFormField.FieldId> getInputFieldIds() {
throw new RuntimeException("Not implemented");
return INPUT_FIELD_IDS;
}
public void setAccountNr(String accountNr) {

View file

@ -369,7 +369,8 @@ public final class PaymentMethod implements PersistablePayload, Comparable<Payme
CASH_APP_ID,
PAYPAL_ID,
VENMO_ID,
PAYSAFE_ID);
PAYSAFE_ID,
WECHAT_PAY_ID);
return paymentMethods.stream().filter(paymentMethod -> paymentMethodIds.contains(paymentMethod.getId())).collect(Collectors.toList());
}

View file

@ -1903,6 +1903,7 @@ message PaymentAccountForm {
PAYPAL = 17;
VENMO = 18;
PAYSAFE = 19;
WECHAT_PAY = 20;
}
FormId id = 1;
repeated PaymentAccountFormField fields = 2;