0

나는 임베디드 페이먼트로 처리 된 적응 지불을 가지고 있습니다. 모든 것이 잘 작동하지만 (구매가 처리됨), 내 IPN 청취자에게는 통지되지 않습니다. 필자는 PayPal이 제공하는 IPN 테스트 도구를 사용했으며 청취자는 그 전화를 받지만 임베디드 지불은받지 않습니다.임베디드 페이 먼츠 IPN

$bodyparams = array (
"requestEnvelope.errorLanguage" => \"en_US",   
"actionType" => "PAY", 
"cancelUrl" => "http://mysite.com/cancel",  
"returnUrl" => "http://mysite.com/buying",  
"currencyCode" => "USD",   
"paymentType" => "DIGITALGOODS",  
"ipnNotificationUrl" => 'http://mysite.com/listener.php',  
"trackingId" => $rows['key'],  
"memo" => 'You are buying ' . $title . ' from ' . $paypal . '', 
"receiverList.receiver.email" => $paypal,    
"receiverList.receiver.amount" => $price 
); 

그리고 이것은 (페이팔 웹 사이트에서 가져온) 내 청취자 코드 :

이 정보는 paykey에 전송되고, 다시 페이팔 IPN 테스트

<?php 
    $req = 'cmd=' . urlencode('_notify-validate'); 

    foreach ($_POST as $key => $value) { 
    $value = urlencode(stripslashes($value)); 
    $req .= "&$key=$value"; 
    } 

    $ch = curl_init(); 
    curl_setopt($ch, CURLOPT_URL, 'https://www.sandbox.paypal.com/cgi-bin/webscr'); 
    curl_setopt($ch, CURLOPT_HEADER, 0); 
    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_HTTPHEADER, array('Host: https://www.sandbox.paypal.com')); 
    $res = curl_exec($ch); 
    curl_close($ch); 
    $item_name = $_POST['item_name']; 
    $item_number = $_POST['item_number']; 
    $payment_status = $_POST['payment_status']; 
    $payment_amount = $_POST['mc_gross']; 
    $payment_currency = $_POST['mc_currency']; 
    $txn_id = $_POST['txn_id']; 
    $receiver_email = $_POST['receiver_email']; 
    $payer_email = $_POST['payer_email']; 

    if (strcmp ($res, "VERIFIED") == 0) { 
    $myFile = "log.txt"; 
    $fh = fopen($myFile, 'w') or die("can't open file"); 
    $stringData = "logged ' . $txn_id . '\n"; 
    fwrite($fh, $stringData); 
    fclose($fh); 
    } 
    else if (strcmp ($res, "INVALID") == 0) { 
    // log for manual investigation 
    } 
?> 

도구는 리스너가 작동 함을 증명하지만 실제 지불이 리스너에게 통지하지 않는 이유는 무엇입니까?

답변

1

라이브 코드에서 샌드 박스 URL을 사용하고 있지 않은지 확인하십시오.

당신은 페이팔 로그인으로 이동하지 않는 경우

다음 역사로 이동> IPN 역사

IPN가 전송 된 위치를 확인합니다.

메시지 ID를 클릭하십시오.

알림 URL을 확인하여 HTTP 응답 코드가 200인지 확인한 다음 IPN 메시지에 예상되는 모든 매개 변수가 포함되어 있는지 확인하십시오.

IPN History (IPN 기록) 화면으로 돌아 가면 필요한 경우 IPN을 다시 보낼 수 있습니다.

+0

HTTP 응답 코드가 200이고 IPN 메시지가 모두 좋은 것처럼 보입니다. IPN 알림 URL이 동일 함 & ipn_notification_url = mysite.com/listener.php – user1068473