• Welcome to KonaKart Community Forum. Please login or sign up.
 

Paypal Module Callback notify_url not correct when left to default

Started by kevix, February 27, 2013, 01:04:34 pm

Previous topic - Next topic

kevix

I'm still having problems with 6.5.0.0 and Paypal callbacks not coming through. I noticed this problem...

Some payment modules have a neat feature where if the callback, success or failure urls contain "host:port" then these will be replaced with the actual values for the site, this allows a default URL to be put in the module that works out of the box.

With Paypal the success and failure URLs are modified in this way, but the callback URL is not, and you can see this in logs:


notify_url        = http://host:port/konakart/PayPalCallback.action
return             = http://example.co.uk:8780/konakart/CheckoutFinished.action
cancel_return = http://example.co.uk:8780/konakart/CatalogCheckoutExternalPaymentErrorPage.action


A quick workaround is to set the callback URL explicitly. It could also be fixed in the code in modules/src

com.konakart.bl.modules.payment.paypal.Paypal.java

change:


        parmList.add(new NameValue("notify_url", sd.getPayPalCallbackUrl()));

        sd.setPayPalReturnUrl(sd.getPayPalReturnUrl().replaceFirst(hostPortSubstitute,
                info.getHostAndPort()));
        sd.setPayPalCancelUrl(sd.getPayPalCancelUrl().replaceFirst(hostPortSubstitute,
                info.getHostAndPort()));


to:

      sd.setPayPalCallbackUrl(sd.getPayPalCallbackUrl().replaceFirst(hostPortSubstitute,
                info.getHostAndPort()));
         parmList.add(new NameValue("notify_url", sd.getPayPalCallbackUrl()));
       
sd.setPayPalReturnUrl(sd.getPayPalReturnUrl().replaceFirst(hostPortSubstitute,
                info.getHostAndPort()));
        sd.setPayPalCancelUrl(sd.getPayPalCancelUrl().replaceFirst(hostPortSubstitute,
                info.getHostAndPort()));