gpt4 book ai didi

iOS IAP 收据包含旧的消耗品购买

转载 作者:行者123 更新时间:2023-11-30 12:30:02 25 4
gpt4 key购买 nike

在我的应用中,我购买了 3 项消费品,当我购买一项时,我会收到包含 4 项购买的 IAP 收据:一项是我刚刚购买的,另外一项是我不久前购买的。 3 旧购买总是相同。看起来从未对它们调用 finishTransaction 方法。我正在沙盒模式下进行购买。如果我切换到另一个测试用户,一切都会正常。我只收到一次购买的收据。为什么我不断收到旧的购买商品?如何从收据中删除它们?

这是我收到的收据:

{
"status" : 200,
"exectime" : 2032,
"response" : {
"status" : 0,
"receipt" : {
"receipt_type" : "ProductionSandbox",
"app_item_id" : 0,
"receipt_creation_date" : "2017-04-28 04:34:20 Etc\/GMT",
"bundle_id" : "xxxx",
"original_purchase_date" : "2013-08-01 07:00:00 Etc\/GMT",
"in_app" : [
{
"product_id" : "xxxx.50Minutes",
"quantity" : "1",
"transaction_id" : "xxxx",
"purchase_date_ms" : "1493289005000",
"original_purchase_date_pst" : "2017-04-27 03:30:05 America\/Los_Angeles",
"purchase_date_pst" : "2017-04-27 03:30:05 America\/Los_Angeles",
"original_purchase_date_ms" : "1493289005000",
"is_trial_period" : "false",
"original_purchase_date" : "2017-04-27 10:30:05 Etc\/GMT",
"original_transaction_id" : "xxxx",
"purchase_date" : "2017-04-27 10:30:05 Etc\/GMT"
},
{
"product_id" : "xxxx.15Minutes",
"quantity" : "1",
"transaction_id" : "xxxx",
"purchase_date_ms" : "1493289017000",
"original_purchase_date_pst" : "2017-04-27 03:30:17 America\/Los_Angeles",
"purchase_date_pst" : "2017-04-27 03:30:17 America\/Los_Angeles",
"original_purchase_date_ms" : "1493289017000",
"is_trial_period" : "false",
"original_purchase_date" : "2017-04-27 10:30:17 Etc\/GMT",
"original_transaction_id" : "xxxx",
"purchase_date" : "2017-04-27 10:30:17 Etc\/GMT"
},
{
"product_id" : "xxxx.15Minutes",
"quantity" : "1",
"transaction_id" : "xxxx",
"purchase_date_ms" : "1493354060000",
"original_purchase_date_pst" : "2017-04-27 21:34:20 America\/Los_Angeles",
"purchase_date_pst" : "2017-04-27 21:34:20 America\/Los_Angeles",
"original_purchase_date_ms" : "1493354060000",
"is_trial_period" : "false",
"original_purchase_date" : "2017-04-28 04:34:20 Etc\/GMT",
"original_transaction_id" : "xxxx",
"purchase_date" : "2017-04-28 04:34:20 Etc\/GMT"
},
{
"product_id" : "xxxx.100Minutes",
"quantity" : "1",
"transaction_id" : "xxxx",
"purchase_date_ms" : "1493289033000",
"original_purchase_date_pst" : "2017-04-27 03:30:33 America\/Los_Angeles",
"purchase_date_pst" : "2017-04-27 03:30:33 America\/Los_Angeles",
"original_purchase_date_ms" : "1493289033000",
"is_trial_period" : "false",
"original_purchase_date" : "2017-04-27 10:30:33 Etc\/GMT",
"original_transaction_id" : "xxxx",
"purchase_date" : "2017-04-27 10:30:33 Etc\/GMT"
}
],
"adam_id" : 0,
"receipt_creation_date_pst" : "2017-04-27 21:34:20 America\/Los_Angeles",
"request_date" : "2017-04-28 04:34:34 Etc\/GMT",
"request_date_pst" : "2017-04-27 21:34:34 America\/Los_Angeles",
"version_external_identifier" : 0,
"request_date_ms" : "1493354074233",
"original_purchase_date_pst" : "2013-08-01 00:00:00 America\/Los_Angeles",
"application_version" : "1",
"original_purchase_date_ms" : "1375340400000",
"receipt_creation_date_ms" : "1493354060000",
"original_application_version" : "1.0",
"download_id" : 0
},
"environment" : "Sandbox"
},
"memory" : 649368
}

最佳答案

这些是待处理的交易。解决方案是创建新的沙箱用户。然后添加queue.finishTransaction(transaction)所有事务状态

public func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {
for transaction in transactions {
switch (transaction.transactionState) {
case .purchased:
queue.finishTransaction(transaction)
break
case .failed:
queue.finishTransaction(transaction)
break
case .restored:
queue.finishTransaction(transaction)
break
case .deferred:
break
case .purchasing:
break
}
}
}

关于iOS IAP 收据包含旧的消耗品购买,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43677606/

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