Php paypal链接支付ipn未返回通知
我使用以下代码进行PayPal链接支付Php paypal链接支付ipn未返回通知,php,paypal,Php,Paypal,我使用以下代码进行PayPal链接支付 require_once ("paypalplatform.php"); $amount=100; $amt1=($amount * 10 )/100; $amt2=$amount-$amt1; $actionType = "PAY"; $cancelUrl = "http://test.com/test"; $returnUrl = "http://test.com/test"; $currency
require_once ("paypalplatform.php");
$amount=100;
$amt1=($amount * 10 )/100;
$amt2=$amount-$amt1;
$actionType = "PAY";
$cancelUrl = "http://test.com/test";
$returnUrl = "http://test.com/test";
$currencyCode = "USD";
$receiverEmailArray = array(
'a***********_per@gmail.com',
'a***********_biz@gmail.com'
);
$receiverAmountArray = array(
$amt1,
$amt2
);
$receiverPrimaryArray = array();
$receiverInvoiceIdArray = array(
'1',
'2'
);
$senderEmail = "a************_per@gmail.com";
$feesPayer = "";
$ipnNotificationUrl = "http://test.com/paypal/buynow.php";
$memo = "";
$pin = "agalameex";
$preapprovalKey = "";
$reverseAllParallelPaymentsOnError = "";
$trackingId = generateTrackingID();
$resArray = CallPay ($actionType, $cancelUrl, $returnUrl, $currencyCode, $receiverEmailArray,
$receiverAmountArray, $receiverPrimaryArray, $receiverInvoiceIdArray,
$feesPayer, $ipnNotificationUrl, $memo, $pin, $preapprovalKey,
$reverseAllParallelPaymentsOnError, $senderEmail, $trackingId
);
$ack = strtoupper($resArray["responseEnvelope.ack"]);
if($ack=="SUCCESS")
{
if ("" == $preapprovalKey)
{
// redirect for web approval flow
$cmd = "cmd=_ap-payment&paykey=" . urldecode($resArray["payKey"]);
RedirectToPayPal ( $cmd );
}
else
{
// payKey is the key that you can use to identify the result from this Pay call
$payKey = urldecode($resArray["payKey"]);
// paymentExecStatus is the status of the payment
$paymentExecStatus = urldecode($resArray["paymentExecStatus"]);
}
}
else
{
//Display a user friendly Error on the page using any of the following error information returned by PayPal
//TODO - There can be more than 1 error, so check for "error(1).errorId", then "error(2).errorId", and so on until you find no more errors.
$ErrorCode = urldecode($resArray["error(0).errorId"]);
$ErrorMsg = urldecode($resArray["error(0).message"]);
$ErrorDomain = urldecode($resArray["error(0).domain"]);
$ErrorSeverity = urldecode($resArray["error(0).severity"]);
$ErrorCategory = urldecode($resArray["error(0).category"]);
echo "Preapproval API call failed. ";
echo "Detailed Error Message: " . $ErrorMsg;
echo "Error Code: " . $ErrorCode;
echo "Error Severity: " . $ErrorSeverity;
echo "Error Domain: " . $ErrorDomain;
echo "Error Category: " . $ErrorCategory;
}
在上面的代码中,除了返回通知($ipnNotificationUrl)之外,其他一切都正常工作。付款完成后,我没有从$ipnNotificationUrl收到任何通知。有人能帮我吗?调试提示:在PayPal后端检查IPN配置。用一个简单的脚本替换您的脚本,该脚本只显示调用它的时间和输入内容。在PayPal中检查您的IPN历史记录。如果它显示的不是200响应代码,那么您就知道IPN侦听器有问题 您可以检查web服务器日志,以查看在命中脚本时发生的错误 或者,您可以设置一个简单的HTML表单,其中包含与您期望从PayPal获得的内容相匹配的隐藏字段。然后你可以在浏览器中提交,这样你就可以在屏幕上看到结果
请记住,以这种方式进行测试将导致PayPal返回无效响应,因为IPN数据不是来自他们的服务器,但您可以根据测试目的进行相应调整,解决问题,然后您就可以继续了。投反对票,但没有评论?有用。我的读心模块尚未启用。