Reputation: 517
I was integrating my application with instamojo for payment gateway integration. and written given controller for WebHook URL
@RequestMapping(value="/instamojo/Webhook", method= RequestMethod.POST)
public ModelAndView payment(HttpServletRequest request) throws JSONException{
ModelAndView view = new ModelAndView("bookingdetail");
String payment_id = request.getParameter("payment_id");
String status = request.getParameter("status");
String email=request.getParameter("buyer");
String name=request.getParameter("buyer_name");
String phone=request.getParameter("buyer_phone");
JSONObject jObj = new JSONObject(request.getParameter("custom_fields"));
return view;
}
I am able to get payment_id, status, email, name but its not redirecting to defined ModelAndView part ("bookingdetail").Please suggest me some soultion.
Upvotes: 0
Views: 35
Reputation: 8057
If bookingdetail
is a url and not an actual view name you need to add redirect:
to the view string:
ModelAndView view = new ModelAndView("redirect:bookingdetail");
Upvotes: 1