gpt4 book ai didi

ios - 当服务器端收据验证失败时,我应该调用 finishTransaction 吗?

转载 作者:技术小花猫 更新时间:2023-10-29 10:17:55 25 4
gpt4 key购买 nike

我使用服务器端收据验证。

当客户的

- (void)paymentQueue:(SKPaymentQueue *)queue
updatedTransactions:(NSArray *)transactions

被调用,transactionStateSKPaymentTransactionStatePurchased,客户端将收据发送到我们的服务器,我们的服务器会验证它。

服务端回执校验成功后,客户端显然调用了finishTransaction,没有问题。

当服务器端收据验证失败时,因为 apple 临时返回非 json,或者客户端发送了无效的收据,或者什么的,服务器将该信息返回给客户端。

接下来,我们的客户应该做什么?我们应该调用 finishTransaction 吗?

这会导致无效交易永远存在于队列中?就像在这个问题中所说:iPhone in-app purchase: receipt verification

But if you find out that a receipt is invalid, you should finish the associated transaction. If not, you may have extra-transactions living forever in the transaction queue. That means that each time your app runs, paymentQueue:updatedTransaction: will be called once per transaction...

但是如果我们执行 finishTransaction,我们宝贵的用户将通过这张收据(我们未能验证)收费,对吧?

或者 verify-failed-transaction 是否在某个时间段内过期?

这是否记录在苹果文档的某处?我在 http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/Introduction/Introduction.html 中找不到任何内容

最佳答案

是的,你必须完成交易。

这取决于您是否给用户他们想要的东西。在某些情况下,最好给用户他们想要的东西,即使收据无效或伪造(使用越狱)。尤其是当您无需花费任何费用时。

关于ios - 当服务器端收据验证失败时,我应该调用 finishTransaction 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15526156/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com