原文鏈接:https://www.cnblogs.com/qiyer/、https://www.cnblogs.com/qiyer/p/7442680.html ...
關於校驗:
//沙箱static final String testUrl = "https://sandbox.itunes.apple.com/verifyReceipt";
//正式 static final String product = "https://buy.itunes.apple.com/verifyReceipt";
請求蘋果地址 返回的 內容為
conten-type = application/json
請求的蘋果的內容為String param = "{\"receipt-data\":\""+客戶端返回的base64+"\"}";
{
"receipt": {
"receipt_type": "ProductionSandbox",
"adam_id": 0,
"app_item_id": 0,
"bundle_id": "com.rtjk.xshl",//當前的產品的包名,一定要驗證返回的包名和此包名要一致
"application_version": "2018101001",
"download_id": 0,
"version_external_identifier": 0,
"receipt_creation_date": "2018-10-19 10:50:48 Etc/GMT",
"receipt_creation_date_ms": "1539946248000",
"receipt_creation_date_pst": "2018-10-19 03:50:48 America/Los_Angeles",
"request_date": "2018-10-31 01:58:21 Etc/GMT",
"request_date_ms": "1540951101844",
"request_date_pst": "2018-10-30 18:58:21 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": "6hongliao",//對應產品id,自己做一個金額的映射就行,對應到具體的金額,建議命名要規則
"transaction_id": "1000000460004095",//一定要進行去重驗證,一個訂單號只能加一次款
"original_transaction_id": "1000000460004095",
"purchase_date": "2018-10-19 10:50:48 Etc/GMT",
"purchase_date_ms": "1539946248000",
"purchase_date_pst": "2018-10-19 03:50:48 America/Los_Angeles",
"original_purchase_date": "2018-10-19 10:50:48 Etc/GMT",
"original_purchase_date_ms": "1539946248000",
"original_purchase_date_pst": "2018-10-19 03:50:48 America/Los_Angeles",
"is_trial_period": "false"
}
]
},
"status": 0, //表示當前請求返回正常
"environment": "Sandbox"
}
引用:
https://www.cnblogs.com/qiyer/
https://www.cnblogs.com/qiyer/p/7442680.html
https://blog.csdn.net/woyixinyiyi/article/details/83574563