简体   繁体   中英

Paypal success return URL

I need to set custom variable URL after success paying. For example I need return url to be http://site-address.com/file.php ? id=1&code=34hGfrT23Hq&sum=10 . How can I make this? In javascript I build this link. I inserted it in

<input type="hidden" name="notify_url" value="my link"/>

Their support is very slow and useless in this case.

If you know where the return URL is intended to be when they arrive back from PayPal to their purchasing page then you could load "my_link" with php variables and use it to redirect when they arrive back:

 <?php
 $my_link =  'http://site-address.com/file.php?';
 $my_link .= 'id=' . $id;
 $my_link .= '&code=' . $code;
 $my_link .= '&sum=' . $sum;

 header("Location: $my_link");
 exit;
 ?>

Looking at this page Setting PayPal return URL and making it auto return? Prashanth Pratapagiri's answer seems to suggest it is the "return" and not the notify_url which does the work, so you would need this on a hidden input for use before it is submitted:

 <input type="hidden" name="return" value="<?php echo $my_link; ?>"/>

These might have a few pointers to help with setting up query strings with JavaScript: HTML form not changing URL as expected

IPN -Instant Payment Notification might help, and PayPal provide basic scripts for that which enable you to do processes which are in response to the instant notification when you get it. This has a fair bit of explanation: using paypal button - can my webpage tell if paypal transaction was successful or not?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM