feat: payment refund

This commit is contained in:
zzw
2026-10-07 09:28:12 +08:00
parent a39ab003f4
commit a4c04b9c83
17 changed files with 258 additions and 116 deletions
@@ -7,7 +7,7 @@ package server
import (
"context"
"lone-services/rpc/payment/pb"
payment "lone-services/rpc/payment/pb"
"lone-services/services/payment/internal/logic"
"lone-services/services/payment/internal/svc"
)
@@ -23,31 +23,26 @@ func NewPaymentServer(svcCtx *svc.ServiceContext) *PaymentServer {
}
}
// 发起支付
func (s *PaymentServer) Pay(ctx context.Context, in *payment.PayReq) (*payment.Response, error) {
l := logic.NewPayLogic(ctx, s.svcCtx)
return l.Pay(in)
}
// 查询支付状态
func (s *PaymentServer) Query(ctx context.Context, in *payment.QueryReq) (*payment.Response, error) {
l := logic.NewQueryLogic(ctx, s.svcCtx)
return l.Query(in)
}
// 关闭支付
func (s *PaymentServer) Close(ctx context.Context, in *payment.CloseReq) (*payment.Response, error) {
l := logic.NewCloseLogic(ctx, s.svcCtx)
return l.Close(in)
}
// 退款
func (s *PaymentServer) Refund(ctx context.Context, in *payment.RefundReq) (*payment.Response, error) {
l := logic.NewRefundLogic(ctx, s.svcCtx)
return l.Refund(in)
}
// 支付回调(由 BFF/网关转发原始 body + headers)
func (s *PaymentServer) Notify(ctx context.Context, in *payment.NotifyReq) (*payment.Response, error) {
l := logic.NewNotifyLogic(ctx, s.svcCtx)
return l.Notify(in)