22 lines
565 B
Go
22 lines
565 B
Go
package payment
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
|
|
"xk-of-api/api/payment/v1"
|
|
"xk-of-api/internal/response"
|
|
"xk-of-api/internal/service"
|
|
)
|
|
|
|
// Notify 接收支付渠道回调,后续在 service 中扩展验签和状态流转。
|
|
func (c *ControllerV1) Notify(ctx context.Context, req *v1.NotifyReq) (res *v1.NotifyRes, err error) {
|
|
if req.Channel == "" {
|
|
response.Error(ctx, 400, "支付渠道不能为空")
|
|
return nil, nil
|
|
}
|
|
response.Success(ctx, service.Order.Notify(req.Channel, g.RequestFromCtx(ctx).GetMap()))
|
|
return nil, nil
|
|
}
|