简体   繁体   English

所有时间的PayPal Pdt状态0

[英]paypal pdt status all time 0

Sorry, maybe there is more posts on this argument but I really can't solve my problem!! 抱歉,关于该论点的帖子可能更多,但我确实无法解决我的问题! Maybe I've some logical issue too ... Can some one help me to figure out the right workflow? 也许我也遇到了一些逻辑问题。有人可以帮助我找出正确的工作流程吗? I'm having a headache trying to configure my website with paypal: I've created my test sandbox to try all my transactions ... I've created the button ... 尝试使用Paypal配置我的网站时,我头疼:创建了我的测试沙箱以尝试所有交易...创建了按钮...

<form action="<?php echo $paypal_url; ?>" method="post" name="frmPayPal1">
                <input type="hidden" name="business" value="<?php echo $paypal_id; ?>">
                <input type="hidden" name="cmd" value="_xclick">
                <!-- nome oggetto -->
                <input type="hidden" name="item_name" value="myITEM Payment">
                <!-- numero oggetti -->
                <input type="hidden" name="item_number" value="myIdNumber:995">
                <!-- prezzo -->
                <input type="hidden" name="amount" value="10.99">
                <!-- bottone continua -->
                <input type="hidden" name="cbt" value="Continua" />
                <!-- tipo valuta -->
                <input type="hidden" name="currency_code" value="EUR">
                <!-- pagina in caso di annullamento -->
                <input type="hidden" name="cancel_return" value="<?php echo $url; ?>/cancel.php">
                <!-- pagina in caso successo -->

                <input type="hidden" name="return" value="<?php echo $url; ?>/success.php">

                <!-- immagine -->
                <input type="image" src="https://www.sandbox.paypal.com/it_IT/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
                <img alt="" border="0" src="https://www.sandbox.paypal.com/it_IT/i/scr/pixel.gif" width="1" height="1">
            </form>

enable Auto Return on my url : " http://www.MYURL.it/paypal/success.php " 在我的网址上启用自动返回:“ http://www.MYURL.it/paypal/success.php

on success.php i've pasted some code found in other post: 在success.php上,我粘贴了一些在其他帖子中找到的代码:

    <?php 
// The custom hidden field (user id) sent along with the button is retrieved here. 
if($_GET['cm']) $user=$_GET['cm']; 
// The unique transaction id. 
if($_GET['tx']) $tx= $_GET['tx'];
 $identity = $auth_token; //my paypal token
// Init curl
 $ch = curl_init(); 
// Set request options 
curl_setopt_array($ch, array ( CURLOPT_URL => 'https://www.sandbox.paypal.com/cgi-bin/webscr',
  CURLOPT_POST => TRUE,
  CURLOPT_POSTFIELDS => http_build_query(array
    (
      'cmd' => '_notify-synch',
      'tx' => $tx,
      'at' => $identity,
    )),
  CURLOPT_RETURNTRANSFER => TRUE,
  CURLOPT_HEADER => FALSE,
  // CURLOPT_SSL_VERIFYPEER => TRUE,
  // CURLOPT_CAINFO => 'cacert.pem',
));
// Execute request and get response and status code
$response = curl_exec($ch);
$status   = curl_getinfo($ch, CURLINFO_HTTP_CODE);
// Close connection
curl_close($ch);
echo $status;
if($status == 200 AND strpos($response, 'SUCCESS') === 0)
{
    // Save the Record into the database
    echo "<h1>successo</h1>";
}
?>

echo $status gives me 0 every time and i'm assuming there is an error ... Can someone help me? echo $ status每次都会给我0,我假设有一个错误...有人可以帮助我吗?

CURLINFO_HTTP_CODE returns 0 when the connection fails, add the following code snippet to print the error details and check your server connectivity to https://www.sandbox.paypal.com 连接失败时, CURLINFO_HTTP_CODE返回0 ,添加以下代码段以打印错误详细信息,并检查服务器与https://www.sandbox.paypal.com连接

if(curl_errno($ch)){   
    echo 'Curl error: ' . curl_error($ch);
}

the error i've: 我的错误:

error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure0 错误:14077410:SSL例程:SSL23_GET_SERVER_HELLO:sslv3警报握手失败0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM