Okay so I have these 5 products that users get to choose from select box and click on Pay now button (all code generated via Paypal)
These products are actually (kind of) lottery tickets, and I want to do the following:
when the users choose for example 2 lottery tickets, generate the random two numbers and store it in the db, and after the payment has been made update these two rows and set column "payed" to 1
I really have no idea on how to accomplish this because I don't know how to interact with Paypal (if that's what I have to do)
Thanks for your help
Selling with Paypal
Moderator: General Moderators
Re: Selling with Paypal
Well, the initial part should be a piece of cake (generating the numbers and storing them).
NetTuts have a nice tutorial on using PayPal's IPN here.
NetTuts have a nice tutorial on using PayPal's IPN here.
Re: Selling with Paypal
Yeah, but I don't know how to do it.oscardog wrote:Well, the initial part should be a piece of cake (generating the numbers and storing them).
NetTuts have a nice tutorial on using PayPal's IPN here.
I mean, I can create php file that will generate numbers and store them in DB with column payed=0
but how can I later find out which row(s) to update to payed=1 once the payment in completed?
Re: Selling with Paypal
Read the tutorial. It explains it all, including the response that PayPal sends when a payment is completed.tonchily wrote:Yeah, but I don't know how to do it.oscardog wrote:Well, the initial part should be a piece of cake (generating the numbers and storing them).
NetTuts have a nice tutorial on using PayPal's IPN here.
I mean, I can create php file that will generate numbers and store them in DB with column payed=0
but how can I later find out which row(s) to update to payed=1 once the payment in completed?
Look at 'Step 5 – Writing ipn.php'.
Re: Selling with Paypal
If I remember correctly using PayPals setup you are allowed to set a success page for the client to go to after the transaction. This can be success.php from there you can re open the database and change status. If you use sessions then you can track the client.
There is plenty of help on accessing a database using php Ref http://www.w3schools.com/php/
Seek and you shall find.
Terry
There is plenty of help on accessing a database using php Ref http://www.w3schools.com/php/
Seek and you shall find.
Terry