付款后,PayPal显示状态为“待处理”


Paypal is showing status 'Pending' after payment

我正在尝试将支付网关集成到我的基于 PHP 的应用程序中。为此,我正在使用沙盒。但是付款后,状态显示为待处理,尽管金额已从帐户中扣除。

我的代码是这样的:

<form name="frm" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_xclick" />
     <input type="hidden" name="business" value="sri_1338363856_biz@gmail.com" />
     <input type="hidden" name="amount" value="<?php echo get_plan_value($plan_id); ?>" />
     <input type="hidden" name="no_shipping" value="1" />
     <input type="hidden" name="no_note" value="1" />
     <input type="hidden" name="currency_code" value="USD" />
     <input type="hidden" name="lc" value="US" />
     <input type="hidden" name="item_name" value="<?php echo get_plan_name_by_value($_REQUEST['bus_plan']) ?> Registration" />
     <input type="hidden" name="bn" value="PP-BuyNowBF" />
     <input type="hidden" name="return" value="http://localhost/uploaded_server_alert/backup/alertR/business/payments-over.php?last_id=<?php echo $lastId; ?>&agent_email=<?php echo $agent_email; ?>&username=<?php echo ($uname); ?>&contact_email=<?php echo $contact_email; ?>" />
     <input type="hidden" name="rm" value="2" />
     <input type="submit"  border="0" name="submit" value="Order Now" alt="Make payments with PayPal - it's fast, free and secure!" class="additional_height" title="Make payments with PayPal - it's fast, free and secure!" />
     <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" /> 
  </form>

我该如何解决问题?

这是因为已启用付款审核。

在开发人员中心->测试帐户中将其更改为"已禁用"

仔细检查您的 IPN 侦听器和 IPN 处理程序。

查看一些示例代码:

http://www.micahcarrick.com/paypal-ipn-with-php.htmlhttp://www.evoluted.net/thinktank/web-development/paypal-php-integration

> 问题是您没有提到notify_url notify_url是PayPal发送 IPN 以验证商品价格、reciever_email、货币等的 URL,notify_url不应该是 localhost 的 URL,因为当您被重定向到PayPal现在您在PayPal的域上时,交易完成后PayPal尝试发送 IPN 命中时,它将获得本地主机的 ulr,什么都没有就像PayPal上的本地主机一样。

Write following input tag: 
<input type="hidden" id="notify_url" name="notify_url" value="url of ipn listener"/> 
in above tag replace value by your ipn listener url.