SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: PHP vs Paypal

  1. #1
    SitePoint Member
    Join Date
    Aug 2013
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP vs Paypal

    Hello All,

    Ultra-newbie and PHP extra-virgin here, with a grovelling apology if this is the wrong bit of the forum.

    I'm building my new site in Dreamweaver, but I have a 'test' site up on Yola. The site is a pay-to-enter 'museum' and I'd like it to work like this...

    Punter clicks on PayPal button, goes to Paypal and pays (a paltry sum).

    Punter is taken to my 'Lobby' page from which he/she can access all the site's pages.

    After a set time (say, 24 hours), the punter loses access to the site.

    So here's what I'd like to have PHP do...

    Paypal tells the site of the purchase.

    I get a notification with the punter's info (e.g. who, where, when + mail address).

    PHP uses the Paypal info to send a 'thanks for calling' e-mail.

    Punter is taken to the Lobby page

    He/she can swill about in the site but the timer's running, and blocks access after 24 hours.

    This will become clear after a look at the test site. It's at www.dead-interesting.co.uk

    To get past the PayPal page for a look around, fill in the username value as 'admit' and the password as 'one'...(no quotes).

    Think 'Sideshow'

    Just as an aside, I'm not a developer and so respond to the K.I.S.S. principle. I don't even know where PHP scripts go.

    Be gentle with me

  2. #2
    SitePoint Evangelist
    Join Date
    Aug 2006
    Location
    Nantwich, Cheshire
    Posts
    408
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I'd have a look at the PayPal IPN documentation (Instant Payment Notification). At the point your user creates their account, you'd show a form with a button to submit to PayPal, await the IPN confirmation from their site, store the date/time in your user login database (to do the 24 hour thing) and continue to the protected content. So I'd picture:

    Form to create account, like your current login form, but gets email address and whatever else you need. Submit button creates record in your users database with a blank 'activated' field.

    Confirmation page displays a form to submit to PayPal which contains your PP details and a unique reference number. User presses button and is taken to PayPal site.

    If the purchase is completed, PP returns user to your specified landing page which then sets the 'activated' date/time and continues.

    *But*, I haven't looked at PayPal for a couple of years, so the above might be rubbish and there might be a new great way of doing it.
    http://www.firenza.net - my homage to a car from the 1970s

  3. #3
    SitePoint Member
    Join Date
    Aug 2013
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by droopsnoot View Post
    I'd have a look at the PayPal IPN documentation (Instant Payment Notification). At the point your user creates their account, you'd show a form with a button to submit to PayPal, await the IPN confirmation from their site, store the date/time in your user login database (to do the 24 hour thing) and continue to the protected content. So I'd picture:

    Form to create account, like your current login form, but gets email address and whatever else you need. Submit button creates record in your users database with a blank 'activated' field.

    Confirmation page displays a form to submit to PayPal which contains your PP details and a unique reference number. User presses button and is taken to PayPal site.

    If the purchase is completed, PP returns user to your specified landing page which then sets the 'activated' date/time and continues.

    *But*, I haven't looked at PayPal for a couple of years, so the above might be rubbish and there might be a new great way of doing it.
    Thanks Droopsnoot,

    The picture becomes a little clearer and I believe it all still works the same way as ever at PayPal. The use of a cookie sent to the customer's machine (to do the 24-hr access job) was also mentioned. My search will continue :-)

    Thanks again.

    PS: You might find this interesting http://en.wikipedia.org/wiki/Gerry_Marshall


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •