We have a PP IPN script running for years, but for our new Affiliate software we need a few tweaks, I am stuck at one point. I'll explain briefly:
There's a javascript code snipped that we can put on the thank you page to process an order, that works wonders, but I soon realized that customers only get to such thank you page if they decide to press "go back to store" when they have completed payment. Obviously not everybody clicks this link over at PP, so we are missing sales in our affiliate software.

Now there's 2 ways to register sales if I understood it right.
1.) the javascript one, that looks like this:

<script id="pap_x2s6df8d" src="http://www/affiliate/scripts/sale.js" type="text/javascript"></script>
<script type="text/javascript"><!--

var TotalCost="XXXXXX.XX";
var OrderID="XXXXXX";
var ProductID="XXXXXX";
papSale();
--></script>

And
2.)

http://www/affiliate/scripts/sale.php?TotalCost=xxxxxx&OrderID=xxxxxx&ProductID=XXXXXX

Now I am not sure if that second works, I tried and the varaibles came up empty.

Is there a way to have that first code in an IPN, or is that a definate no-go?

Thanks,
Paul.

    Javascript will not work on an IPN.

    The second one would be the way to go.

    Once you can propagate the values in the URL from the data PP send in the IPN you can just call it with file_get_contents

      I'm not familiar with that function, but I will read up on it.

      Not sure how to get the vars to pass though, they should be there, but aren't. This is the output I should get:
      Transaction ID: 9fab3c5f
      Commission: 0.30
      Total cost: 1.00
      OrderID: 0231881752254525
      ProductID: 9999
      Date&time: 2006-09-06 10:6:25
      Affiliate: 965cd15b - pp
      Status: Approved
      IP address: 0.0.0.0
      Referrer: Typed/Bookmarked

      But I am getting this:
      Transaction ID: e954fb45
      Commission: 0
      Total cost: 0
      OrderID:

      ProductID:

      Date&time: 2006-09-06 10:6:50
      Affiliate: 965cd15b - pp
      Status: Approved
      IP address: 216.17.106.160
      Referrer:

      Any ideas how to get it right?

        To answer my own question: It works fine this way, except for finding out what the referrer was the sale from, but that is something I'd have to live with untill there's a better solution for this๐Ÿ˜‰

          10 days later

          Check with Quality Unit, the guys who sell that script. You're not the first to hit this. I'm sure there's a simple solution with PP or else with the code.

          -Peter

            Write a Reply...