-1

I have created a button that allows for users to pay via PayPal and it works, however when I get back to my page I receive no url query string to catch.

Here is the current code:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
  <button class="ato4" name="submit" type="image" onmouseover="this.style.backgroundColor='#CCC9BD';return true;" onmouseout="this.style.backgroundColor='rgba(79,129,189,0.5)';return true;" style="cursor:pointer;float:right;margin-right:490px;">
    <input type="hidden" name="cmd" value="_s-xclick">    
    <input type="hidden" name="hosted_button_id" value="V84TB5GYULLYC">
    <font class="shadowfilter">תשלום דרך האינטרנט
      <br>
      <font style="color:green;">PAYPAL</font>
    </font>
  </button>
</form>

How do I make paypal automatically redirect to my website without pressing the return button that PayPal has on their website?

apparently there is an option for all pages to auto return to -> url . well it's not as good as an individual pages but it gives the result

alien
  • 29
  • 11
  • 2
    Payment systems like PayPal usually expect an Endpoint *(basically an ASP page URL they can pass data to)* you would then in that page capture the data *(using `Request.Form`)* and process / update your database etc. – user692942 Aug 20 '15 at 15:37
  • and thats exactrly what i do but there no data on the return and i use this methode for other pay site but find it no so easy for paypal... – alien Aug 23 '15 at 07:12
  • Then there is something wrong with the configuration this time, either way its a question for PayPal support not [so] – user692942 Aug 23 '15 at 11:35

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.

Ref.: Setting PayPal return URL and making it auto return?

Community
  • 1
  • 1
MarceloBarbosa
  • 915
  • 16
  • 29
  • as i mention above i did the auto return but in order to return i need to press the button "return to...." after i or customer paid....which in my opinion no auto return. – alien Aug 23 '15 at 07:11