For the return URL, it seem you have to define the whole URL like so:
String returnURL = "http://localhost:8080/appName/shopping/confirmorder";
Now, I have a problem with the request mapping:
@RequestMapping(value = "/shopping/confirmorder?token={token}&PayerID={payerID}", method = RequestMethod.GET)
public String doGet(@PathVariable("token") String token, @PathVariable("payerID") String payerID,
HttpServletRequest request) {
// do stuff
}
The controller is never called for some reason?
The final returnURL returned from Paypal is like this:
http://localhost:8080/appName/shopping/confirmorder?token=EC-4...G&PayerID=A...W
Note the Ids have been edited.
If you have two path variables named
tokenandpayerID, then the method signature should beHow did you expect Spring to put those two strings inside a single
optionparameter of typeint?See http://static.springsource.org/spring/docs/current/spring-framework-reference/html/mvc.html#mvc-ann-requestmapping-uri-templates
Moreover, PathVariable is used to bind portions of the request path to method arguments. In your case, you have request parameters. You should thus use @RequestParam:
See http://static.springsource.org/spring/docs/current/spring-framework-reference/html/mvc.html#mvc-ann-requestparam