나는 임베디드 페이먼트로 처리 된 적응 지불을 가지고 있습니다. 모든 것이 잘 작동하지만 (구매가 처리됨), 내 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
}
?>
도구는 리스너가 작동 함을 증명하지만 실제 지불이 리스너에게 통지하지 않는 이유는 무엇입니까?
HTTP 응답 코드가 200이고 IPN 메시지가 모두 좋은 것처럼 보입니다. IPN 알림 URL이 동일 함 & ipn_notification_url = mysite.com/listener.php – user1068473