plus.payment.request 成功回调的交易凭证校验结果与restoreComplateRequest中回调的交易凭证校验结果不一致。
将 restoreComplateRequest 返回的支付凭证拿去苹果校验,得到的校验结果里有 in_app 数组,而 plus.payment.request 成功回调里的支付凭证,校验结果确没有 in_app 数组,结构也有些不一样,这是为什么?请大家帮帮忙!
plus.payment.request 成功回调支付凭证校验结果:
{
"receipt": {
"original_purchase_date_pst": "2021-09-16 08:09:18 America/Los_Angeles",
"purchase_date_ms": "xxx",
"unique_identifier": "xxx",
"original_transaction_id": "xxx",
"bvrs": "100",
"transaction_id": "xxx",
"quantity": "1",
"in_app_ownership_type": "PURCHASED",
"unique_vendor_identifier": "xxx",
"item_id": "xxx",
"original_purchase_date": "2021-09-16 15:09:18 Etc/GMT",
"is_in_intro_offer_period": "false",
"product_id": "xxx",
"purchase_date": "2021-09-16 15:09:18 Etc/GMT",
"is_trial_period": "false",
"purchase_date_pst": "2021-09-16 08:09:18 America/Los_Angeles",
"bid": "xxx",
"original_purchase_date_ms": "xxx"
},
"status": 0
}
restoreComplateRequest 回调支付凭证校验结果:
{
"receipt": {
"receipt_type": "ProductionSandbox",
"adam_id": 0,
"app_item_id": 0,
"bundle_id": "xxx",
"application_version": "100",
"download_id": 0,
"version_external_identifier": 0,
"receipt_creation_date": "2021-09-16 15:09:18 Etc/GMT",
"receipt_creation_date_ms": "1631804958000",
"receipt_creation_date_pst": "2021-09-16 08:09:18 America/Los_Angeles",
"request_date": "2021-09-16 15:32:15 Etc/GMT",
"request_date_ms": "1631806335675",
"request_date_pst": "2021-09-16 08:32:15 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": "xxx",
"transaction_id": "xxx",
"original_transaction_id": "xxx",
"purchase_date": "2021-09-16 15:09:18 Etc/GMT",
"purchase_date_ms": "1631804958000",
"purchase_date_pst": "2021-09-16 08:09:18 America/Los_Angeles",
"original_purchase_date": "2021-09-16 15:09:18 Etc/GMT",
"original_purchase_date_ms": "1631804958000",
"original_purchase_date_pst": "2021-09-16 08:09:18 America/Los_Angeles",
"is_trial_period": "false",
"in_app_ownership_type": "PURCHASED"
}
]
},
"environment": "Sandbox",
"status": 0
}
另外调用 restoreComplateRequest 得到的 IAPTransaction 数组里,没有 transactionIdentifier 这个字段, 有人知道这是为什么吗?
PrescottPS (作者)
会是我使用沙盒账号的原因吗?我查询了一下,我这里支付成功凭证校验得到的结果,是 iOS7 以下会返回的结构,但是我的手机系统是 iOS14。
自定义基座打包的SDK版本会影响吗?
2021-09-17 22:37
PrescottPS (作者)
感觉是不是 H5+ 的 API 是不是使用了旧的接口获取 transactionReceipt
2021-09-18 00:31
DCloud_iOS_XHY
回复 p***@outlook.com: restoreComplateRequest 和 支付 request 接口返回的数据的处理逻辑是一个方法,唯一区别就是 restoreComplateRequest 返回的是个数组,获取 transactionReceipt 逻辑是判断一下iOS7之前的获取方式的数据是否存在,如果存在会优先使用之前的方法,下个版本会把这个逻辑去掉,直接使用新的方法
2021-09-22 12:54