tags:

views:

33

answers:

1

I used to have a "Buy Now" button that would go through PayPal, and then, through the button's advanced option, I redirected the users to a "Success" page that would give the serial for the product they purchased.

Obviously, this page had to get confirmation from PayPal, through the variables PayPal gave it, in order to know that a payment had actually been processed, and not only some person typing the page's URL in his browser to get a serial.

I did this only in PHP, without downloading any API, using, as far as I can remember, $_POST or $_SERVER variables from PayPal. There were a couple of nested "if"s, but in the end, it worked fine.

Now I've been Googling for an hour trying to find the code I used. All I find is framework downloads and bloated APIs, while I really only need to know these things:

  • Did the order process?
  • What is the email of the buyer?

I have a blank PHP file waiting for suggestions. In dummy-pseudo-code, it would go around the lines of:

<?php

    $serial = ...;

    if ($paypal_succeeded)
    {
        echo($serial);
    }

?>

Please don't tell me this is impossible, I know I already did it, I just lost my old code.

Thanks!

+1  A: 

I don't have any experience with this sort of thing, but google showed me a few possible relevant links here, here, and here.

The main page for this was https://www.paypal.com/ipn

Brandon Horsley
Thanks a lot, exactly what I was looking for!
Lazlo