Explorar el Código

Update controller/topup_creem.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Little Write hace 5 meses
padre
commit
7e46c43f6f
Se han modificado 1 ficheros con 5 adiciones y 2 borrados
  1. 5 2
      controller/topup_creem.go

+ 5 - 2
controller/topup_creem.go

@@ -36,8 +36,11 @@ func generateCreemSignature(payload string, secret string) string {
 // 验证Creem webhook签名
 func verifyCreemSignature(payload string, signature string, secret string) bool {
 	if secret == "" {
-		log.Printf("Creem webhook secret未配置,跳过签名验证")
-		return true // 如果没有配置secret,跳过验证
+		if setting.CreemTestMode {
+			log.Printf("Creem webhook secret未配置,测试模式下跳过签名验证")
+			return true
+		}
+		return false
 	}
 
 	expectedSignature := generateCreemSignature(payload, secret)