support alipay grpc api

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

View file

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

View file

@ -60,6 +60,13 @@ public final class AliPayAccount extends PaymentAccount {
new TraditionalCurrency("ZAR")
);
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 AliPayAccount() {
super(PaymentMethod.ALI_PAY);
setSingleTradeCurrency(SUPPORTED_CURRENCIES.get(0));
@ -77,7 +84,7 @@ public final class AliPayAccount 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

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

View file

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