我是 Paypal 集成的新手,我正在尝试为我的 android 应用程序实现 Paypal IPN。为了让它工作,我创建了一个网页(使用 PHP 并发送到 Paypal 沙盒帐户,方法 (GET)),我正在付款。我正在从中获取付款状态。
实际上,此网页正常工作并在向计算机浏览器付款后获得响应,但如果我使用 Android 移动浏览器付款,则同样的事情,那么我没有收到任何来自 Paypal 的付款响应。
我正在使用这个网址 IPN
这是我的 HTML 代码。
<form name="payment_form" id="payment_form" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="GET" onSubmit="return form_submit();">
<input type="text" name="amount" id="amount" value="1" readonly class="form-control left-icon">
<input type="hidden" readonly name="cmd" value="_xclick">
<input type="hidden" readonly name="business" value="Bmlpatel@gmail.com">
<input type="hidden" readonly name="item_name" value="TEST Store">
<input type="hidden" readonly name="LC" value="AL">
<input type="hidden" readonly name="country" value="USA">
<input type="hidden" readonly name="quantity" value="1">
<input type="hidden" readonly name="notify_url" value="http://XX.111.XXX.XX/payment/response.php">
<input type="hidden" readonly name="return" value="http://XX.111.XXX.XX/payment/response.php">
<input type="hidden" readonly name="cancel_url" value="http://XX.111.XXX.XX/payment/">
<input class="btn btn-success" name="action" value="Recharge" type="submit">
</form>
非常感谢对此主题的任何帮助。
最佳答案
您应该确保在您的 PayPal 设置中打开了 IPN:
- 登录您的 PayPal 帐户并转到个人资料 → 个人资料和设置 → 销售偏好 → 即时付款通知偏好: (或者 click here 直接转到页面,确保 您在单击链接之前已登录到您的 PayPal 帐户)
- 点击 PayPal 网站上的启用 IPN。
- 然后系统会提示您输入通知 URL,该 URL 应该是
任何 URL - 它只会被你的
notify_url
参数 替换
- 保存设置
如果你已经这样做了,那么你需要确保你的通知 URL 可以通过外界访问,你看起来像是在使用 IP,所以使用像 https://www.hidemyass.com/proxy 这样的东西检查您的网站是否确实可用。
如果所有其他方法均失败,则可能是 PayPal 及其从 Android 网络浏览器解码 notify_url
的方式存在问题。我遇到了这个问题,有时 notify_url
被缩短了 - 我们怀疑它只在 Android 浏览器上出现。
检查您的 IPN history在您的 PayPal 帐户上,您会看到 IPN 发送到的确切 URL 和状态。
关于php - Paypal IPN 响应未进入 Android 移动浏览器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32623691/