Stop Service If Someone Does Not Pay

I’m currently making an online service in which someone can click the buy button, and they will be taken to the PayPal site where they can pay an auto renewing bill. After, their account will be granted with full access to the server. Here’s my plan:

Once the user clicks the buy button, they are first taken to a page on my website which shoots their IP into a database. They are redirected to the PayPal page, which is set to redirect to another page on my site after a successful purchase. PHP will check the IP and see which user it belongs to. A username and password box is shown, and if details have been entered correctly, PHP pulls up their user records and tells the database they have paid.

It seems like it will work, I just have one problem. I’m not 100% sure, but I believe to cancel subscriptions they need to go through PayPal. If so, how would I set it to tell my database if the user has paid, so that it can stop giving out the service to this person if they cancel?

Unfortunately, I don’t have a good answer to the question you are asking, but I would like to help with the previous paragraph.

Paypal as a very extensive API system allowing your website to confirm which user actually paid. I personally haven’t used it to the extent you are planning, but I’ve seen it done many times. You can have PayPal post the completion variables back to your website. I’m sure their forum has links to "the right way" to do this.

Again, I don’t know how your website can make sure someone is still up to date on their Paypal subscription. This sounds like a good question for the paypal developer forum.

Tips

What now? I have some ideas for you.

Go explore CodePen!

As a front end designer and developer, you should have an account on CodePen so you can save your snippets, present your ideas, and engage with other front end folk. I'd encourage you to go PRO as well, to unlock the full power of CodePen.

Get the newsletter!

You should sign up for the CSS-Tricks newsletter. It's a clean copy of all the blog posts each week, combined together, right to your inbox. If email isn't your thing, there is an RSS feed, iTunes, and lots of other ways to subscribe.

Listen to ShopTalk!

Subscribe to The Lodge!

The Lodge is a members-only, ad-free video learning area here on CSS-Tricks. Just like the free screencasts, but organized into four large complete series. Membership is also the #1 best way to support CSS-Tricks.

We can do the real footer now.

Site Links

Colophon

CSS-Tricks* is created, written by, and maintained by Chris Coyier. It is built on WordPress, hosted by Media Temple, and the assets are served by MaxCDN. The fonts are Source Sans and Source Code Pro. It is made possible by viewers like you who subscribe to The Lodge and through advertising for products and services I like.