在spring mvc控制器中,我创建了payPalIpnListener()方法,用于在接受或拒绝付款时获取交易细节,但在执行相同操作时会遇到问题,因为我使用了IPN paytabs功能来实现这一点。
下面是用于获取事务详细信息的ipn侦听器配置和示例代码:

@请求映射(value= {"payPalIpnListener"},method = RequestMethod.POST)
public String payPalIpnListener(ModelMap modelMap, HttpServletRequest httpServletRequest) throws Exception {
try {
Enumeration<String> parameterNames = httpServletRequest.getParameterNames();
Long paymentRef = Long.parseLong(httpServletRequest.getParameter("payment_reference"));
while (parameterNames.hasMoreElements()) {
String paramName = parameterNames.nextElement();
String[] paramValues = httpServletRequest.getParameterValues(paramName);
for (String paramValue : paramValues) {
System.out.println("paramName : " + paramName + ",paramValue : " + paramValue);
}
}
}有没有人可以帮我在paytabs中配置IPN Listener,以及如何在spring控制器中获取交易细节。
发布于 2018-11-20 18:12:21
我已经搜索了许多paytabs IPN功能的帖子,并了解到IPN将不能与本地主机IPN侦听器URL一起工作,因此我们需要为您的IPN侦听器配置公共IP。
错误的IPN监听器URL = https://127.0.0.1:9090/UNI_VAT/payPalIpnListener
正确的IPN监听器URL =
发布于 2019-03-13 01:18:46
IPN不能使用本地IP,您应该使用公网IP或公网域名,您的网络之外的任何人都可以访问。
如果您没有域名或主机,您可以使用在线webhook https://webhook.site
https://stackoverflow.com/questions/53275320
复制相似问题