Seperation of notification confirmation+storage and handling notification asp.net mvc
- by bastijn
After a payment from my web application to a 3rd party the 3rd party sends, next to the direct confirmation message, a notification message. This notification message is stored in my database for future use and I have to send a notification confirmed back.
For this purpose I currently use a:
return Content("received")
Which is standard protocol for the service. Currently, I process the incoming notification by first storing it, than handling it (updating account credits etc in my application) and in the end sending a response. This all works well. But I want to seperate handling the notification and storing+responding to the webservice.
The problem is that the "return Content()" is ending my controller method and therefore I cannot simply first send the confirmation message back to the webservice and than call my handle_Notification() method.
So the solution would be to replace the return Content() part with something equal which doesn't involve a "return", is this possible, as I do not now the complete URL calling I cannot easily create a simple HTTP POST web request (I tried, might have made an error but did not work).
Another solution would be to have some kind of timer or listener which either periodically checks for new notifications in the Database which have to be handled or a listener listening to DB new notifications or something.
What is the standard procedure on this, if any?