【发布时间】:2017-06-19 23:07:18
【问题描述】:
我有两个文件 index.php 和 success.php 是这样的:
index.php 包含:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Paypal test</title>
</head>
<body>
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="business" value="zuhair.53957-facilitator@gmail.com">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="item_name" value="item">
<input type="hidden" name="amount" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="return" value="http://localhost/paypal/success.php">
<button type="submit">pay now</button>
</form>
</body>
</html>
并且success.php包含:
<?php print_r($_POST); ?>
当我点击“立即付款”按钮时,它会转到 PayPal,但在成功交易后,它会重定向到 success.php,而没有像这样的查询字符串:
为什么返回页面没有查询字符串?
【问题讨论】:
-
我在测试后的解决方法:我登录到我的沙盒账户 -> 个人资料 -> 我的销售工具 -> 网站偏好(更新) -> 返回 URL 并设置我的返回页面 URL。之后,它会起作用
标签: php paypal paypal-sandbox paypal-ipn