Commit 4412ac66 by ethanlamzs

优化提示

1 parent c281ea4f
...@@ -165,8 +165,6 @@ class UserAuthRepository { ...@@ -165,8 +165,6 @@ class UserAuthRepository {
// 检查ios的订单是否已经订阅 // 检查ios的订单是否已经订阅
Future<dynamic> orderCheck(String userId,String receipt,String orderid, String platform,int isSandbox ) async { Future<dynamic> orderCheck(String userId,String receipt,String orderid, String platform,int isSandbox ) async {
try { try {
debugPrint('收据长度: ${receipt.length}');
debugPrint('收据前100字符: ${receipt.substring(0, receipt.length > 100 ? 100 : receipt.length)}');
Response resp = await _appService.post( Response resp = await _appService.post(
'/api/v1/comm/user/ordercheck', '/api/v1/comm/user/ordercheck',
{ {
......
...@@ -67,7 +67,7 @@ class SubscriptionService { ...@@ -67,7 +67,7 @@ class SubscriptionService {
} }
_products = response.productDetails; _products = response.productDetails;
debugPrint('获取到 ${_products.length} 个产品'); // debugPrint('获取到 ${_products.length} 个产品');
// for (var p in _products) { // for (var p in _products) {
// debugPrint('x1=====> 产品ID: ${p.id}, 标题: ${p.title}, 价格: ${p.price}'); // debugPrint('x1=====> 产品ID: ${p.id}, 标题: ${p.title}, 价格: ${p.price}');
// } // }
...@@ -139,6 +139,7 @@ class SubscriptionService { ...@@ -139,6 +139,7 @@ class SubscriptionService {
// ✅ 关键:只要不是 pending,都立刻完成交易,清出队列 // ✅ 关键:只要不是 pending,都立刻完成交易,清出队列
if (purchaseDetails.status != PurchaseStatus.pending) { if (purchaseDetails.status != PurchaseStatus.pending) {
_iap.completePurchase(purchaseDetails); _iap.completePurchase(purchaseDetails);
print("[debug] _iap.completePurchase execute ");
} }
} }
} }
...@@ -153,13 +154,11 @@ class SubscriptionService { ...@@ -153,13 +154,11 @@ class SubscriptionService {
// 把 base64Receipt 作为 receipt-data 发给你的服务端验证 // 把 base64Receipt 作为 receipt-data 发给你的服务端验证
final bool isValid = await _sendReceiptToBackend(receipt,orderid); final bool isValid = await _sendReceiptToBackend(receipt,orderid);
debugPrint("[info] _verifyReceipt is step 1 ");
if (isValid) { if (isValid) {
// 更新本地订阅状态 // 更新本地订阅状态
_hasActiveSubscription = true; _hasActiveSubscription = true;
// 保存到期时间等信息 // 保存到期时间等信息
} }
debugPrint("[info] _verifyReceipt is done ");
} }
// 示例:发送收据到自己的服务器进行二次验证 // 示例:发送收据到自己的服务器进行二次验证
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!