0

I am developing a webpage which consist of two .Net MVC services:

First one is the frontend which is returning all the views and taking user input in.

Second one is my backend service which processes data.

Currently my flow looks the following:

UserForm->frontend controller method->backend service controller method->a frontend controller method -> result is shown to user

I am now trying to implement a 3-party API to my website so if some criteria is met when the user submits the UserForm I will have to redirect the user to some HTML provided by the 3-party. This HTML I show includes a callback to my website which is the URL the result of the 3-party UserForm is sent to.

When I receive this 3-party data I have to combine it with my initial UserForm data and send it to my backend for processing. But I am having a hard time figuring out how this is possible as showing the new UserForm destroys my initial UserForm input by spawning a new controller/view.

I thought about calling my backend initialy and creating some listener/event pattern to wait for the last information from 3-party callback but I cannot figure out exactly how this can be achieved.

Note that this is sensitive information so it should not be persisted or saved in cookies or similar.

Thank you in advance!

Mark York
  • 9
  • 2
  • Can you not just use ajax topost the 3rd party data back to your server? – Sean T Oct 16 '18 at 08:22
  • Sorry I am not too familiar with Ajax, how can this be done? My flow now is that I ask the 3rd party API if the user is enrolled with them and if they are the API returns some HTML that I show in a new view through a simple ViewBag injection into a new blank view. Edit: The HTML send from the API is a user form that will result in a callback to a URL i specify when calling the API. When the API make the callback they include results of the their UserForm as JSON to the specified URL. – Mark York Oct 16 '18 at 08:54
  • It's too broad a question for me to answer here. See this for an explanation https://stackoverflow.com/a/6009208/3739842 – Sean T Oct 16 '18 at 09:43

0 Answers0