feat(iap/apple): 实现苹果IAP非续期订阅功能
Build docker and publish / build (20.15.1) (push) Successful in 6m37s

新增苹果IAP相关接口与逻辑,包括产品列表查询、交易绑定、状态查询和恢复购买功能。移除旧的IAP验证逻辑,重构订阅系统以支持苹果IAP交易记录存储和权益计算。

- 新增/pkg/iap/apple包处理JWS解析和产品映射
- 实现GET /products、POST /attach、POST /restore和GET /status接口
- 新增apple_iap_transactions表存储交易记录
- 更新文档说明配置方式和接口规范
- 移除旧的AppleIAP验证和通知处理逻辑
This commit is contained in:
2025-12-13 20:54:50 -08:00
parent a80d6af035
commit 62186ca672
41 changed files with 1715 additions and 474 deletions
+1 -13
View File
@@ -10,7 +10,6 @@ const (
EPay
Balance
CryptoSaaS
AppleIAP
UNSUPPORTED Platform = -1
)
@@ -20,7 +19,6 @@ var platformNames = map[string]Platform{
"AlipayF2F": AlipayF2F,
"EPay": EPay,
"balance": Balance,
"AppleIAP": AppleIAP,
"unsupported": UNSUPPORTED,
}
@@ -49,7 +47,7 @@ func GetSupportedPlatforms() []types.PlatformInfo {
"public_key": "Publishable key",
"secret_key": "Secret key",
"webhook_secret": "Webhook secret",
"payment": "Payment Method, only supported card/alipay/wechat_pay/apple_pay",
"payment": "Payment Method, only supported card/alipay/wechat_pay",
},
},
{
@@ -82,15 +80,5 @@ func GetSupportedPlatforms() []types.PlatformInfo {
"secret_key": "Secret Key",
},
},
{
Platform: AppleIAP.String(),
PlatformUrl: "https://developer.apple.com/help/app-store-connect/",
PlatformFieldDescription: map[string]string{
"issuer_id": "App Store Connect Issuer ID",
"key_id": "App Store Connect Key ID",
"private_key": "Private Key (ES256)",
"environment": "Environment: Sandbox/Production",
},
},
}
}