Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

186
Views
Redirection to payment gateway from rest controller

We have a form at client side. When user fills the details and clicks on submit button then the rest api called which process the data and stored in database. Now what I want is user should redirect (POST method) to third party payment gateway page from server itself with required parameters, also I don't want to use query parameter string because its visible to user. I know there are two ways of doing it,

  1. Using sendRedirect method :

    For redirection I used resp.sendRedirect("paymentgateway url"); but the problem with redirect method is that the post parameters are not sent to payment gateway.

  2. Posting form with hidden fields :

    The payment gateway redirection should be done via posting form with hidden fields but I don't know how to do it at controller level.

<form method="post" action="paymentgateway url">
    <input type="hidden" name="txnid" value="98765">
    <input type="hidden" name="amt" value="100">
</form>

Also I want to show the user loading page after he clicks submit button.

Any help will be appreciated!

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!