Merge branch 'master' of e.coding.net:rosydev/baseapi
This commit is contained in:
@@ -560,13 +560,38 @@ func (a *API) OrderDisagreeRefund(orderID, refuseReason string) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (a *API) OrderPartRefund(orderID string, removeSkuList []*RefundSku) (err error) {
|
func (a *API) OrderPartRefund(orderID string, removeSkuList []*RefundSku) (err error) {
|
||||||
_, err = a.AccessAPI("order.partrefund", map[string]interface{}{
|
_, err = a.AccessAPI("order.manyTimesPartrefund", map[string]interface{}{
|
||||||
"order_id": orderID,
|
"order_id": orderID,
|
||||||
"products": removeSkuList,
|
"products": removeSkuList,
|
||||||
})
|
})
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//售后 同意用户多次部分取消
|
||||||
|
func (a *API) OrderAgreePartRefund(orderID string) (err error) {
|
||||||
|
_, err = a.AccessAPI("order.agreepartrefund", map[string]interface{}{
|
||||||
|
"order_id": orderID,
|
||||||
|
})
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
//售后 同意退货退款
|
||||||
|
func (a *API) OrderAgreeReturnGoods(orderID string) (err error) {
|
||||||
|
_, err = a.AccessAPI("order.agreereturngoods", map[string]interface{}{
|
||||||
|
"order_id": orderID,
|
||||||
|
})
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
//售后 拒绝退货退款
|
||||||
|
func (a *API) OrderDisagreeReturnGoods(orderID string, reason string) (err error) {
|
||||||
|
_, err = a.AccessAPI("order.disagreereturngoods", map[string]interface{}{
|
||||||
|
"order_id": orderID,
|
||||||
|
"reason": reason,
|
||||||
|
})
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
func (a *API) OrderCheckout(orderID, pickUpCode string) (err error) {
|
func (a *API) OrderCheckout(orderID, pickUpCode string) (err error) {
|
||||||
_, err = a.AccessAPI("order.checkout", map[string]interface{}{
|
_, err = a.AccessAPI("order.checkout", map[string]interface{}{
|
||||||
"order_id": orderID,
|
"order_id": orderID,
|
||||||
|
|||||||
@@ -39,6 +39,8 @@ func (a *Api) SetExpirationTime(expiration int64) {
|
|||||||
|
|
||||||
// NewQBiDa 初始化token
|
// NewQBiDa 初始化token
|
||||||
func NewQBiDa(account, password string, config ...*platformapi.APIConfig) *Api {
|
func NewQBiDa(account, password string, config ...*platformapi.APIConfig) *Api {
|
||||||
|
//account = "18048531223"
|
||||||
|
//password = "18080188338"
|
||||||
if account == "" || password == "" {
|
if account == "" || password == "" {
|
||||||
account = "18048531223"
|
account = "18048531223"
|
||||||
password = "18080188338"
|
password = "18080188338"
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package q_bida
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
|
"git.rosy.net.cn/jx-callback/globals"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@@ -41,10 +42,15 @@ func (a *Api) GetToken() error {
|
|||||||
|
|
||||||
// GetExpressPrice 获取快递费用
|
// GetExpressPrice 获取快递费用
|
||||||
func (a *Api) GetExpressPrice(param *GetExpressPriceReq) (*GetExpressPriceRes, error) {
|
func (a *Api) GetExpressPrice(param *GetExpressPriceReq) (*GetExpressPriceRes, error) {
|
||||||
|
globals.SugarLogger.Debug("进入GetExpressPrice")
|
||||||
if err := a.CheckTokenExpiration(); err != nil {
|
if err := a.CheckTokenExpiration(); err != nil {
|
||||||
|
globals.SugarLogger.Debug("打印err1===================", err)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
result, err := a.AccessInfo(BaseQBiDaUrl, GetWayBailMoneyUrl, http.MethodPost, utils.Struct2FlatMap(param))
|
result, err := a.AccessInfo(BaseQBiDaUrl, GetWayBailMoneyUrl, http.MethodPost, utils.Struct2FlatMap(param))
|
||||||
|
globals.SugarLogger.Debug("打印result===================", result)
|
||||||
|
globals.SugarLogger.Debug("打印err2===================", err)
|
||||||
if err != nil && !strings.Contains(err.Error(), "成功") {
|
if err != nil && !strings.Contains(err.Error(), "成功") {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -56,6 +62,7 @@ func (a *Api) GetExpressPrice(param *GetExpressPriceReq) (*GetExpressPriceRes, e
|
|||||||
if resultData.Code != 0 {
|
if resultData.Code != 0 {
|
||||||
return nil, errors.New(resultData.Msg)
|
return nil, errors.New(resultData.Msg)
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debug("返回前打印resultData===================", resultData)
|
||||||
return resultData, nil
|
return resultData, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,11 +92,15 @@ func (a *Api) CancelOrder(param *CancelOrderReq) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
result, err := a.AccessInfo(BaseQBiDaUrl, CancelWayBailOrderUrl, http.MethodPost, utils.Struct2FlatMap(param))
|
result, err := a.AccessInfo(BaseQBiDaUrl, CancelWayBailOrderUrl, http.MethodPost, utils.Struct2FlatMap(param))
|
||||||
|
globals.SugarLogger.Debug("err= =====ded==================", err)
|
||||||
|
|
||||||
if err != nil && !strings.Contains(err.Error(), "成功") {
|
if err != nil && !strings.Contains(err.Error(), "成功") {
|
||||||
return err
|
err = nil //TODO 测试部分,记得删除
|
||||||
|
//return err
|
||||||
}
|
}
|
||||||
|
|
||||||
resultData := &PublicParams{}
|
resultData := &PublicParams{}
|
||||||
|
globals.SugarLogger.Debug("resultData===================", resultData.Code, resultData.Msg)
|
||||||
if err := utils.Map2StructByJson(result, resultData, false); err != nil {
|
if err := utils.Map2StructByJson(result, resultData, false); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,8 +151,8 @@ type OrderDetail struct {
|
|||||||
InsuranceFee float64 `json:"insuranceFee"` // 保价费元
|
InsuranceFee float64 `json:"insuranceFee"` // 保价费元
|
||||||
IsForward bool `json:"isForward"` // 是否转寄单0否1是(转寄单额外收取50%运费)
|
IsForward bool `json:"isForward"` // 是否转寄单0否1是(转寄单额外收取50%运费)
|
||||||
IsLimit bool `json:"isLimit"` // 是否超限0否1是
|
IsLimit bool `json:"isLimit"` // 是否超限0否1是
|
||||||
OriginalFee int `json:"originalFee"` // 官方原价
|
OriginalFee float64 `json:"originalFee"` // 官方原价
|
||||||
OtherFee int `json:"otherFee"` // 其他费用
|
OtherFee float64 `json:"otherFee"` // 其他费用
|
||||||
OverWeightStatus int `json:"overWeightStatus"` // 超重状态
|
OverWeightStatus int `json:"overWeightStatus"` // 超重状态
|
||||||
PackageNum int `json:"packageNum"` // 包裹数
|
PackageNum int `json:"packageNum"` // 包裹数
|
||||||
ReceiveAddress string `json:"receiveAddress"` // 收件人地址
|
ReceiveAddress string `json:"receiveAddress"` // 收件人地址
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package tonglianpayapi
|
|||||||
import (
|
import (
|
||||||
"crypto/md5"
|
"crypto/md5"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"git.rosy.net.cn/jx-callback/globals"
|
||||||
"net/http"
|
"net/http"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -204,13 +205,19 @@ func (a *API) PayRefund(param *PayRefundParam) (result *PayRefundResult, err err
|
|||||||
params := make(map[string]interface{})
|
params := make(map[string]interface{})
|
||||||
params["trxamt"] = param.Trxamt
|
params["trxamt"] = param.Trxamt
|
||||||
params["reqsn"] = param.Reqsn
|
params["reqsn"] = param.Reqsn
|
||||||
// params["oldreqsn"] = param.OldReqsn
|
//params["oldreqsn"] = param.OldReqsn
|
||||||
params["remark"] = param.Remark
|
params["remark"] = param.Remark
|
||||||
params["oldtrxid"] = param.OldTrxID
|
params["oldtrxid"] = param.OldTrxID
|
||||||
retVal, err := a.AccessAPI("unitorder/refund", params)
|
retVal, err := a.AccessAPI("unitorder/refund", params)
|
||||||
|
|
||||||
|
globals.SugarLogger.Debug("PayRefund打印输出 err", err)
|
||||||
|
globals.SugarLogger.Debug("PayRefund打印输出 trxamt", params["trxamt"])
|
||||||
|
globals.SugarLogger.Debug("PayRefund打印输出 oldtrxid", params["oldtrxid"]) //nil
|
||||||
|
globals.SugarLogger.Debug("PayRefund打印输出 oldreqsn", params["oldreqsn"])
|
||||||
if err == nil {
|
if err == nil {
|
||||||
utils.Map2StructByJson(retVal, &result, false)
|
utils.Map2StructByJson(retVal, &result, false)
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debug("PayRefund打印输出 result", result)
|
||||||
return result, err
|
return result, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user