Some checks failed
Build docker and publish / build (20.15.1) (push) Has been cancelled
实现Apple应用内购支付功能,包括: 1. 新增AppleIAP和ApplePay支付平台枚举 2. 添加IAP验证接口/v1/public/iap/verify处理初购验证 3. 实现Apple服务器通知处理逻辑/v1/iap/notifications 4. 新增JWS验签和JWKS公钥缓存功能 5. 复用现有订单系统处理IAP支付订单 相关文档已更新,包含接入方案和实现细节
23 lines
612 B
Go
23 lines
612 B
Go
package handler
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/perfect-panel/server/internal/handler/notify"
|
|
"github.com/perfect-panel/server/internal/middleware"
|
|
"github.com/perfect-panel/server/internal/svc"
|
|
)
|
|
|
|
func RegisterNotifyHandlers(router *gin.Engine, serverCtx *svc.ServiceContext) {
|
|
group := router.Group("/v1/notify/")
|
|
group.Use(middleware.NotifyMiddleware(serverCtx))
|
|
{
|
|
group.Any(":platform/:token", notify.PaymentNotifyHandler(serverCtx))
|
|
}
|
|
|
|
iap := router.Group("/v1/iap")
|
|
{
|
|
iap.POST("/notifications", notify.AppleIAPNotifyHandler(serverCtx))
|
|
}
|
|
|
|
}
|