Access secure recurring payments pages and return to application

We want to integrate a subscription based recurring card payment system.

So let's say, when a user pushes a button inside a webcore app we have to open the payment gateway page (external one) - on Viva Wallet
See link:

We need to send a JSON request to a URL like this:
to obtain a new "OrderCode". This one does not requires user interaction.

Now using the order, we have to direct the user to the payment page:{OrderCode}&color={ColorCode}

And at the end we receive an answer that we have to handle again in the same webcore app.

Please help me to understand how can we achieve this behaviour.

All the best

Is this using an OAuth flow?
If so, one typically sets the callback URL to the application URL and handle the Application.OnOAuthCallBack event handler. In this event handler, check the request parameters and get the needed information from there.
This is how authentication/authorization can be done for Google Calendar for example. This is shown in demo Demo\Services\Google Calendar