Print Page | Close Window

Paypal - payment data transfer?

Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Customizing ProductCart
Forum Description: Exchange messages with other users that are customizing ProductCart.
URL: https://forum.productcart.com/forum_posts.asp?TID=1428
Printed Date: 22-April-2025 at 11:32am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Paypal - payment data transfer?
Posted By: caughlan
Subject: Paypal - payment data transfer?
Date Posted: 08-March-2008 at 12:06am
I'm setting up an affiliate program through shareasale but because many customers use Paypal and never return back to my 'order confirmation' page, the tracking wont be triggered. Apparently i have to set up "payment data transfer' with paypal and use the following code (or a variation of) on my site. The Paypal confirmation page provided by PC seems to have similar code though...

anyone done this before, or know a trick I should be aware of? earlyimpact?

thanks in advance



<%@LANGUAGE="VBScript"%>
<%

Dim authToken, txToken
Dim query
Dim objHttp
Dim sQuerystring
Dim sParts, iParts, aParts
Dim sResults, sKey, sValue
Dim i, result
Dim firstName, lastName, itemName, mcGross, mcCurrency

authToken = "Dc7P6f0ZadXW-U1X8oxf8_vUK09EHBMD7_53IiTT-CfTpfzkN0nipFKUPYy "
txToken = Request.Querystring("tx")

query = "cmd=_notify-synch&tx=" & txToken &
"&at=" & authToken

set objHttp = Server.CreateObject("Microsoft.XMLHTTP")
' set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
objHttp.open "POST", "http://www.paypal.com/cgi-bin/webscr", false
objHttp.setRequestHeader "Content-type", "application/x-www-form-urlencoded"
objHttp.Send query

sQuerystring = objHttp.responseText

If Mid(sQuerystring,1,7) = "SUCCESS" Then
sQuerystring = Mid(sQuerystring,9)
sParts = Split(sQuerystring, vbLf)
iParts = UBound(sParts) - 1
ReDim sResults(iParts, 1)
For i = 0 To iParts
aParts = Split(sParts(i), "=")
sKey = aParts(0)
sValue = aParts(1)
sResults(i, 0) = sKey
sResults(i, 1) = sValue

Select Case sKey
Case "first_name"
firstName = sValue
Case "last_name"
lastName = sValue
Case "item_name"
itemName = sValue
Case "mc_gross"
mcGross = sValue
Case "mc_currency"
mcCurrency = sValue
End Select
Next

Response.Write("<p><h3>Your order has been received.</h3></p>")
Response.Write("<b>Details</b><br>")
Response.Write("<li>Name: " & firstName & " " & lastName & "</li>")
Response.Write("<li>Description: " & itemName & "</li>")
Response.Write("<li>Amount: " & mcCurrency & " " & mcGross & "</li>")
Response.Write("<hr>")
Else
'log for manual investigation
Response.Write("ERROR")
End If

%>





Replies:
Posted By: Matt
Date Posted: 08-March-2008 at 2:35am

Hi caughlan,

All PayPal Standard payments go through "pc/paypalOrdConfirm.asp" (even if the customer does not return to the store).  However, PayPal sends the order more than once.  To be 100% accurate you need embed you’re tracking script in the "VERIFIED" section of code (around line 295).

I hope that helps.



Posted By: caughlan
Date Posted: 10-March-2008 at 4:45am
Excellent to know - I'll give it a shot - thanks!




Posted By: caughlan
Date Posted: 13-March-2008 at 4:38am
Final update for anyone else doing this:

There was no way for us to add the shareasale code to anything other than the ordercomplete.asp file. Because we only use Paypal, we have to force people to return to the site to activate the tracking for our affiliates. It cannot be added to a 'behind the scenes' file.

so I added this code:


<INPUT type="hidden" name="cbt" value="CLICK HERE TO COMPLETE YOUR ORDER!">


to the gwpp.asp file to rename the "would you like to return to the site" button (no one ever did). It now looks as though they HAVE to - and I've had total success getting them to.

problem solved!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net