feat: 实现站内USDT收银台支付流程

- 后端: payment.go 支付处理(创建订单/回调通知/状态查询/签名算法)
- 后端: 新增公开支付通道API(PublicList,不暴露config)
- 前端: Checkout.vue 收银台页面(倒计时/二维码/支付轮询)
- 前端: Cart.vue 对接动态支付通道,选择bepusdt跳转收银台
- 前端: API添加paymentChannelApi和orderApi支付方法
- 路由: 注册checkout路由和支付相关API
This commit is contained in:
2026-05-26 16:43:31 +08:00
parent 675b365b8b
commit 09f1ee4601
9 changed files with 1002 additions and 19 deletions
+6 -1
View File
@@ -24,6 +24,7 @@ func SetupRoutes(r *gin.Engine) {
uploadHandler := handlers.NewUploadHandler()
bannerHandler := handlers.NewBannerHandler()
paymentChannelHandler := handlers.NewPaymentChannelHandler()
paymentHandler := handlers.NewPaymentHandler()
r.Use(middlewares.CORSMiddleware())
@@ -66,6 +67,8 @@ func SetupRoutes(r *gin.Engine) {
api.GET("/lotteries", lotteryHandler.List)
api.GET("/lotteries/:id", lotteryHandler.GetByID)
api.GET("/settings/public", systemHandler.GetPublicSettings)
api.GET("/payment-channels", paymentChannelHandler.PublicList)
api.POST("/payment/bepusdt/notify", paymentHandler.BepUsdtNotify)
authed := api.Group("")
authed.Use(middlewares.AuthMiddleware())
@@ -106,7 +109,9 @@ func SetupRoutes(r *gin.Engine) {
orders.POST("", orderHandler.Create)
orders.POST("/:id/refund", orderHandler.Refund)
orders.PUT("/:id/cancel", orderHandler.CancelOrder)
orders.PUT("/:id/confirm-receipt", orderHandler.ConfirmReceipt)
orders.PUT("/:id/confirm-receipt", orderHandler.ConfirmReceipt)
orders.POST("/:id/pay", paymentHandler.CreatePayment)
orders.GET("/:id/payment-status", paymentHandler.CheckPaymentStatus)
}
lotteries := authed.Group("/lotteries")