2

I need a solution to prevent visitors to reach pay-pal return url ( success page ) if they did not pay or paid but want to visit again .

How can I make a visitor see this returl url only 1 time right after paid via pay-pal ?

Thank you for your helps

Konrad Krakowiak
  • 11,733
  • 10
  • 53
  • 44
Bilal
  • 21
  • 3

1 Answers1

1

You have to enable auto return in your PayPal account, otherwise it will ignore the return field.

From the documentation (updated to reflect new layout):

Auto Return is turned off by default. To turn on Auto Return:

    1 - Log in to your PayPal account at https://www.paypal.com. The My Account Overview page appears.
    2 - Click the Profile subtab. The Profile Summary page appears.
    3 - Click the My Selling Tools link in the left column.
    4 - Under the Selling Online section, click the Update link in the row for Website Preferences. The Website Payment Preferences page appears
    5 - Under Auto Return for Website Payments, click the On radio button to enable Auto Return.
    6 - In the Return URL field, enter the URL to which you want your payers redirected after they complete their payments. NOTE: PayPal checks the Return URL that you enter. If the URL is not properly formatted or cannot be validated, PayPal will not activate Auto Return.
    7 - Scroll to the bottom of the page, and click the Save button.

IPN is for instant payment notification. It will give you more reliable/useful information than what you'll get from auto-return.

Documentation for IPN is here: https://www.x.com/sites/default/files/ipnguide.pdf

Online Documentation for IPN: https://developer.paypal.com/docs/classic/ipn/gs_IPN/

The general procedure is that you pass a notify_url parameter with the request, and set up a page which handles and validates IPN notifications, and PayPal will send requests to that page to notify you when payments/refunds/etc. go through. That IPN handler page would then be the correct place to update the database to mark orders as having been paid.

Pedro Lobito
  • 75,541
  • 25
  • 200
  • 222
  • thank you for answer , i already adjusted paypal ipn , paypal auto-return pdt options i just need visitors or current members should not reach / know exact url of successpage ( auto return url ) for example : www.domain.com/payment-successful i want it appear different everytime someone paid such as : www.domain.com/asd7a8sd7a89sd7a9s87da9sd7a9 ( encrypted ) or it is not encrypted but viewable only after paypal payment , and if a new visitor or old existing member know the successpage link ( auto return url ) , this person still should not view it ( it give error or redirect homepage) – Bilal Apr 16 '15 at 14:22
  • I'm using PayPal just like you need, If the buyer returns to the success page directly, let's say, in a couple of hours, it will see an error (token error...). Instead of that error , you can code the success page to redirect the user to the product page whenever an error occurs. – Pedro Lobito Apr 16 '15 at 14:35
  • My success page ( return url from paypal after purchase done ) is a wordpress page . wether a user logged or not , or purchased or not , it is currently visible to everyone . i need it is accessable only right after paypal payment . Can you suggest me something for this ? thank you for your kind support – Bilal Apr 16 '15 at 15:33
  • @bilal that's wrong. you'll need to create a php script for your return page, take a look here for an example http://www.paysketch.com/setup-paypal-pdt/ there's a complete project here too https://github.com/thenbrent/paypal-digital-goods-php-examples – Pedro Lobito Apr 16 '15 at 22:28