Redirecting to event registration page

I’m trying to redirect the user to his registration summary page after receiving a successful payment post back from the payment processor. I’m not able to comprehend the indico wrapper utitlies for fetching the registrant, and passing those details to the view. Currently the code looks like this - but it’s just rendering the “Bad Request” view instead of showing registration details.

blueprint.add_url_rule('!/touchnet/upay/success', 'success', RHTouchNetSuccess, methods=('GET', 'POST'))

class RHTouchNetSuccess(RHTouchNetIPN):
    """Confirmation message after successful payment"""

    def _process(self):
        flash(_('Your payment request has been processed.'), 'success')
        return redirect(url_for('event_registration.display_regform', self.registration.locator.registrant))

Appreciate any help! Thanks!

Hi, if you want redirect to the registration summary, this should work:

redirect(url_for('event_registration.registration_details', self.registration))
1 Like

Hello, @ThiefMaster @troun

I have some trouble understanding the redirection workflow. When a payment is succesful, the payment processor sends a post request to the indico server and the application marks the payment as successfl.
How is the end client redirected to the success page? For the end client browser to see the registration page, the client browser (chrome) must make a GET request to the correct URL. How does the indico application make the client browser initiate a GET request? In my case, the application is still redirecting to an incorrect URL registered with the payment processor. Thanks.