Paypal在发送多个项目时抛出空响应

时间:2013-11-20 16:55:38

标签: paypal paypal-ipn

我在过去几天的同一个问题上工作。发送多个项目时获得空响应。但是,对于单笔付款,我获得的是Array值。您能否请查看以下代码,并告知我们所需的任何更改。

test.php的 ..............

 <?php 
  $cur_dir='http://'.$_SERVER['SERVER_NAME'] . dirname($_SERVER['REQUEST_URI']);?>

  <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
  <INPUT TYPE="hidden" name="charset" value="utf-8">
  <input type="hidden" name="cmd" value="_cart">
  <input type="hidden" name="upload" value="1">
  <input type="hidden" name="business" value="xxxxxxx@gmail.com">
  <input type="hidden" name="currency_code" value="US">

  <input type="hidden" name="item_name_1" value="beach ball">
  <input type="hidden" name="amount_1" value="15">

  <input type="hidden" name="item_name_2" value="towel">
  <input type="hidden" name="amount_2" value="20">
  <input type="hidden" name="return" value="<?php echo $cur_dir.'/test1.php'; ?>">
  <input type="hidden" name="notify_url" value="<?php echo $cur_dir.'/test.php'; ?>">
  <input type="image" value="submit" src="images/byunow.jpg" alt="submit Button" >



              </fieldset>

          </form>

Test1.php返回空值 .................

   <?php print_r($_POST); ?> 

1 个答案:

答案 0 :(得分:0)

您可能需要为卖家帐户启用付款数据传输功能 - 请参阅:https://developer.paypal.com/webapps/developer/docs/classic/products/payment-data-transfer/

然后,您可以获取返回的数据以建立与PayPal的安全连接,以便检索付款详细信息。

但是,请注意,买家不会100%按时返回返回网址 - 因此您需要依赖IPN(请参阅:https://developer.paypal.com/webapps/developer/docs/classic/ipn/gs_IPN/)来更新订单状态等流程。

一旦新交易到达帐户,IPN就会被发送到“notify_URL”。

相关问题