Merge branch 'master' of e.coding.net:rosydev/baseapi
This commit is contained in:
@@ -10,9 +10,9 @@ import (
|
||||
|
||||
var (
|
||||
//沙箱环境
|
||||
api = New("ccba8bd4a2d54a2fb6df97e87979f303", "2815a7a1f8e3405d81fd6263683ec4e7", "910a0dfd12bb4bc0acec147bcb1ae246")
|
||||
//api = New("ccba8bd4a2d54a2fb6df97e87979f303", "2815a7a1f8e3405d81fd6263683ec4e7", "910a0dfd12bb4bc0acec147bcb1ae246")
|
||||
//正式环境
|
||||
//api *API = New("55c4542ae60e4d348edcfc93b06dd302", "76b362c06b1b4baa9e47bab6387a5356", "8d8464e7c9354c1e88a3f5afa2a7922e")
|
||||
api = New("55c4542ae60e4d348edcfc93b06dd302", "76b362c06b1b4baa9e47bab6387a5356", "8d8464e7c9354c1e88a3f5afa2a7922e")
|
||||
sugarLogger *zap.SugaredLogger
|
||||
)
|
||||
|
||||
@@ -64,9 +64,9 @@ func TestGetWaybillPrice(t *testing.T) {
|
||||
//发布订单
|
||||
func TestAddOrder(t *testing.T) {
|
||||
param := &AddOrderReq{
|
||||
PriceToken: "7cef537722d647afa2274563cc886812",
|
||||
OrderPrice: "10.00",
|
||||
BalancePayMoney: "10.00",
|
||||
PriceToken: "0215e844d582477191dfc5f6cd7dcb31",
|
||||
OrderPrice: "9.50",
|
||||
BalancePayMoney: "8.07",
|
||||
Receiver: "测试订单",
|
||||
ReceiverPhone: "15680424816,9776",
|
||||
CallbackUrl: uuCallbackURL,
|
||||
@@ -90,7 +90,7 @@ func TestGetOrderDetail(t *testing.T) {
|
||||
|
||||
//取消订单
|
||||
func TestCancelOrder(t *testing.T) {
|
||||
err := api.CancelOrder("230128143210047000011744", "测试取消")
|
||||
err := api.CancelOrder("23013118111004700001004861", "测试取消")
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"math/rand"
|
||||
"net/http"
|
||||
"sort"
|
||||
@@ -13,10 +14,10 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
//BaseURL = "https://openapi.uupt.com/v2_0" //正式环境
|
||||
BaseURL = "http://openapi.test.uupt.com/v2_0" //沙箱环境测试
|
||||
ReturnSuccess = "ok" //返回成功
|
||||
ReturnFail = "fail" //返回失败
|
||||
BaseURL = "https://openapi.uupt.com/v2_0" //正式环境
|
||||
//BaseURL = "http://openapi.test.uupt.com/v2_0" //沙箱环境测试
|
||||
ReturnSuccess = "ok" //返回成功
|
||||
ReturnFail = "fail" //返回失败
|
||||
signKey = "sign"
|
||||
secretKey = "secret"
|
||||
letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
|
||||
@@ -38,6 +39,7 @@ func New(appID, appKey, openID string, config ...*platformapi.APIConfig) *API {
|
||||
if appID == "" {
|
||||
return nil
|
||||
}
|
||||
globals.SugarLogger.Debugf("appID====%s,appKey====%s,openID====%s", appID, appKey, openID)
|
||||
return &API{
|
||||
appid: appID,
|
||||
appKey: appKey,
|
||||
@@ -76,6 +78,8 @@ func (a *API) AccessAPI(baseUrl, actionApi, method string, bizParams map[string]
|
||||
//}
|
||||
//完整请求url
|
||||
fullPath := utils.GenerateGetURL(baseUrl, actionApi, nil)
|
||||
globals.SugarLogger.Debugf("uupt fullPath======%s", fullPath)
|
||||
globals.SugarLogger.Debugf("uupt a.appid=====%s", a.appid)
|
||||
//发送请求
|
||||
sendUrl := func() *http.Request {
|
||||
var request *http.Request
|
||||
|
||||
Reference in New Issue
Block a user