一次购买的Apple应用程序内购买transaction_id有时会更改 [英] Apple In-app purchase transaction_id of one purchase changes sometimes

查看:224
本文介绍了一次购买的Apple应用程序内购买transaction_id有时会更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一旦我从客户那里收到了一张收据,并通过Apple服务器对其进行了验证,那么我在此收据中得到了新购买的交易ID(这是自动订购的购买).几天后,我从同一位客户获得了一张新收据,并对其进行了验证,奇怪的事情发生了:该旧购买的交易ID发生了变化.

Once I get a receipt from client and validate it by apple server, then I got a transaction id of the new purchase (it's an auto-subscription purchase) in this receipt. After a few days , I get a new receipt from the same client and validate it , strange things happen : the transaction id of that old purchase changes.

我将旧收据中的此次购买数据与新收据中的数据进行比较,唯一的变化是transaction_id字段,original_transaction_id,purchase_date,expires_date, web_order_line_item_id 等字段是完全一样.

I compare the data of this purchase in the old receipt with the data in the new receipt , the only thing changes is the transaction_id field ,the original_transaction_id, purchase_date, expires_date, web_order_line_item_id and other fields are exactly same.

比起我检查数据库,我发现大约1%的交易记录有相同的情况.并且有一个特点,他们的大多数交易ID都会增加或减少1-2 .

Than I check the database, I found about 1% transaction records have the same situation. And there is a trait, Most of their transaction id were increased or decreased by 1-2 .

我以前认为交易ID是购买的标识符.有人遇到相同的问题或原因吗?

I used to think the transaction id is the identifier of a purchase. Does anyone meet the same problem or know the reason?

推荐答案

是的,我们也看到了这种情况.我们看到这是由恢复购买"按钮的点击触发的.

Yes we see this happen as well. We see this triggered by 'Restore Purchase' button clicks.

如果您的恢复购买"按钮使用 restoreCompletedTransactions API,那么这将导致您的交易ID发生更改.我们已在Apple开发人员的支持下确认了这一点.

If your 'Restore Purchase' button uses the restoreCompletedTransactions API then this will cause your transaction ID's to change. We have confirmed that this with Apple developer support.

显然,您可以调用 SKReceiptRefreshRequest 来代替抓住最新的收据,而不是重播所有交易.据我了解,这不会导致交易ID发生更改.

Apparently you can call SKReceiptRefreshRequest instead which will just grab the latest receipt instead of replaying all of the transactions. It is my understanding that this will not cause the transaction ids to change.

我们曾经目睹过,在对 restoreCompletedTransactions 的调用中, web_order_line_item_id 的值不会改变.但是,当我们要求确认时,充其量我们最多只能得到苹果开发人员支持的模棱两可的答复:

We have, anecdotally, witnessed that the web_order_line_item_id values do not change across calls to restoreCompletedTransactions. However we only received an ambiguous, at best, response from Apple developer support when we asked for confirmation:

关于web_order_line_item_id字段,该值将在以后的每次续订中更改.

In regards to the web_order_line_item_id field, the value will change on every subsequent renewal.

只要续订事件到来时继续存储新值,就可以使用它.

You can use this, as long as you continue to store the new value as the renewal subscription events come in.

我们将其理解为 web_order_line_item_id 在每个续订购买中都是唯一的.在对 restoreCompletedTransactions

We take this to mean that the web_order_line_item_id is unique per renewal-purchase. Which neither confirms nor denies that it remains constant across calls to restoreCompletedTransactions

此外,我发现在Apple/Google/Amazon定期计费中录制此会议记录非常有帮助(尽管不适用于此特定情况):

Additionally, I found this conference recording on Apple/Google/Amazon recurring billing very helpful (though, not for this particular case):

Rosa Gutierrez-反复发生的噩梦.实施跨平台的应用内订阅购买

这篇关于一次购买的Apple应用程序内购买transaction_id有时会更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆