0

in spring mvc controller i have created payPalIpnListener() method for fetching the transactions details while payment is accepted or rejected but facing problem in doing same ,since i have used IPN paytabs functionality to implement this .

below ipn listener config and sample code to fetch transactions details:

enter image description here @RequestMapping(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);
            }
        }
}

Could someone help to config IPN Listener in paytabs and how do i fetch transactions details in spring controller.

2 Answers2

0

i have searched lots of post of paytabs IPN functionality and come to know that IPN will not work with a local host IPN Listener URL so we need to configure your IPN listener with public IP.

Wrong IPN Listener URL = https://127.0.0.1:9090/UNI_VAT/payPalIpnListener

Correct IPN Listener URL = https://www.example.com/payPalIpnListener

0

You can't use local IP for IPN, you should use public IP or domain, anybody outside your network can access.

If you don't have a domain or hosting, you can use online webhook https://webhook.site

Ramy Sabry
  • 166
  • 5
  • 13