Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New to the CF scene
    Join Date
    Mar 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool how to comfirm payments that go through paypal(so the user database update for access

    basically people will come on my website make and account login in then select my game to buy(digital) then they go to paypal to pay for the game this is where i get stuck

    how can i set it up so mysql database updates the users account after the payments be made so they can access the game.

    because anyone could download the game but people cant play it without authentication from the server i.e that, that account has brought the software all this means is that the database needs to be secure and on the way back from paypal there needs to be an event where the database gets changed.

    any help would be much appreciated if i have the wrong section apologies thanks for your time!

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Paypal provide a number of different ways to attach code into the back end of the payment so that you can do what you need to when the payment is processed. So what you need to do is to pick which one you are going to use and then obtain one of their example scripts that show how to use it with your chosen programming language. You would then modify that script to perform the updates you need when it is passed the appropriate values to indicate that the payment has been made and update your Paypal account to tell Paypal to run that script when processing payments.

    The way that has been available the longest and which I use is called an IPN script.

    The script will then be called when Paypal processes the payment - for credit card and payments from a Paypal balance that will be straight away, for echeck payments it will be about four days after the person enters the request (when their bank actually pays the money to Paypal).
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #3
    New to the CF scene
    Join Date
    Mar 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by felgall View Post
    Paypal provide a number of different ways to attach code into the back end of the payment so that you can do what you need to when the payment is processed. So what you need to do is to pick which one you are going to use and then obtain one of their example scripts that show how to use it with your chosen programming language. You would then modify that script to perform the updates you need when it is passed the appropriate values to indicate that the payment has been made and update your Paypal account to tell Paypal to run that script when processing payments.

    The way that has been available the longest and which I use is called an IPN script.

    The script will then be called when Paypal processes the payment - for credit card and payments from a Paypal balance that will be straight away, for echeck payments it will be about four days after the person enters the request (when their bank actually pays the money to Paypal).
    ok so the script will only run after the money is effectively in my account?

    ill have a look see if i can find these scripts etc thank you

  • #4
    Banned
    Join Date
    Mar 2012
    Posts
    306
    Thanks
    1
    Thanked 28 Times in 28 Posts
    Quote Originally Posted by quantumarchi View Post
    ill have a look see if i can find these scripts etc thank you
    IPN = Instant Payment Notification.

    The documention and example script are on the PayPal website. The thing with IPN though is that you need to have opening sockets enabled on your web hosting account. Some ISP's might be reluctant to enable them because of the potential security risks.

  • #5
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Quote Originally Posted by Mishu View Post
    IPN = Instant Payment Notification.

    The documention and example script are on the PayPal website. The thing with IPN though is that you need to have opening sockets enabled on your web hosting account. Some ISP's might be reluctant to enable them because of the potential security risks.
    The sockets are on the standard HTTP and HTTPS ports so that if the hosting allows web pages then the ports will be open.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #6
    Banned
    Join Date
    Mar 2012
    Posts
    306
    Thanks
    1
    Thanked 28 Times in 28 Posts
    The ISP I was using at the time didn't allow me to use fsockopen() in my IPN script which I got from the PP site. After contacting them and mentioning I was a loyal customer and a good girl they enabled fsockopen for my account. They cited security reasons for not allowing fsockopen by default.
    Last edited by Mishu; 03-29-2012 at 11:32 PM.

  • #7
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    If your hosting provider doesn't allow you to use fsockopen() then you would need to choose between

    1. Dropping that step from the code and running the risk that the information received by your script didn't come from Paypal

    or

    2. Switch to a different web host. Most hosting providers should allow it as it is an essential part of verifying Paypal payments.

    Trying to use fsockopen on ports other than 80 and 443 would possibly be a different matter as those ports are far less likely to be open.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #8
    Banned
    Join Date
    Mar 2012
    Posts
    306
    Thanks
    1
    Thanked 28 Times in 28 Posts
    I don't have to choose between anything at all. I've been given access to run fsockopen. Before changing hosts, unless you want to anyway for other reasons, if you ask them for access to run fsockopen and explain why they might give it to you as my host did with me


  •  

    Posting Permissions

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