1
This commit is contained in:
@@ -100,6 +100,49 @@ func (a *API) PayStatusQuery(param *PayStatusQueryReq) (*PayStatusQueryResp, err
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
// ClosePay 关闭支付订单
|
||||
func (a *API) ClosePay(param *ClosePayMiniOrder) error {
|
||||
reqParameter := map[string]interface{}{
|
||||
"req_data": utils.Struct2Map(param, "", false),
|
||||
"version": Version3,
|
||||
"req_time": utils.Time2TimeStrByFormat(time.Now(), TimeFormat),
|
||||
}
|
||||
result, err := a.AccessAPISign(PayProdUrl, ClosePayActive, http.MethodPost, "", reqParameter)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if result["code"].(string) != PaySuccess {
|
||||
return fmt.Errorf(result["msg"].(string))
|
||||
}
|
||||
|
||||
return nil
|
||||
//
|
||||
//bodyResult, err := json.Marshal(result["resp_data"])
|
||||
//if err != nil {
|
||||
// return nil, err
|
||||
//}
|
||||
//
|
||||
//resp := &PayStatusQueryResp{}
|
||||
//if err = json.Unmarshal(bodyResult, resp); err != nil {
|
||||
// return nil, err
|
||||
//}
|
||||
//
|
||||
//return resp, nil
|
||||
}
|
||||
|
||||
type ClosePayMiniOrder struct {
|
||||
MerchantNo string `json:"merchant_no"`
|
||||
TermNo string `json:"term_no"`
|
||||
OriginOutTradeNo string `json:"origin_out_trade_no"`
|
||||
OriginTradeNo string `json:"origin_trade_no"`
|
||||
LocationInfo struct {
|
||||
RequestIp string `json:"request_ip"`
|
||||
BaseStation string `json:"base_station"`
|
||||
Location string `json:"location"`
|
||||
} `json:"location_info"`
|
||||
}
|
||||
|
||||
// ScannerPayMicroPay 扫码枪扫码支付
|
||||
func (a *API) ScannerPayMicroPay(param *PayMicroPayReq) (string, string, string, error) {
|
||||
reqParameter := map[string]interface{}{
|
||||
|
||||
Reference in New Issue
Block a user