...

View Full Version : how to comfirm payments that go through paypal(so the user database update for access



quantumarchi
03-28-2012, 08:15 PM
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!

felgall
03-28-2012, 09:37 PM
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).

quantumarchi
03-28-2012, 10:57 PM
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

Mishu
03-29-2012, 11:12 AM
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.

felgall
03-29-2012, 07:20 PM
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.

Mishu
03-29-2012, 10:10 PM
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.

felgall
03-30-2012, 02:07 AM
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.

Mishu
03-30-2012, 12:36 PM
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 :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum