I am making my first subscription based website in MVC4 / C# / Razor and have created an Authorize.net "Card Not Present" sandbox account for testing.
I have implemented the subscription and it works like a charm. I am redirecting the new subscriber to the "Registration" page using the built in Visual Studio 2013 site that is created by default.
I have saved the SubscriptionId that was returned from Authorize.net and put it into a session variable. I then look at that session on the Registration page to see if it has a value or not. If there is a value then I allow the user to create an account, otherwise I redirect them to an error page.
Is there anything you think I should add / best practices? I also planned on storing the SubscriptionId with the account when it gets created so I have a way to link up the user to a subscription on Auth.net's website.
Second question: Is there a way to ping Auth.net every time a user logs in so I can check to see if they still have an Active subscription? I would imagine that storing the SubscriptionId would be helpful so that is why I am saving it. I checked the documentation from Authorize.net and didn't see anything... I want to make sure people aren't getting a free ride out of the site...
Thanks in advance for your help / suggestions...
For your second question, if you've stored the subscriptionId in your database, you can use ARBGetSubscriptionStatusRequest to determine if they have an active subscription.
http://developer.authorize.net/api/reference/#recurring-billing-get-subscription-status