liamloveslearning Posted April 26, 2010 Share Posted April 26, 2010 Hi everyone, having a nightmare trying to implement paypal with a website im building, To give everyone an idea of what im doing... Users can register on the site and upload photos, I then need a buynow button next to each photo so somebody can click that, pay via paypal and be redirected to the hi res file. In paypal im asked for an autoreturn url, but i need mine to contain an encrypted image id and not remain a static url, i hope this makes sense? has anybody had previous experience with this? dumbfounded Quote Link to comment https://forums.phpfreaks.com/topic/199788-paypal-integration/ Share on other sites More sharing options...
PFMaBiSmAd Posted April 26, 2010 Share Posted April 26, 2010 The autoreturn URL is specific to one buynow button and it is static. I would use something like http://your_domain.com/return.php?id=x for the URL (where x is different for each buynow button, so that you can use a single file.) You would need to put code in the return.php file to get the id value and check if the current visitor actually paid (i.e. using paypal Instant Payment Notification and storing the paid status in a database table) and can access the full size image (i.e. it should take more than just knowing the URL and trying various values - return.php?id=1, return.php?id=2, return.php?id=3, ... to access the full size image.) You could have return.php directly output the correct full size image (after making the necessary checks) or you can generate a unique URL for that visitor and that image and either perform a redirect to that URL or output a link to it on the return.php page. Quote Link to comment https://forums.phpfreaks.com/topic/199788-paypal-integration/#findComment-1048709 Share on other sites More sharing options...
angelleye Posted April 26, 2010 Share Posted April 26, 2010 You can specify a return_url in your html button code (as well as API requests) that will override anything you have set in your account profile. This way you can send dynamic return URL's with each payment instead of setting up a static URL in your profile. When using PayPal Standard, though, there is no guarantee the user will end up back at your site even with auto-return turned on. They could close the browser before the return happens. If you need to rely on this for updating a database, sending out email receipts, etc. you should use IPN and notify_url instead. Quote Link to comment https://forums.phpfreaks.com/topic/199788-paypal-integration/#findComment-1048723 Share on other sites More sharing options...
liamloveslearning Posted April 27, 2010 Author Share Posted April 27, 2010 You can specify a return_url in your html button code (as well as API requests) that will override anything you have set in your account profile. This way you can send dynamic return URL's with each payment instead of setting up a static URL in your profile. So in the generated HTML paypal provide me I can cut and hack at it to fit my needs and it wont affect the transaction process? I think its a wise idea to use IPN and notify_url, tanks for all your help! Quote Link to comment https://forums.phpfreaks.com/topic/199788-paypal-integration/#findComment-1049149 Share on other sites More sharing options...
PFMaBiSmAd Posted April 27, 2010 Share Posted April 27, 2010 If you put the dynamically generated URL into the HTML form, it will be in the hands of the visitor BEFORE he pays and he can use it or modify it any way he wants before payment. Quote Link to comment https://forums.phpfreaks.com/topic/199788-paypal-integration/#findComment-1049253 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.