2013-10-22 43 views
0

一個月前我們從貝寶標準傳遞到貝寶親。整合工作正常,直到星期天:偶爾paypal返回我貝寶錯誤:503服務暫時不可用

Payment_status = Completed 
Errore = 503<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> 
<html><head> 
<title>503 Service Temporarily Unavailable</title> 
</head><body> 
<h1>Service Temporarily Unavailable</h1> 
<p>The server is temporarily unable to service your 
request due to maintenance downtime or capacity 
problems. Please try again later.</p> 
</body></html> 

我怎樣才能找到問題在哪裏?

回答

0

我得到的503響應是「服務不可用」 - 與這個不完全相同。付款狀態「已完成」

我給PayPal打了個電話,他們說這是他們試圖解決的問題。他們建議我重試電話。

這是我做的,它似乎工作。

//$req = set of key/value pairs sent by paypal 
// Step 2: POST IPN data back to PayPal to validate 
$ir = 0; 
while($ir<3&&($ir==0||strpos($res,'Service Unavailable')>0)) { 
    if($ir!=0) { //wait and try again after 1st try 
     //log the problem somehow 
     $sam = 1; 
     sleep(2); 
     unset($res); 
    } 
    //setup the call 
    $ch = curl_init('https://www.paypal.com/cgi-bin/webscr'); 
    curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); 
    curl_setopt($ch, CURLOPT_POST, 1); 
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); 
    curl_setopt($ch, CURLOPT_POSTFIELDS, $req); 
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); 
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); 
    curl_setopt($ch, CURLOPT_FORBID_REUSE, 1); 
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close')); 

    if(!($res = curl_exec($ch))) { 
     //log the problem somehow 
     curl_close($ch); 
     exit; 
    } 
    curl_close($ch); 
    $ir += 1; 
} 
相關問題