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支付订单 相关文档已更新,包含接入方案和实现细节
21 lines
646 B
Go
21 lines
646 B
Go
package notify
|
||
|
||
import (
|
||
"github.com/gin-gonic/gin"
|
||
"github.com/perfect-panel/server/internal/logic/notify"
|
||
"github.com/perfect-panel/server/internal/svc"
|
||
"github.com/perfect-panel/server/pkg/result"
|
||
)
|
||
|
||
// AppleIAPNotifyHandler 处理 Apple Server Notifications v2
|
||
// 参数: 原始 HTTP 请求体
|
||
// 返回: 处理结果(空体 200)
|
||
func AppleIAPNotifyHandler(svcCtx *svc.ServiceContext) func(c *gin.Context) {
|
||
return func(c *gin.Context) {
|
||
l := notify.NewAppleIAPNotifyLogic(c.Request.Context(), svcCtx)
|
||
err := l.Handle(c.Request)
|
||
result.HttpResult(c, gin.H{"success": err == nil}, err)
|
||
}
|
||
}
|
||
|