Jump to content


Photo

IPN Not hitting page


  • This topic is locked This topic is locked
7 replies to this topic

#1 csrussell

csrussell

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 28 December 2003 - 03:28 PM

Hello All,
I have setup a return screen for IPN. It is in ASP and it logs a dummy record to a database when the page is hit. However when I process a sale on Paypal the IPN page is not being hit as there is no new record in my tracking db.

Please help

******************
CODE BELOW
******************

<%@LANGUAGE="VBScript"%>
<%
varPageTitle = "IPN"
%>
<!--#include Virtual="/global/global.asp"-->
<%
Dim Item_name, Item_number, Payment_status, Payment_amount
Dim Txn_id, Receiver_email, Payer_email
Dim objHttp, str

' read post from PayPal system and add 'cmd'
str = Request.Form & "&cmd=_notify-validate"

' post back to PayPal system to validate
set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
' set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP.4.0")
' set objHttp = Server.CreateObject("Microsoft.XMLHTTP")
objHttp.open "POST", "https://www.paypal.com/cgi-bin/webscr", false
objHttp.setRequestHeader "Content-type", "application/x-www-form-urlencoded"
objHttp.Send str

' assign posted variables to local variables
Item_name = Request.Form("item_name")
Item_number = Request.Form("item_number")
Payment_status = Request.Form("payment_status")
Payment_amount = Request.Form("mc_gross")
Payment_currency = Request.Form("mc_currency")
Txn_id = Request.Form("txn_id")
Receiver_email = Request.Form("receiver_email")
Payer_email = Request.Form("payer_email")

Set cmdAddProduct = Server.CreateObject("ADODB.Command")
cmdAddProduct.ActiveConnection = connection_DSN
cmdAddProduct.CommandText = "GR_OrderText"
cmdAddProduct.CommandType = 4
cmdAddProduct.Parameters.Append cmdAddProduct.CreateParameter("@ORder_blob", AdVarChar, AdParamInput, 2555, "YOMAMA")
cmdAddProduct.Execute

' Check notification validation
if (objHttp.status <> 200 ) then
' HTTP error handling
elseif (objHttp.responseText = "VERIFIED") then
' check that Payment_status=Completed
' check that Txn_id has not been previously processed
' check that Receiver_email is your Primary PayPal email
' check that Payment_amount/Payment_currency are correct
' process payment
Set cmdAddProduct = Server.CreateObject("ADODB.Command")
cmdAddProduct.ActiveConnection = connection_DSN
cmdAddProduct.CommandText = "GR_OrderText"
cmdAddProduct.CommandType = 4
cmdAddProduct.Parameters.Append cmdAddProduct.CreateParameter("@ORder_blob", AdVarChar, AdParamInput, 2555, Item_number)
cmdAddProduct.Execute
elseif (objHttp.responseText = "INVALID") then
' log for manual investigation
else
' error
end if
set objHttp = nothing
%>

#2 JustAProgrammer

JustAProgrammer

    Advanced Member

  • Members
  • PipPipPip
  • 30 posts

Posted 28 December 2003 - 04:45 PM

Did you setup your ipn url at Paypal?

#3 csrussell

csrussell

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 28 December 2003 - 04:52 PM

Yes I did. I even went into the edit screen and copied and pasted the url listed on the paypal toolbox and pasted it into my URL and it worked fine.


<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by JustAProgrammer
[br]Did you setup your ipn url at Paypal?
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

#4 JustAProgrammer

JustAProgrammer

    Advanced Member

  • Members
  • PipPipPip
  • 30 posts

Posted 28 December 2003 - 05:08 PM

Does your form have a different url for notify_url? If I remember correctly, Notify_URL overrides ipn url.

I had a similar problem where the IPN did get posted to my script but somehow not all of my script ran. I found out it was because of an error in my script. Make sure your ipn script is error free. Just for testing, try setting your return_url to your ipn url, that way, you can see it runs, and if there is any error.

#5 csrussell

csrussell

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 28 December 2003 - 07:39 PM

Hmmm,
Do I need a Notify URL? I dont have one in the Form at all?



<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by JustAProgrammer
[br]Does your form have a different url for notify_url? If I remember correctly, Notify_URL overrides ipn url.

I had a similar problem where the IPN did get posted to my script but somehow not all of my script ran. I found out it was because of an error in my script. Make sure your ipn script is error free. Just for testing, try setting your return_url to your ipn url, that way, you can see it runs, and if there is any error.
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

#6 csrussell

csrussell

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 01 January 2004 - 11:06 AM

I added Notify URL and it still is not working. Is there a lag? or is there anything else I can do?

Please Help!!


<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by csrussell
[br]Hmmm,
Do I need a Notify URL? I dont have one in the Form at all?



<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by JustAProgrammer
[br]Does your form have a different url for notify_url? If I remember correctly, Notify_URL overrides ipn url.

I had a similar problem where the IPN did get posted to my script but somehow not all of my script ran. I found out it was because of an error in my script. Make sure your ipn script is error free. Just for testing, try setting your return_url to your ipn url, that way, you can see it runs, and if there is any error.
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

#7 csrussell

csrussell

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 01 January 2004 - 11:43 AM

I tested it using http://www.paypaldev...p?TOPIC_ID=1658 method and it worked fine?? RELP!!!!


<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by csrussell
[br]Hello All,
I have setup a return screen for IPN. It is in ASP and it logs a dummy record to a database when the page is hit. However when I process a sale on Paypal the IPN page is not being hit as there is no new record in my tracking db.

Please help

******************
CODE BELOW
******************

<%@LANGUAGE="VBScript"%>
<%
varPageTitle = "IPN"
%>
<!--#include Virtual="/global/global.asp"-->
<%
Dim Item_name, Item_number, Payment_status, Payment_amount
Dim Txn_id, Receiver_email, Payer_email
Dim objHttp, str

' read post from PayPal system and add 'cmd'
str = Request.Form & "&cmd=_notify-validate"

' post back to PayPal system to validate
set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
' set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP.4.0")
' set objHttp = Server.CreateObject("Microsoft.XMLHTTP")
objHttp.open "POST", "https://www.paypal.com/cgi-bin/webscr", false
objHttp.setRequestHeader "Content-type", "application/x-www-form-urlencoded"
objHttp.Send str

' assign posted variables to local variables
Item_name = Request.Form("item_name")
Item_number = Request.Form("item_number")
Payment_status = Request.Form("payment_status")
Payment_amount = Request.Form("mc_gross")
Payment_currency = Request.Form("mc_currency")
Txn_id = Request.Form("txn_id")
Receiver_email = Request.Form("receiver_email")
Payer_email = Request.Form("payer_email")

Set cmdAddProduct = Server.CreateObject("ADODB.Command")
cmdAddProduct.ActiveConnection = connection_DSN
cmdAddProduct.CommandText = "GR_OrderText"
cmdAddProduct.CommandType = 4
cmdAddProduct.Parameters.Append cmdAddProduct.CreateParameter("@ORder_blob", AdVarChar, AdParamInput, 2555, "YOMAMA")
cmdAddProduct.Execute

' Check notification validation
if (objHttp.status <> 200 ) then
' HTTP error handling
elseif (objHttp.responseText = "VERIFIED") then
' check that Payment_status=Completed
' check that Txn_id has not been previously processed
' check that Receiver_email is your Primary PayPal email
' check that Payment_amount/Payment_currency are correct
' process payment
Set cmdAddProduct = Server.CreateObject("ADODB.Command")
cmdAddProduct.ActiveConnection = connection_DSN
cmdAddProduct.CommandText = "GR_OrderText"
cmdAddProduct.CommandType = 4
cmdAddProduct.Parameters.Append cmdAddProduct.CreateParameter("@ORder_blob", AdVarChar, AdParamInput, 2555, Item_number)
cmdAddProduct.Execute
elseif (objHttp.responseText = "INVALID") then
' log for manual investigation
else
' error
end if
set objHttp = nothing
%>
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

#8 csrussell

csrussell

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 01 January 2004 - 11:46 AM

*****************************************
UPDATE
*****************************************
The context of my form is


<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="webmaster@rmqma.com">
<input type="hidden" name="item_name" value="Brake Pucks Round">
<input type="hidden" name="item_number" value="E111">
<input type="hidden" name="amount" value="0.01">
<input type="hidden" name="image_url" value="https://secure8.mavweb.net/rmqma/storelogo.gif">
<input type="hidden" name="return" value="http://dfsf">
<input type="hidden" name="cancel_return" value="http://sdfsdf">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="notify_url" value="http://www.qmparts.com/ipn.asp">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="add" value="1">

<tr>
<td> </td>
<td><input type="image" src="images/button_addtocart.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"></td>
</tr>
</form>

Charles
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by csrussell
[br]Hello All,
I have setup a return screen for IPN. It is in ASP and it logs a dummy record to a database when the page is hit. However when I process a sale on Paypal the IPN page is not being hit as there is no new record in my tracking db.

Please help

******************
CODE BELOW
******************

<%@LANGUAGE="VBScript"%>
<%
varPageTitle = "IPN"
%>
<!--#include Virtual="/global/global.asp"-->
<%
Dim Item_name, Item_number, Payment_status, Payment_amount
Dim Txn_id, Receiver_email, Payer_email
Dim objHttp, str

' read post from PayPal system and add 'cmd'
str = Request.Form & "&cmd=_notify-validate"

' post back to PayPal system to validate
set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
' set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP.4.0")
' set objHttp = Server.CreateObject("Microsoft.XMLHTTP")
objHttp.open "POST", "https://www.paypal.com/cgi-bin/webscr", false
objHttp.setRequestHeader "Content-type", "application/x-www-form-urlencoded"
objHttp.Send str

' assign posted variables to local variables
Item_name = Request.Form("item_name")
Item_number = Request.Form("item_number")
Payment_status = Request.Form("payment_status")
Payment_amount = Request.Form("mc_gross")
Payment_currency = Request.Form("mc_currency")
Txn_id = Request.Form("txn_id")
Receiver_email = Request.Form("receiver_email")
Payer_email = Request.Form("payer_email")

Set cmdAddProduct = Server.CreateObject("ADODB.Command")
cmdAddProduct.ActiveConnection = connection_DSN
cmdAddProduct.CommandText = "GR_OrderText"
cmdAddProduct.CommandType = 4
cmdAddProduct.Parameters.Append cmdAddProduct.CreateParameter("@ORder_blob", AdVarChar, AdParamInput, 2555, "YOMAMA")
cmdAddProduct.Execute

' Check notification validation
if (objHttp.status <> 200 ) then
' HTTP error handling
elseif (objHttp.responseText = "VERIFIED") then
' check that Payment_status=Completed
' check that Txn_id has not been previously processed
' check that Receiver_email is your Primary PayPal email
' check that Payment_amount/Payment_currency are correct
' process payment
Set cmdAddProduct = Server.CreateObject("ADODB.Command")
cmdAddProduct.ActiveConnection = connection_DSN
cmdAddProduct.CommandText = "GR_OrderText"
cmdAddProduct.CommandType = 4
cmdAddProduct.Parameters.Append cmdAddProduct.CreateParameter("@ORder_blob", AdVarChar, AdParamInput, 2555, Item_number)
cmdAddProduct.Execute
elseif (objHttp.responseText = "INVALID") then
' log for manual investigation
else
' error
end if
set objHttp = nothing
%>
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users