32 lines
763 B
Go
32 lines
763 B
Go
package jdshopapi
|
|
|
|
import (
|
|
"io/ioutil"
|
|
"net/http"
|
|
|
|
"git.rosy.net.cn/baseapi/utils"
|
|
)
|
|
|
|
type CallBackResult struct {
|
|
OrderCreateTime string `json:"orderCreateTime"`
|
|
OrderType string `json:"orderType"`
|
|
OrderPaymentType string `json:"orderPaymentType"`
|
|
VenderID string `json:"venderId"`
|
|
OrderStatus string `json:"orderStatus"`
|
|
OrderID string `json:"orderId"`
|
|
}
|
|
|
|
func (a *API) GetCallbackMsg(request *http.Request) (call *CallBackResult, err error) {
|
|
data, err := ioutil.ReadAll(request.Body)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
values, err := utils.HTTPBody2Values(data, false)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
mapData := utils.URLValues2Map(values)
|
|
utils.Map2StructByJson(mapData, &call, false)
|
|
return call, err
|
|
}
|