chore: 并入 iotlcm-admin-svr 历史到 admin-svr/(原提交 49818c6)
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
package pay
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1 "git.5iot.com/iotlcm-public/iotlcm-admin-svr/api/pay/v1"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/service"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) AlipayPay(ctx context.Context, req *v1.AlipayPayReq) (res *v1.AlipayPayRes, err error) {
|
||||
out, err := service.Alipay().Pay(ctx, &req.AlipayPayInput)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
res = &v1.AlipayPayRes{AlipayPayOutput: *out}
|
||||
return res, nil
|
||||
}
|
||||
|
||||
func (c *ControllerV1) AlipayNotify(ctx context.Context, req *v1.AlipayNotifyReq) (res *v1.AlipayNotifyRes, err error) {
|
||||
out, err := service.Alipay().Notify(ctx, &req.AlipayNotifyInput)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
res = &v1.AlipayNotifyRes{AlipayNotifyOutput: *out}
|
||||
return res, nil
|
||||
}
|
||||
|
||||
func (c *ControllerV1) AlipayReturn(ctx context.Context, req *v1.AlipayReturnReq) (res *v1.AlipayReturnRes, err error) {
|
||||
out, err := service.Alipay().Return(ctx, &req.AlipayReturnInput)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
res = &v1.AlipayReturnRes{AlipayReturnOutput: *out}
|
||||
return res, nil
|
||||
}
|
||||
|
||||
func (c *ControllerV1) AlipayTradeQuery(ctx context.Context, req *v1.AlipayTradeQueryReq) (res *v1.AlipayTradeQueryRes, err error) {
|
||||
out, err := service.Alipay().Query(ctx, &req.AlipayTradeQueryInput)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
res = &v1.AlipayTradeQueryRes{AlipayTradeQueryOutput: *out}
|
||||
return res, nil
|
||||
}
|
||||
|
||||
func (c *ControllerV1) AlipayRefund(ctx context.Context, req *v1.AlipayRefundReq) (res *v1.AlipayRefundRes, err error) {
|
||||
out, err := service.Alipay().Refund(ctx, &req.AlipayRefundInput)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
res = &v1.AlipayRefundRes{AlipayRefundOutput: *out}
|
||||
return res, nil
|
||||
}
|
||||
Reference in New Issue
Block a user