【问题标题】:Paypal payment works on sandbox but not live paypal?Paypal 付款适用于沙盒,但不适用于实时 paypal?
【发布时间】:2016-05-26 15:16:07
【问题描述】:

我们在使用 paypal 商业帐户时遇到了一些问题,在沙盒下一切正常,下面是我们用于直播的表单:

<form method="post" action="https://www.paypal.com/cgi-bin/webscr" id="paypalForm"> 
<input type="hidden" value="_xclick" name="cmd">
<input type="hidden" value="email@email.com" name="business">
<input type="hidden" value="1" name="quantity">
<input type="hidden" value="website" name="item_name">
<input type="hidden" value="MDAW" name="item_number">
<input type="hidden" value="0.3" name="amount">
<input type="hidden" value="0" name="shipping">                                
<input type="hidden" value="http://www.website.com/ipn.php" name="notify_url">
<input type="hidden" value="USD" name="currency_code">                                
<input type="hidden" value="http://website.com/orderconfirm.php" name="return">
<input type="hidden" value="12" name="custom">                                                                     <a class="btn btn-primary" href="selectpixel.php"><i class="fa fa-angle-double-left"></i> Back</a>
<button id="btnOrderForm" class="btn btn-success" type="button">Make     Payment via PayPal</button>
</form>

下面是我们在通过沙箱时正确接收自定义值的 IPN URL: http://www.website.com/ipn.php

但我们不确定 live paypal 发生了什么,我们无法返回我们的网站,甚至在成功交易后也无法收到 ipn.php 文件中的自定义变量。

IPN url 与沙盒相同,除此之外一切都相同。

当用户单击“立即付款”按钮时,它将重定向您在贝宝上,然后在付款后从贝宝重定向,以防实时贝宝交易出现混乱,用户可以成功付款,但不会返回网站和 IPN不回击http://website.com/ipn.php更新信息的url。

【问题讨论】:

  • 您确定在尝试实时交易时它甚至不会命中 IPN 脚本?您在打开 &lt;?php 标记后立即设置了日志记录,该标记将“脚本在 xx:xx PM,2016 年 2 月 15 日运行”之类的内容转储到文件中?
  • 您是否更改了贝宝商务账户中的 notify_url 设置?
  • 您介意告诉我在贝宝设置中的什么位置吗?
  • @Nate I 不,它没有击中 IPN.php 文件
  • 您是否在实时站点上启用了自动返回?除非您启用它,否则它不会自动返回。至于IPN,我很困惑。您是否收到了 IPN,但没有收到您期望的数据,或者您根本没有收到任何 IPN?

标签: php paypal sandbox


【解决方案1】:

首先,您的链接 (http://www.website.com/ipn.php) 在访问时显示“HTTP 404 - 找不到文件”。因此,您需要将此页面修改为可用页面。您可以前往链接 (https://github.com/paypal/ipn-code-samples) 获取 PayPal 最新的 IPN 示例代码,然后相应地更新到您的 IPN 脚本页面。

其次,您可以参考链接 (https://developer.paypal.com/docs/classic/button-manager/integration-guide/ButtonManagerHTMLVariables/?mark=html) 获取 PayPal 按钮的 HTML 变量。变量“return”用于在客户完成付款后将其重定向到页面的功能。变量“notify_url”是为 PayPal IPN 设计的,用于通知 Web 服务器后端有关交易信息的功能。 PayPal IPN(https://developer.paypal.com/webapps/developer/docs/classic/ipn/integration-guide/IPNIntro/)的详细信息可以到以下链接查看

【讨论】:

    【解决方案2】:

    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_xclick">
    <input type="hidden" name="business" value="email@email.com">
    <input type="hidden" name="lc" value="US">
    <input type="hidden" name="item_name" value="Test_Item">
    <input type="hidden" name="item_number" value="MDAW">
    <input type="hidden" name="amount" value="0.3">
    <input type="hidden" name="currency_code" value="USD">
    <input type="hidden" name="quantity" value="1">
    <input type="hidden" name="return" value="http://website.com/orderconfirm.php">
    <input type="hidden" name="notify_url" value="http://website.com/orderconfirm.php">
    <input type="hidden" name="button_subtype" value="products">
    <input type="hidden" name="cn" value="Add special instructions to the seller">
    <input type="hidden" name="no_shipping" value="2">
    <input type="hidden" name="weight_unit" value="lbs">
    <input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHosted">
    <input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
    <img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
    </form>

    【讨论】:

      猜你喜欢
      • 2016-07-13
      • 2019-08-01
      • 2016-05-04
      • 2017-08-08
      • 2018-11-17
      • 1970-01-01
      • 2014-11-26
      • 2016-10-27
      • 2016-07-18
      相关资源
      最近更新 更多