Update remote soul-content with local content

This commit is contained in:
卡若
2026-01-09 11:58:08 +08:00
parent 2bdf275cba
commit d781dc07ed
172 changed files with 16577 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
import { type NextRequest, NextResponse } from "next/server"
export async function POST(request: NextRequest) {
try {
const body = await request.json()
const { orderId, status, transactionId, amount, paymentMethod, signature } = body
console.log("[v0] Payment callback received:", {
orderId,
status,
transactionId,
amount,
paymentMethod,
})
// In production:
// 1. Verify signature from payment gateway
// 2. Update order status in database
// 3. Grant user access to content
// 4. Calculate and distribute referral commission
// Mock signature verification
// const isValid = verifySignature(body, signature)
// For now, accept all callbacks
const isValid = true
if (!isValid) {
return NextResponse.json({ code: 403, message: "签名验证失败" }, { status: 403 })
}
// Update order status
if (status === "success") {
// Grant access
console.log("[v0] Payment successful, granting access for order:", orderId)
}
return NextResponse.json({
code: 0,
message: "回调处理成功",
})
} catch (error) {
console.error("[v0] Payment callback error:", error)
return NextResponse.json({ code: 500, message: "服务器错误" }, { status: 500 })
}
}