feat: register direct payment routes

Wire Alipay and WxPay direct payment endpoints and add provider payload storage to top-up records.
This commit is contained in:
zizi 2026-05-20 15:22:38 +08:00
parent 56a9b1e956
commit df5114cc4a
2 changed files with 6 additions and 0 deletions

View File

@ -22,6 +22,7 @@ type TopUp struct {
TradeNo string `json:"trade_no" gorm:"unique;type:varchar(255);index"`
PaymentMethod string `json:"payment_method" gorm:"type:varchar(50)"`
PaymentProvider string `json:"payment_provider" gorm:"type:varchar(50);default:''"`
ProviderPayload string `json:"provider_payload" gorm:"type:text"`
PromoCodeId int `json:"promo_code_id" gorm:"default:0"`
CreateTime int64 `json:"create_time"`
CompleteTime int64 `json:"complete_time"`

View File

@ -59,6 +59,11 @@ func SetApiRouter(router *gin.Engine) {
apiRouter.POST("/creem/webhook", controller.CreemWebhook)
apiRouter.POST("/waffo/webhook", controller.WaffoWebhook)
//apiRouter.POST("/waffo-pancake/webhook", controller.WaffoPancakeWebhook)
apiRouter.POST("/payment/alipay/create", middleware.UserAuth(), middleware.CriticalRateLimit(), controller.CreateAlipayPayment)
apiRouter.GET("/payment/alipay/return", controller.AlipayReturn)
apiRouter.POST("/payment/webhook/alipay", controller.AlipayNotify)
apiRouter.POST("/payment/wxpay/create", middleware.UserAuth(), middleware.CriticalRateLimit(), controller.CreateWxpayPayment)
apiRouter.POST("/payment/webhook/wxpay", controller.WxpayNotify)
// Universal secure verification routes
apiRouter.POST("/verify", middleware.UserAuth(), middleware.CriticalRateLimit(), controller.UniversalVerify)