1

我正在尝试将支付网关集成到我的基于 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>

我该如何解决这个问题?

4

3 回答 3

2

那是因为启用了付款审查。

在 Developer Central -> Test Accounts 中将其更改为已禁用

于 2012-08-17T07:47:09.490 回答
0

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

查看一些示例代码:

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

于 2012-08-17T07:47:19.207 回答
0

问题是您没有提到 notify_url。notify_url 是 paypal 发送 IPN 以验证商品价格、reciever_email、货币等的 url,notify_url 不应该是 localhost 的 url,因为当您现在被重定向到 paypal 时,您在 paypal 的域上,并且当 paypal 尝试完成交易后发送 IPN 命中它将获得 localhost 的 ulr,并且在 paypal 上没有类似 localhost 的内容。

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.
于 2012-08-17T08:17:02.700 回答