Page 1 of 1

Running subscriptions in PHP, talking to PayPal

Posted: Tue Dec 15, 2009 11:24 am
by simonmlewis
We are building a subscription only web site and want to use either PayPal or Google Checkout for the subscriptions.

They will be the automated subs, but we need a way for our loginscript to talk to PayPal via Javascript or something, to see if the user's email address, and our ShopID has paid their subscription.

So someone pays via shopID 12345, using bob@bobby.com.
When they login, it queries their email and pass against our DB. If it finds the data, it then queries with PayPal/Google to see if they are paid.

THAT'S THE PART WE ARE STUCK ON.

There is something in PayPal you can use, but the user must create their username and pass on PayPal - and PayPal actually generate it, which to me is rather counter-productive.

Does anyone know a genius way to do it??

Thanks.

Re: Running subscriptions in PHP, talking to PayPal

Posted: Tue Dec 15, 2009 1:16 pm
by Christopher
When they pay with PayPal, it will return the success or failure. If payment is successful then you would add a record to a "subscriptions" table in your database with their user ID and the date their subscription expires (plus any other information, such as what they subscribed to). Then when they successfully login with their email address you can lookup the status of their account.

Re: Running subscriptions in PHP, talking to PayPal

Posted: Tue Dec 15, 2009 1:31 pm
by simonmlewis
If they are paying by subscription, and it's an automatic subscription (they don't manually do it each month), how will my system know they are all paid up?

Re: Running subscriptions in PHP, talking to PayPal

Posted: Tue Dec 15, 2009 1:53 pm
by Christopher
If it is an automatic subscription, then you will need to bill their credit card on a regular basis. You would update their subscription record each time to automatically re-subscribe them.

Re: Running subscriptions in PHP, talking to PayPal

Posted: Tue Dec 15, 2009 1:56 pm
by simonmlewis
But it's done automatically through PayPal - it doesn't touch our system as PayPal would bill them.