wangchuanjin 4 hónapja
szülő
commit
6f1bd0ac2a

+ 6 - 3
src/jfw/modules/subscribepay/src/entity/bidCreditReport/bidCreditReport.go

@@ -103,12 +103,15 @@ func (b *bidCreditReport) EntHasRisk(userId, certNo string) bool {
 func (b *bidCreditReport) CallBack(from url.Values) bool {
 	log.Println("芝麻企业信用服务变化通知", from)
 	verifySign := b.Client.VerifySign(from)
-	go util.Mgo_log.Save("bidcredit_report_log", map[string]interface{}{
+	logData := map[string]interface{}{
 		"createTime": time.Now().Unix(),
 		"from":       from,
 		"method":     "zhima.credit.ep.acceptance.notify",
-		"verifySign": verifySign,
-	})
+	}
+	if verifySign != nil {
+		logData["verifySign"] = verifySign.Error()
+	}
+	go util.Mgo_log.Save("bidcredit_report_log", logData)
 	if verifySign != nil {
 		log.Println(from, "芝麻企业信用服务变化通知验签失败", verifySign)
 		return false

+ 7 - 0
src/jfw/modules/subscribepay/src/entity/bidCreditReport/bidCreditReport_test.go

@@ -2,6 +2,7 @@ package bidCreditReport
 
 import (
 	"log"
+	"net/url"
 	"testing"
 	"time"
 )
@@ -39,3 +40,9 @@ func TestCreate(t *testing.T) {
 func TestNewOrderWarn(t *testing.T) {
 	BidCreditReport.NewOrderWarn()
 }
+
+func TestCallBack(t *testing.T) {
+	from := make(url.Values)
+	log.Println(BidCreditReport.CallBack(from))
+	time.Sleep(time.Minute)
+}