ProductCart E-Commerce Solutions Homepage
Forum Home Forum Home > ProductCart > Customizing ProductCart
  New Posts New Posts RSS Feed - Paypal - payment data transfer?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Paypal - payment data transfer?

 Post Reply Post Reply
Author
Message
caughlan View Drop Down
Groupie
Groupie
Avatar

Joined: 25-September-2006
Location: Canada
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote caughlan Quote  Post ReplyReply Direct Link To This Post Topic: Paypal - payment data transfer?
    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

%>


Back to Top
Matt View Drop Down
Moderator Group
Moderator Group


Joined: 20-July-2006
Location: United States
Status: Offline
Points: 73
Post Options Post Options   Thanks (0) Thanks(0)   Quote Matt Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
caughlan View Drop Down
Groupie
Groupie
Avatar

Joined: 25-September-2006
Location: Canada
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote caughlan Quote  Post ReplyReply Direct Link To This Post Posted: 10-March-2008 at 4:45am
Excellent to know - I'll give it a shot - thanks!


Back to Top
caughlan View Drop Down
Groupie
Groupie
Avatar

Joined: 25-September-2006
Location: Canada
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote caughlan Quote  Post ReplyReply Direct Link To This Post 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!
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.