2

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.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Nicolae Casîr
  • 892
  • 1
  • 10
  • 18

1 Answers1

0

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?

Community
  • 1
  • 1
Steve
  • 808
  • 1
  • 9
  • 14