Return URl from payment page

Hello everyone,

I'm coming back to you because I have one last problem to solve in order to finalize my project.

I created a form from scratch without using the form tool, but block by block. At the end of my form, I need to potentially invite the user to pay their contribution, so I used utils.openurl to redirect them to the payment page, no issues there.

However, I have absolutely no idea how to handle the return from this payment.

In my scenario, I would like to replicate what is already commonly done, i.e., save the form once the payment has been made.

  1. The payment URL opens
  2. The client pays
  3. Handling of the return / success or failure
  4. Displaying the page accordingly

So, I'm stuck on parts 3 and 4.

Do you have any tips to enlighten me?