Jump to content


Photo

Using PDT with ASP -> always error message


  • This topic is locked This topic is locked
1 reply to this topic

#1 BloodSeaker

BloodSeaker

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 27 May 2005 - 07:12 AM

Hi, I'm trying to setup PDT in order to give the customer the correct feedback about his payment

But, I'm always getting the error part, even if the payment was completed succesfully. I've turned on auto return, entered the correct url, turned on PDT and turned of IPN. I'm using my unique identifier string, but still it does not work. Can onay one help me out? This is my script (I've adjusted my unique identifier key though)


<%@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 = "FiOifgReFm6JasH_1zpr3F4FeF_WNV5dxRamgzAzmYGdXltrc4bjv2BAm-4"
txToken = request.querystring("tx")

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

set objHTTP = Server.CreateObject("Microsoft.XMLHTTP")
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(qSuerystring,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
%>
<h2>[PAYPAL PAYMENT]</h2>
<p>
Your payment has been successfully completed.
</p>
<p>
<u><i>Details</i></u><br />
Name :<%=firstName%> <%=lastName%><br />
Description: <%=itemName%><br />
Amount: <%=mcCurrency%> <%=mcGross%>
</p>
<%
else
%>
An error has occured while processing your order. Please verify that your payment is completed by checking in
into you Paypal account.
<%
end if
%>

#2 BloodSeaker

BloodSeaker

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 28 May 2005 - 01:34 AM

OMG, this post may be closed

STUPID ME

I typed Qsuerystring somewhere in stead of sQuerystring




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users