gpt4 book ai didi

ios - 在 IAP 收据验证中检测促销代码

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

应用内购买已成功添加到应用程序中

IAP 目前处于开发模式,我将 IAP 收据验证放在服务器端,并且工作正常。

现在我想集成 IAP 促销代码。但它们可以在 Apple 批准后生成(IAP 审核)

问题:由于来自 Apple 服务器的收据验证响应不包含交易金额或任何促销代码字段,我如何检测促销代码已用于交易

示例:

{
"receipt": {
"receipt_type": "ProductionSandbox",
"adam_id": 0,
"app_item_id": 0,
"bundle_id": "com.myApp",
"application_version": "14.06",
"download_id": 0,
"version_external_identifier": 0,
"receipt_creation_date": "2018-09-05 05:18:33 Etc/GMT",
"receipt_creation_date_ms": "1536124713000",
"receipt_creation_date_pst": "2018-09-04 22:18:33 America/Los_Angeles",
"request_date": "2018-09-25 04:53:09 Etc/GMT",
"request_date_ms": "1537851189557",
"request_date_pst": "2018-09-24 21:53:09 America/Los_Angeles",
"original_purchase_date": "2013-08-01 07:00:00 Etc/GMT",
"original_purchase_date_ms": "1375340400000",
"original_purchase_date_pst": "2013-08-01 00:00:00 America/Los_Angeles",
"original_application_version": "1.0",
"in_app": [
{
"quantity": "1",
"product_id": "com.myApp.testpack",
"transaction_id": "1000000439689939",
"original_transaction_id": "1000000439689939",
"purchase_date": "2018-09-05 05:03:52 Etc/GMT",
"purchase_date_ms": "1536123832000",
"purchase_date_pst": "2018-09-04 22:03:52 America/Los_Angeles",
"original_purchase_date": "2018-09-05 05:03:52 Etc/GMT",
"original_purchase_date_ms": "1536123832000",
"original_purchase_date_pst": "2018-09-04 22:03:52 America/Los_Angeles",
"is_trial_period": "false"
},
{
"quantity": "1",
"product_id": "com.myApp.testpack",
"transaction_id": "1000000439690499",
"original_transaction_id": "1000000439690499",
"purchase_date": "2018-09-05 05:09:38 Etc/GMT",
"purchase_date_ms": "1536124178000",
"purchase_date_pst": "2018-09-04 22:09:38 America/Los_Angeles",
"original_purchase_date": "2018-09-05 05:09:38 Etc/GMT",
"original_purchase_date_ms": "1536124178000",
"original_purchase_date_pst": "2018-09-04 22:09:38 America/Los_Angeles",
"is_trial_period": "false"
},
{
"quantity": "1",
"product_id": "com.myApp.testpack",
"transaction_id": "1000000439692512",
"original_transaction_id": "1000000439692512",
"purchase_date": "2018-09-05 05:18:01 Etc/GMT",
"purchase_date_ms": "1536124681000",
"purchase_date_pst": "2018-09-04 22:18:01 America/Los_Angeles",
"original_purchase_date": "2018-09-05 05:18:01 Etc/GMT",
"original_purchase_date_ms": "1536124681000",
"original_purchase_date_pst": "2018-09-04 22:18:01 America/Los_Angeles",
"is_trial_period": "false"
}
]
},
"status": 0,
"environment": "Sandbox"
}

我只想将交易期间使用的优惠券代码存储在我的数据库中以进行一些分析。

最佳答案

@Paulw11 在评论中提到,无法从收据或应用程序本身得知。

我开始寻找从 App Analytics 获取详细信息的方法,发现 Apple 提供了 Reporter这可以让我们从应用程序分析下载报告。这是基于Java的。但人们也将其移植到另一种语言。

有用的库:

PHP https://github.com/fedoco/itc-reporter

Python https://github.com/fedoco/itc-reporter

关于ios - 在 IAP 收据验证中检测促销代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52490830/

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