问题描述
在我的申请中,更新期限为1个月.沙盒中自动更新的有效时间为5分钟.因此交易标识符每隔5分钟就会不断变化.
In my application, renewing period is 1 month. Validity Time for Auto-Renewables in Sandbox is 5 minutes. So transcation identifier will keep on changing after each 5 minutes.
最初,我将购买该产品.如果我成功,我将获得SKPaymentTransaction对象,该对象包含有关交易的所有详细信息,例如transactionIdentifier,transactionDate,transactionReceipt和transactionState.直到我明白了.如果我调用还原功能(即restoreCompletedTransactions),我将获得所有已完成的交易信息.据我所知,第一个交易日志信息将是最新交易信息.
Initially i will a buy the product. If I am successfull i will get SKPaymentTransaction object it contains all details about transcation like transactionIdentifier, transactionDate, transactionReceipt and transactionState. Till this I understood. If I call restore function, (i.e.restoreCompletedTransactions) I am getting all the completed transaction information. According to my knowledge the first transaction log information will be the late-stet transaction information.
比较时,对象的详细信息不同.这怎么可能.我完全困惑,如何还原此自动可再生交易明细.感谢您的帮助.
When compare both the object's details are different. How come this is possible. I am totally confused, How to restore this Auto renewable transaction details. Any help is appreciated.
推荐答案
要确认是否已续订用户的订阅,请还原已完成的交易并将第一笔交易的收据发送给Apple.作为响应,苹果会向您发送交易的当前状态.
To confirm that user's subscription was renewed or not, restore completed transaction and send first transaction's receipt to apple. In response apple will send you current status of the transaction.
For detailed reference read following linkhttp://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/RenewableSubscriptions/RenewableSubscriptions.html#//apple_ref/doc/uid/TP40008267-CH4-SW2
特别是表7-2自动续订的订阅信息键
Specially Table 7-2 Auto-renewable subscription info keys
之后,将您的数据以Json格式发送到Apple(请注意,收据部分必须以64为基数编码.)并仔细阅读响应.作为回应,您会根据情况找到上表中给出的代码.
After that send your data to apple in Json format (Note that receipt part has to base 64 encoded.) and read the response carefully. In response you will find codes given in above table depending upon situation.
请注意,在实际环境中,收据验证应该是来自其他服务器的圆顶,而不是来自iPhone或iPad本身.
Please note that in real environment receipt verification should be dome from another server not from iPhone or iPad itself.
如果还有其他疑问,请在此处发布.
Post here if you have any further doubts.
这篇关于如何在iPhone中还原自动可更新交易?(在应用程序内购买)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!