1

我们正在我们的服务器上验证收据,我们收到被黑的收据,返回状态为 0!

这是我们的服务器代码:

 $postData = json_encode(
            array('receipt-data' => $receipt)
        );

        //return $postData;

        // create the cURL request
        $ch = curl_init($endpoint);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);

        // execute the cURL request and fetch response data
        $response = curl_exec($ch);
        $errno    = curl_errno($ch);
        $errmsg   = curl_error($ch);
        curl_close($ch);

        // ensure the request succeeded
        if ($errno != 0) {
            throw new Exception($errmsg, $errno);
        }

        // parse the response data
        $data = json_decode($response);

        // ensure response data was a valid JSON string
        if (!is_object($data)) {
            return 'Invalid response data';
        }

        // ensure the expected data is present
        if (!isset($data->status) || $data->status != 0) {
            return "Apple return with error ".$data->status;
        }

我尝试在收据中放置虚假数据,它会返回 21002 错误(格式错误的收据)。

我检查收据状态是否为 0 并且它是否返回是假收据。

这是一个新鲜的

{
    "status": 0,
    "environment": "Production",
    "receipt": {
        "receipt_type": "Production",
        "adam_id": 813798979,
        "bundle_id": "com.site.gamename",
        "application_version": "0.7",
        "download_id": 81005576413585,
        "request_date": "2014-04-23 21:37:23 Etc/GMT",
        "request_date_ms": "1398289043287",
        "request_date_pst": "2014-04-23 14:37:23 America/Los_Angeles",
        "original_purchase_date": "2014-04-21 20:36:09 Etc/GMT",
        "original_purchase_date_ms": "1398112569000",
        "original_purchase_date_pst": "2014-04-21 13:36:09 America/Los_Angeles",
        "original_application_version": "0.7",
        "in_app": []
    }
}

状态 = 0!!!这怎么可能!?

这是它附带的虚假交易ID

84091B08-4706-4810-924F-BC10CC1B

我能做什么?

这是怎么回事!?我如何从这些被盗收据中获得状态 0?!

4

0 回答 0