php - 为什么 Paypal 沙箱不重定向?

标签 php html paypal

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="POST">


                    <input type="hidden" name="invoice" id="" value="<?php echo $pay_data['order_id']; ?>" />
                    <input type="hidden" name="cmd" value="_xclick">
                    <input type="hidden" name="business" value="mymail@gmail.com">
                    <input type="hidden" name="item_name" value="suite number">
                    <input type="hidden" name="item_number" value="1">
                    <input type="hidden" name="amount" value="<?php echo $pay_data['amount']; ?>">
                    <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="bn" value="PP-BuyNowBF">

                    <input type="hidden" name="return" value="<?php echo base_url()."/home/paypal_subscripton"; ?>">
                    <input type="hidden" name="cancel_return" value="<?php echo base_url(); ?>">

                    <input type="hidden" name="notify_url" value="<?php echo base_url(); ?>" />

                    <input type="submit" value="Donate!" />
                </form>

我使用此代码成功付款。但页面没有重定向到我的网站?我的代码有什么问题?

amount: 1
bn: PP-BuyNowBF
business:   mymail@gmail.com
cancel_return:  http://localhost/ebin/Spacelance/
cmd:    _xclick
currency_code:  USD
invoice:    50d04dd5ab186
item_name:  suite number
item_number:    1
lc: US
no_note:    1
no_shipping:    1
notify_url: http://mydomain/ebin/Spacelance/
return: http://mydomain/ebin/Spacelance/home/paypal_subscripton

这是 post 参数到 paypal(来自 firebug)

最佳答案

如果您按原样使用按钮,Paypal 只会重定向拥有 Paypal 帐户的用户。他们的文档是这样说的:

Note: If you have turned on Auto Return and have chosen to turn on PayPal Account Optional for new users, a new user will not be automatically directed back to your website, but will be given the option to return.

所以我所做的是创建一个页面,我会在该页面上显示交易完成后点击“返回网站”链接的说明。尽管这是一种非常低效的处理方式。

来源:www.sandbox.paypal.com/?cmd=p/pop/express_return_learn_more

关于php - 为什么 Paypal 沙箱不重定向?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13931342/

相关文章:

php - Doctrine 2 映射引用唯一键

php - 无法在邮件中打开使用 mpdf 创建的 pdf 文件

php - 通过准备好的语句使用 INSERT INTO 的 PDO

html - 删除 Bootstrap Carousel 中的箭头

html - 如何使用 flex 将 div 高度设置为其容器的 100% 并保持垂直对齐居中?

php - Joomla3.6 fatal error : require_once(): Failed opening required

javascript - 显示消息

typescript - Nativescript 中的 Base-64 插件

PayPal Advanced 用户定义字段的最大长度

ruby-on-rails - 数字商品的 Paypal 自适应支付