优化交易状态检查逻辑
This commit is contained in:
@@ -107,23 +107,24 @@ func (s *SftClient) QueryTrade(req *QueryTradeReq) (*QueryTradeResp, error) {
|
||||
}
|
||||
|
||||
type PaymentScanPayReq struct {
|
||||
Subject string `json:"subject"`
|
||||
Body string `json:"body"`
|
||||
Amount int64 `json:"amount"`
|
||||
Currency string `json:"currency"`
|
||||
ClientIp string `json:"clientIp"`
|
||||
MchOrderNo string `json:"mchOrderNo"`
|
||||
StoreId *string `json:"storeId,omitempty"`
|
||||
RouteNo *string `json:"routeNo,omitempty"`
|
||||
HbFqNum *int `json:"hbFqNum,omitempty"`
|
||||
HbFqPercent *int `json:"hbFqPercent,omitempty"`
|
||||
BuyerRemark *string `json:"buyerRemark,omitempty"`
|
||||
NotifyUrl *string `json:"notifyUrl,omitempty"`
|
||||
ReturnUrl *string `json:"returnUrl,omitempty"`
|
||||
ExpiredTime *int `json:"expiredTime,omitempty"`
|
||||
OrderTimeout *string `json:"orderTimeout,omitempty"`
|
||||
ExtParam *string `json:"extParam,omitempty"`
|
||||
LimitPay *int `json:"limitPay,omitempty"`
|
||||
Subject string `json:"subject"`
|
||||
Body string `json:"body"`
|
||||
Amount int64 `json:"amount"`
|
||||
Currency string `json:"currency"`
|
||||
PayType SftPayType `json:"payType"`
|
||||
ClientIp string `json:"clientIp"`
|
||||
MchOrderNo string `json:"mchOrderNo"`
|
||||
StoreId *string `json:"storeId,omitempty"`
|
||||
RouteNo *string `json:"routeNo,omitempty"`
|
||||
HbFqNum *int `json:"hbFqNum,omitempty"`
|
||||
HbFqPercent *int `json:"hbFqPercent,omitempty"`
|
||||
BuyerRemark *string `json:"buyerRemark,omitempty"`
|
||||
NotifyUrl *string `json:"notifyUrl,omitempty"`
|
||||
ReturnUrl *string `json:"returnUrl,omitempty"`
|
||||
ExpiredTime *int `json:"expiredTime,omitempty"`
|
||||
OrderTimeout *string `json:"orderTimeout,omitempty"`
|
||||
ExtParam *string `json:"extParam,omitempty"`
|
||||
LimitPay *int `json:"limitPay,omitempty"`
|
||||
}
|
||||
|
||||
type PaymentH5PayReq struct {
|
||||
@@ -269,7 +270,7 @@ func call[T any](s *SftClient, url string, req any) (*T, error) {
|
||||
}
|
||||
request.Header.Set("Content-Type", "application/json")
|
||||
|
||||
if env.LogHttpDump == true {
|
||||
if env.DebugHttpDump == true {
|
||||
reqDump, err := httputil.DumpRequest(request, true)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("请求内容转储失败:%w", err)
|
||||
@@ -282,7 +283,7 @@ func call[T any](s *SftClient, url string, req any) (*T, error) {
|
||||
return nil, fmt.Errorf("请求失败:%w", err)
|
||||
}
|
||||
|
||||
if env.LogHttpDump == true {
|
||||
if env.DebugHttpDump == true {
|
||||
respDump, err := httputil.DumpResponse(response, true)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("响应内容转储失败:%w", err)
|
||||
@@ -431,7 +432,7 @@ type SftTradeState string
|
||||
|
||||
const (
|
||||
SftInit SftTradeState = "INIT"
|
||||
SftTradeAWAIT SftTradeState = "TRADE_WAIT"
|
||||
SftTradeAwait SftTradeState = "TRADE_WAIT"
|
||||
SftTradeSuccess SftTradeState = "TRADE_SUCCESS"
|
||||
SftTradeFail SftTradeState = "TRADE_FAIL"
|
||||
SftTradeCancel SftTradeState = "TRADE_CANCEL"
|
||||
|
||||
Reference in New Issue
Block a user