Paypal returnurl registered on the page

I have a question about using PayPal on a page where a user is registered with

This is with php

How can you authorize the user to use this page if PayPal redirects back to this page.

I read something about giving session_id a custom variable with PDT And if you have multiple session variables. Can you also pass the array into a custom variable?

How to do it, codingwise

any ideas are good

change

Is the PDT user variable just some self-named name that you stick with other required variables.

So:

$ req = "tx = $ tx & at = $ token & cmd = $ cmd";

$ req. = "& somevariablename =". session_id ();

thanks richard

+2


source to share


5 answers


Maybe I missed something.

So your user logs in .. clicks the buy now button or whatever and goes to the PayPal site, when it ends, it goes back to your site on a page that is inside the user area.



This should work flawlessly, without having to do anything. IF the user spends too much time on the paypal site and the session timeout is reached on the server, or the user closes the browser and goes directly to your PayPal checkout page.

The session will stay alive for its life and the user can navigate back and forth between your site and some others without issue as long as the session timeout is resolved.

+2


source


So, if I understand correctly:

  • The user is logged in to your page.
  • They click the Paypal / Submit Form button
  • They are now at www.paypal.com completing their transaction.
  • Once completed, they are redirected back to your page.


You can use cookies, but they are not crash proof as the user can disable them.

A possible method is to create a unique identity string that will be sent to paypal so that they are redirected to their own URL with the string. On this page you check it and authorize the user.

+2


source


Just pass the current session id (get it with $ id = session_id ();) to Paypal, and once you get the user and the session id back from Paypal just set the session id to the one sent by Paypal using session_id ($ idPaypalSent);

+2


source


My apologies for bumping into the old question, but I had this problem this morning.

It turns out I forgot session_start (); DOH!

after doing this on the return (order confirmation) page, it turned out that my session was fine the whole time - it just didn't start on that particular page.

Hope this helps someone

echo 'session var:'.$_SESSION['var'];
if (!isset($_SESSION))
{
    session_start();
}
echo 'session var again:'.$_SESSION['var'];

      

+1


source


You have the wrong concept of Session ID: Session ID is not just another session variable, but session ID, so you can assign user to session variables. You can get the session id via $sess_id = session_id();

and attach it to your custom return variable as "&ppsessid=" . $sessid

. Then you can set the session id via session_id($_GET['ppsessid']);

.

0


source







All Articles