tags:

views:

35

answers:

1

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?

+1  A: 

If your project is a little bit bigger it makes sense to have a service that handles the complete workflow for order fullfillment including confirmation of payments.

In our service we dont wait for notification of payment providers, but activily pull this data. If this is paypal then you have both options. Whatever way you go, always take into account that payment providers will be offline at some point. This should not affect your web application or order fullfillment service.

Malcolm Frexner
Unfortunately I cannot pull the information. But the offline tip is indeed true :).
bastijn