用新京东回调接口

GetAPIByAppKey
This commit is contained in:
gazebo
2019-12-09 11:05:00 +08:00
parent 992711c5c2
commit 7995f507b1
3 changed files with 21 additions and 35 deletions

View File

@@ -149,7 +149,7 @@ func (p *PurchaseHandler) OrderDetail2Financial(orderData map[string]interface{}
}
}
}
globals.SugarLogger.Debug(utils.Format4Output(orderFinancial.Discounts, false))
// globals.SugarLogger.Debug(utils.Format4Output(orderFinancial.Discounts, false))
}
order1, err2 := getAPI("").OrderShoudSettlementService(orderFinancial.VendorOrderID)
if err = err2; err == nil {

View File

@@ -26,14 +26,14 @@ func getAPI(appOrgCode string) (apiObj *jdapi.API) {
return partner.CurAPIManager.GetAPI(model.VendorIDJD, appOrgCode).(*jdapi.API)
}
func GetAPIByToken(token string) (apiObj *jdapi.API) {
if token == "" {
func GetAPIByAppKey(appKey string) (apiObj *jdapi.API) {
if appKey == "" {
apiObj = getAPI("")
} else {
apiList := partner.CurAPIManager.GetAppOrgCodeList(model.VendorIDJD)
for _, v := range apiList {
jdAPI := partner.CurAPIManager.GetAPI(model.VendorIDJD, v).(*jdapi.API)
if jdAPI.GetToken() == token {
if jdAPI.GetAppKey() == appKey {
apiObj = jdAPI
break
}