Jump to content

Paypal integration?


liamloveslearning

Recommended Posts

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  :shrug:

Link to comment
https://forums.phpfreaks.com/topic/199788-paypal-integration/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/199788-paypal-integration/#findComment-1048709
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/199788-paypal-integration/#findComment-1048723
Share on other sites

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!

Link to comment
https://forums.phpfreaks.com/topic/199788-paypal-integration/#findComment-1049149
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.