1

I am working on a Payment Integration System in Java Rest Api. The Gateway is Zaakpay. When a user clicks Proceed to payment my site is redirected to Zaakpay payment gateway. After a successful payment from Zaakpay it redirects the user to my returnURL.html. The Transaction Results are sent to returnURL.html as a POST Form Data in a HTTP Request.

How do I capture that POST Form Data in request and how do I forward it to Java Rest Api.

3
  • have you made nay REST service yet ? Commented Jun 4, 2015 at 6:16
  • Can we get some clarification? What have you tried so far? Commented Jun 4, 2015 at 6:18
  • I think when payment Gateway (PG) redirects to my returnUrl I must capture the Post Request params using jquery/ajax and then forward it to my rest api. Is it possible to capture Post Request params in jquery/ajax. Another way i think could be to use redirection. please help out .... Commented Jun 4, 2015 at 10:24

1 Answer 1

1

Why payment gateway is returning the result to returnURL.html ?

I think you must have specified somewhere to indicate payment gateway to return result to this URL , So instead you can provide your Controller URL path .

After that in order to intercept the post request you need a method in your controller , So here is an example of Jersey based implementation of JAX-RS

@POST
@Path("/add")
public Response addUser(
    @FormParam("name") String name,
    @FormParam("age") int age) {

<================Do Whatever you need to do here ====================>

        return Response.status(200)
        .entity("addUser is called, name : " + name + ", age : " + age)
            .build();
 }
Sign up to request clarification or add additional context in comments.

1 Comment

Neeraj thanks for your response. returnUrl.html will be the display page that calls my Rest Api Controller. Since Zaakpay sends returnUrl.html a post request I need a way to pass those post request parameters to my Rest Api. ( Like may be through Javascript or Jquert/ Ajax)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.