- mtwm.GetOrderRefundDetail
This commit is contained in:
@@ -55,12 +55,45 @@ const (
|
||||
UserApplyCancelWaitMinute = 30 // 用户申请退款后,商家未在30分钟内(大连锁商家为3小时内)处理退款请求,系统将自动同意退款
|
||||
)
|
||||
|
||||
const (
|
||||
RefundTypeAll = 1
|
||||
RefundTypePart = 2
|
||||
)
|
||||
|
||||
type RefundSku struct {
|
||||
AppFoodCode string `json:"app_food_code"`
|
||||
SkuID string `json:"sku_id,omitempty"`
|
||||
Count int `json:"count"`
|
||||
}
|
||||
|
||||
type RefundSkuDetail struct {
|
||||
AppFoodCode string `json:"app_food_code"`
|
||||
BoxNum float32 `json:"box_num"`
|
||||
BoxPrice float32 `json:"box_price"`
|
||||
Count int `json:"count"`
|
||||
FoodName string `json:"food_name"`
|
||||
FoodPrice float32 `json:"food_price"`
|
||||
OriginFoodPrice float32 `json:"origin_food_price"`
|
||||
RefundPrice float32 `json:"refund_price"`
|
||||
SkuID string `json:"sku_id"`
|
||||
Spec string `json:"spec"`
|
||||
}
|
||||
|
||||
type RefundOrderDetail struct {
|
||||
ApplyReason string `json:"apply_reason"`
|
||||
ApplyType int `json:"apply_type"`
|
||||
CTime int64 `json:"ctime"`
|
||||
Money float32 `json:"money"`
|
||||
OrderID int64 `json:"order_id"`
|
||||
Pictures []string `json:"pictures"`
|
||||
RefundType int `json:"refund_type"`
|
||||
ResReason string `json:"res_reason"`
|
||||
ResType int `json:"res_type"`
|
||||
UTime int64 `json:"utime"`
|
||||
WmAppRetailForOrderPartRefundList []*RefundSkuDetail `json:"wmAppRetailForOrderPartRefundList"`
|
||||
WmOrderIDView int64 `json:"wm_order_id_view"`
|
||||
}
|
||||
|
||||
func (a *API) OrderReceived(orderID int64) (err error) {
|
||||
_, err = a.AccessAPI("order/poi_received", true, map[string]interface{}{
|
||||
KeyOrderID: orderID,
|
||||
@@ -195,3 +228,18 @@ func (a *API) OrderLogisticsChange2Self(orderID int64) (err error) {
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
func (a *API) GetOrderRefundDetail(orderID int64, refundType int) (refundOrderDetail *RefundOrderDetail, err error) {
|
||||
params := map[string]interface{}{
|
||||
"wm_order_id_view": orderID,
|
||||
}
|
||||
if refundType > 0 {
|
||||
params["refund_type"] = refundType
|
||||
}
|
||||
result, err := a.AccessAPI("ecommerce/order/getOrderRefundDetail", true, params)
|
||||
if err == nil {
|
||||
utils.Map2StructByJson(result.([]interface{})[0], &refundOrderDetail, false)
|
||||
return refundOrderDetail, nil
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user