TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 12-11-2009, 12:04 AM   #1 (permalink)
The Contributor
 
tego10122's Avatar
 
Join Date: Sep 2008
Location: Miami
Posts: 39
Thanks: 7
tego10122 is on a distinguished road
Default Paypal and My site Need Help!

question, how would I handle Product->Paypal->Purchase->Mysql_add_credit->update_table


So, a customer buys "Credits/Points" he'd go to the website, login. Click Buy Credits, then hed be directed to a paypal page to pay for the credit ammount he desires . I got that far now I need a method to update his credit count in the database. I can have him redirected to http://www.site.com/purchase/success...edit&ammout=40. But heres the problem... if he refreshes he can add credits with out paying or he can set http://www.site.com/purchase/success...ammount=400000 and give himself as many credit points as he wants! grr im stuck
__________________
You're Everyday Graphic Artist
Twitter|GigPark|Linked In
Send a message via MSN to tego10122
tego10122 is offline  
Reply With Quote
Old 12-11-2009, 12:57 AM   #2 (permalink)
The Addict
 
Enfernikus's Avatar
 
Join Date: Jun 2008
Posts: 335
Thanks: 2
Enfernikus is on a distinguished road
Default

To make it well and truly secure I'd upon them clicking the amount of credits wanted, store that number temporarily in the database along with their user id ( assuming your system has one for each user ) and send THAT off PayPal and weather you had them redirected to a page with the ID at the end or sent back in the post-back data it'd be secure.

Of course, you need to verify they paid the amount which correlates to their points. They could just edit their post data and pay a dime for 400000 credits.

Following possible scenario:
Person tries to randomly guess ID's, won't work because his user id is not tied to the ID in the table.
__________________
My Blog
Enfernikus is offline  
Reply With Quote
Old 12-13-2009, 06:45 PM   #3 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

Use paypal IPN to verify that payment has been sent, it is the only secure way. Base the credits off of the amount that IPN reports.
__________________

Village Idiot is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Weird Paypal IPN problem... SaintIsaiah General 8 12-08-2009 09:36 AM
Venerable methods and the applications they are commonly trusted in. Village Idiot Tips & Tricks 7 11-06-2008 07:36 AM
Paypal integration freenity Advanced PHP Programming 7 05-04-2008 10:48 AM


All times are GMT. The time now is 03:03 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design