feat: 实现 iOS Apple Pay 内购支付功能

前端:
- 集成 in_app_purchase 插件,实现 IAP 支付流程
- 添加支付模块 (payments/) 处理产品获取、购买、验证
- 积分中心页面集成 Apple Pay 购买入口
- 设置页面重构: 关于/隐私/协议直接展示,删除 legal_center 子页面
- 修复欢迎引导页滚动检测阈值问题
- 修复解卦结果页 iOS 侧滑返回手势被阻止的问题
- 邀请码绑定按钮临时禁用(待后端实现)

后端:
- 新增 apple_iap_transactions 表记录交易
- 实现 Apple 服务器端验证 (App Store Server API)
- 支付成功后自动发放积分
- 支持 Sandbox/Production 环境切换
- 添加退款处理和交易状态机

协议:
- 更新积分流水协议,支持 purchase/refund 类型
- 新增 PAYMENT_* 错误码
This commit is contained in:
ZL-Q
2026-04-28 10:45:29 +08:00
parent b453ff7345
commit 87f92987b2
58 changed files with 3741 additions and 336 deletions
+134
View File
@@ -0,0 +1,134 @@
{
"identifier" : "EryaoProducts",
"nonRenewingSubscriptions" : [
],
"products" : [
{
"displayPrice" : "0.99",
"familyShareable" : false,
"internalID" : "new_user_pack_001",
"introductoryOffer" : null,
"localizations" : [
{
"description" : "新用户专属优惠套餐",
"displayName" : "新手包",
"locale" : "zh_CN"
}
],
"productID" : "com.meeyao.qianwen.new_user_pack",
"referenceName" : "新手包",
"type" : "Consumable"
},
{
"displayPrice" : "6.00",
"familyShareable" : false,
"internalID" : "basic_pack_001",
"introductoryOffer" : null,
"localizations" : [
{
"description" : "基础信用点套餐",
"displayName" : "基础包",
"locale" : "zh_CN"
}
],
"productID" : "com.meeyao.qianwen.basic_pack",
"referenceName" : "基础包",
"type" : "Consumable"
},
{
"displayPrice" : "18.00",
"familyShareable" : false,
"internalID" : "popular_pack_001",
"introductoryOffer" : null,
"localizations" : [
{
"description" : "热门信用点套餐",
"displayName" : "热门包",
"locale" : "zh_CN"
}
],
"productID" : "com.meeyao.qianwen.popular_pack",
"referenceName" : "热门包",
"type" : "Consumable"
},
{
"displayPrice" : "68.00",
"familyShareable" : false,
"internalID" : "premium_pack_001",
"introductoryOffer" : null,
"localizations" : [
{
"description" : "高级信用点套餐",
"displayName" : "高级包",
"locale" : "zh_CN"
}
],
"productID" : "com.meeyao.qianwen.premium_pack",
"referenceName" : "高级包",
"type" : "Consumable"
}
],
"settings" : {
"_applicationInternalID" : "6738123456",
"_developerTeamID" : "YOUR_TEAM_ID",
"_failTransactionsEnabled" : false,
"_lastSynchronizedDate" : 756460800,
"_locale" : "zh_CN",
"_storefront" : "CHN",
"_storeKitErrors" : [
{
"current" : null,
"enabled" : false,
"name" : "Load Products"
},
{
"current" : null,
"enabled" : false,
"name" : "Purchase"
},
{
"current" : null,
"enabled" : false,
"name" : "Verification"
},
{
"current" : null,
"enabled" : false,
"name" : "App Store Sync"
},
{
"current" : null,
"enabled" : false,
"name" : "Subscription Status"
},
{
"current" : null,
"enabled" : false,
"name" : "App Transaction"
},
{
"current" : null,
"enabled" : false,
"name" : "Manage Subscriptions Sheet"
},
{
"current" : null,
"enabled" : false,
"name" : "Refund Request Sheet"
},
{
"current" : null,
"enabled" : false,
"name" : "Offer Code Redeem Sheet"
}
]
},
"subscriptionGroups" : [
],
"version" : {
"major" : 4,
"minor" : 0
}
}