Question

Hi,

Currently I'm using Broadleaf Commerce 2.2.0 and want to integrate paypal. I have gone through the documentation of broadleaf commerce for paypal setup (http://docs.broadleafcommerce.org/2.2/PayPal-Environment-Setup.html).

I have created paypal sanbox account also and provided the link in broadleaf as its mention, but when I'm clicking on paypal image its not redirecting to "/payapl/checkout page" I'll get the below error in browser

HTTP ERROR 404

Problem accessing /paypal/checkout. Reason:

Not Found

and when i see my eclipse console I'll find the following error.

[ WARN] 12:12:17 PageNotFound - No mapping found for HTTP request with URI [/paypal/checkout] in DispatcherServlet with name 'marketplace'

Is anyone know why i'm getting this error???

Thanks & Regards, Ankit Aggarwal

Was it helpful?

Solution

I try do follow the same documentation and also configure paypal advance configration and now i'm able to access paypal getway.

Its little tricky here in fact i spent couple of hr. to understand the error which i was getting in browser finally i came to know its due to some packages which i was unable to call under my new paypal controller class. :P

So your controller class will look like this

package com.mycompany.controller.paypal;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.broadleafcommerce.core.checkout.service.exception.CheckoutException;
import org.broadleafcommerce.core.payment.service.exception.PaymentException;
import org.broadleafcommerce.core.pricing.service.exception.PricingException;
import org.broadleafcommerce.vendor.paypal.web.controller.BroadleafPayPalController;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class PayPalController extends BroadleafPayPalController
{
  @RequestMapping({"/paypal/checkout"})
  public String paypalCheckout(HttpServletRequest request)
    throws PaymentException
  {
    return super.paypalCheckout(request);
  }

  @RequestMapping({"/paypal/process"})
  public String paypalProcess(HttpServletRequest request, HttpServletResponse response, Model model, @RequestParam String token, @RequestParam("PayerID") String payerID)
    throws CheckoutException, PricingException
  {
    return super.paypalProcess(request, response, model, token, payerID);
  }
}

Previously i was now importing all the packages and i was getting same issue with paypal which you are getting. once i import all the packages its works like a charm for me.

Now please check and let me know if you got any error while doing so?

Regards, Ankit Patni

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top