2017-04-13 70 views
1

我在localhost上工作codeigniter项目,并在其中使用PayPal沙盒付款方式进行付款。贝宝不能在localhost上工作

其中我面临的一个问题是,返回的URL不会自动重定向,当我点击返回商家按钮时,它不返回任何参数到我的网址。

我已经设置了贝宝的所有设置,我已经设置了贝宝帐户的自动返回功能,并设置了返回网址,但仍然没有收到任何回复。我正在使用此表单和参数。

$paypal_url='https://www.sandbox.paypal.com/cgi-bin/webscr'; 
<form action="<?php echo $paypal_url; ?>" method="post" name="frmPayPal1"> 
<input type="hidden" name="business" value="<?php echo $paypal_id; ?>"> 
<input type="hidden" name="cmd" value="_xclick"> 
<input type="hidden" name="item_name" value="PHPGang Payment"> 
<input type="hidden" name="item_number" value="1"> 
<input type="hidden" name="userid" value="1"> 
<input type="hidden" name="credits" value="510"> 
<input type="hidden" name="amount" value="20"> 
<input type="hidden" name="cpp_header_image" value="http://112.196.5.114/psychics/component/images/logo.png"> 
<input type="hidden" name="no_shipping" value="1"> 
<input type="hidden" name="currency_code" value="USD"> 
<input type="hidden" name="notify_url" value="http://112.196.5.114/psychics/dashboard/profile/return_url"> 
<input type="hidden" name="cancel_return" value="http://112.196.5.114/psychics/dashboard/profile/cancel_return"> 
<input type="hidden" name="return" value="http://112.196.5.114/psychics/dashboard/profile/return_url"> 
<button type="submit" class="btn btn-success"> Add Funds</button> 
</form> 

我没有得到我的错在哪里。

回答

1

你的代码是罚款,只需添加下面一行在你的代码,清除浏览器的缓存,Cookie并再试一次:

<输入类型=“隐藏”的名字=“RM”值=“2”>

注1:添加上面的代码后,PayPal将在POST方法中返回响应。

注意2:重新检查并确认您的PayPal业务经过验证的帐户必须启用自动返回功能。

您可以通过PHP标签内你的回报页面添加以下行来检查响应:

的print_r($ _ REQUEST); OR print_r($ _ POST);

有关贝宝按钮参数的更多帮助:check documentation

+0

感谢您的回复。我已经跟着你一步,完成付款后它不会自动重定向到我的返回URL。自动返回功能已启动,但它不适用于自动修复。 –

+0

当我点击返回商家时,它将重定向到返回网址并显示我所有的交易参数。但我想自动重定向它,以便我可以保存所有交易记录。谢谢 –

+0

并且付款状态即将到来。 –