fix: Waffo webhook 支持 GET 探测,避免浏览器打开 404
仪表盘/浏览器用 GET 校验 URL 时返回 ready;支付事件仍走 POST。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
ac31cc059a
commit
f00ea7e873
5 files changed
+16
-5
No files matched your search
@@ -113,6 +113,16 @@ func (ctrl *OrderController) PaymentWebhook(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, gin.H{"code": 0, "message": "Webhook processed"})
|
||||
}
|
||||
|
||||
// WaffoWebhookReady GET/HEAD probe for dashboard URL checks (browser opens as GET). // Logan.Li
|
||||
func (ctrl *OrderController) WaffoWebhookReady(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"code": 0,
|
||||
"message": "waffo webhook ready",
|
||||
"methods": []string{"POST"},
|
||||
"hint": "Payment events must POST JSON with order_no / orderNo",
|
||||
})
|
||||
}
|
||||
|
||||
// WaffoWebhook accepts loosely-shaped Waffo payment events and maps to PaymentWebhook. // Logan.Li
|
||||
func (ctrl *OrderController) WaffoWebhook(c *gin.Context) {
|
||||
body, err := io.ReadAll(c.Request.Body)
|
||||
|
||||
Reference in new issue
Block a user