GetPartner
This commit is contained in:
parent
9e81803b54
commit
91a71ef339
20
unify/pay.go
20
unify/pay.go
|
@ -151,6 +151,26 @@ func (p *Pay) GetPartnerOrder(outTradeNo string) (map[string]interface{}, error)
|
||||||
return rsp.Data, nil
|
return rsp.Data, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p *Pay) GetPartner(id int64) (map[string]interface{}, error) {
|
||||||
|
reqUrl := fmt.Sprintf("%s/api/pay/partner?id=%d", p.address, id)
|
||||||
|
result, err := util.HttpGet(reqUrl, map[string]string{
|
||||||
|
"x-token": p.token,
|
||||||
|
})
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
var rsp CommonResponse
|
||||||
|
if err := json.Unmarshal([]byte(result), &rsp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if rsp.Code != 0 {
|
||||||
|
return nil, fmt.Errorf("%d:%s", rsp.Code, rsp.Message)
|
||||||
|
}
|
||||||
|
|
||||||
|
return rsp.Data, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (p *Pay) RefundOrder(req *RefundOrderReq) error {
|
func (p *Pay) RefundOrder(req *RefundOrderReq) error {
|
||||||
if req.OutTradeNo == "" {
|
if req.OutTradeNo == "" {
|
||||||
errors.New("outTradeNo is nil")
|
errors.New("outTradeNo is nil")
|
||||||
|
|
Loading…
Reference in New Issue