YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

Subscription Payments, PHP and SQL Options
Lex1103
#1 Posted : Sunday, June 26, 2011 11:05:16 AM
Rank: Starting Member

Groups: Registered

Joined: 6/26/2011
Posts: 1
I'm new to programming and Im developing a membership site where you pay for membership on a monthly basis. I have a user database where there is a PREMIUM field which I have paypal to update when they make a payment to the site.

What Im struggling to find help with is how to I get the PREMIUM field of the database to change when there subscription runs out.

At present im using PHP and paypal update the premium field from 0 to 1 to show they have paid.

What do I need to do for when the subscription runs out to change it from 1 to 0
Sponsor  
 
dmitchell
#2 Posted : Friday, July 01, 2011 4:10:51 PM
Rank: Starting Member

Groups: Registered

Joined: 6/29/2011
Posts: 2
Location: California
Hello Lex1103,

Generally for any subscription setup that I do, I will use the period3 field to set an expiration date based on the time period of the subscription. So if they subscribe for a month the expiration date will be set for a month after the purchase date. I then have my front end logic check the date to verify the user. Using this method, everytime the subscription successfully renews, a new extended date will be updated to my database and if the payment is unsuccessful then the date is not updated and the user is not allowed to access the premium content.

-Dean
robindean
#3 Posted : Wednesday, July 27, 2011 4:51:59 AM
Rank: Starting Member

Groups: Registered

Joined: 7/27/2011
Posts: 4
Location: Chicago
That's spot on how I do it as well.

I actually set a php time() timestamp that amounts to 32 days. I figure, why not give 'em an extra day to get their funds in order should paypal notify them that their charge didn't go through.

I have a question in regards to the "on0" custom inputs.

I'm using this php code (works) ...

Code:
<input type="hidden" name="on0" value="' . $account . '">


My question is ... will this value appear in my IPN every time a subscription payment goes through?

If so, that's very convenient. If not, I'll have to use the subscription ID or some other source to identify the username associated with the account.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFVision Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF | YAF © 2003-2009, Yet Another Forum.NET
This page was generated in 0.384 seconds.