重构账户与商户服务模块
- 移除旧版 account.go 文件中的账户服务实现 - 新增聚合扫码关单、退款、撤销等接口实现 - 新增聚合被扫、主扫及加密接口实现 - 新增交易查询与支付宝吱口令申请接口 - 重构统一退货及退货查询接口,优化泛型使用 - 移除旧版商户进件相关接口实现 - 调整部分服务结构体命名与参数传递方式 - 统一请求时间格式并优化代码结构
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package transpreorder
|
||||
|
||||
import (
|
||||
"github.com/black1552/lkl_sdk/consts"
|
||||
"github.com/black1552/lkl_sdk/lklsdk/common"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
type TransPreorder struct {
|
||||
client *common.Client[TransPreorderResponse]
|
||||
}
|
||||
|
||||
func NewTransPreorderApi(client *common.Client[TransPreorderResponse]) *TransPreorder {
|
||||
return &TransPreorder{client: client}
|
||||
}
|
||||
|
||||
func (tp *TransPreorder) TransPreorder(reqData *TransPreorderRequestData) (*TransPreorderResponse, error) {
|
||||
// 构建请求结构体
|
||||
request := &TransPreorderRequest{
|
||||
ReqTime: gtime.Now().Format("YmdHis"),
|
||||
Version: "3.0",
|
||||
ReqData: reqData,
|
||||
}
|
||||
return tp.client.DoRequest(consts.BASE_URL+consts.LKL_DCP_TRANS_PREORDER_URL, request)
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package transpreorder
|
||||
|
||||
type TransPreorderRequest struct {
|
||||
ReqTime string `json:"req_time"`
|
||||
Version string `json:"version"`
|
||||
ReqData *TransPreorderRequestData `json:"req_data"`
|
||||
}
|
||||
|
||||
type TransPreorderRequestData struct {
|
||||
OutTradeNo string `json:"out_trade_no"`
|
||||
TotalAmount string `json:"total_amount"`
|
||||
Subject string `json:"subject"`
|
||||
Body string `json:"body"`
|
||||
NotifyUrl string `json:"notify_url"`
|
||||
ExpireTime string `json:"expire_time"`
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package transpreorder
|
||||
|
||||
type TransPreorderResponse struct {
|
||||
}
|
||||
Reference in New Issue
Block a user