我有一个工作的第 3 方 php 代码验证从 ipad 发送的收据。但似乎https://sandbox.itunes.apple.com/verifyReceipt不再响应我的 php 代码。{"status":21000}
如果我直接访问网址,甚至没有错误统计信息。我在服务器端尝试了不同的方法,比如 curl_exec($ch); 或 file_get_contents 即使是简单的测试也不会返回任何内容。
$result = file_get_contents('https://sandbox.itunes.apple.com/verifyReceipt');
echo $result;
我想知道这是否是由心脏出血引起的,我该怎么办?
我原来的工作 php 代码:
if ($isSandbox) {
$endpoint = 'https://sandbox.itunes.apple.com/verifyReceipt';
}
else {
$endpoint = 'https://buy.itunes.apple.com/verifyReceipt';
}
// Connect to Apple server and validate.
$postData = json_encode(array("receipt-data" => $receipt));
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded",
'method' => 'POST',
'content' => $postData
),
);
$context = stream_context_create($options);
$result = file_get_contents($endpoint, false, $context);