YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

Notification from Paypal Options
nathaned
#1 Posted : Saturday, November 16, 2002 10:13:04 PM
Rank: Starting Member

Groups: Registered

Joined: 11/16/2002
Posts: 15
Location: ,
Why is it that the paypal keeps sending the information to the ipn page you specify? Are they planning on integrating something that waits for a response to end the transmission? I have developed a table that updates the txn_id and then only handles the form if the txn_id doesn't exist but that seems like a silly way of handling it. Thanks for you time, Nathan
Sponsor  
 
EliteWeaver
#2 Posted : Sunday, November 17, 2002 1:13:38 AM
Rank: Starting Member

Groups: Registered

Joined: 10/22/2002
Posts: 239
Location: ,
PayPal will keep sending IPN's until your script replies with a basic HTTP 200 response code. This ensures that you will not miss a notification if your server is down or there is a network issue. If your script does not give out a HTTP 200 response status then it will be hit with the same IPN at one second, two seconds, four seconds and eight seconds etc... for up to 1.5 days!

If your script does give out a HTTP 200 response then PayPal will stop sending you any duplicate notifications :)

Ingenious if you ask me!


Hope this helped?


Kindest regards,

Marcus Cicero
ELiteWeaver UK
nathaned
#3 Posted : Sunday, November 17, 2002 1:22:26 AM
Rank: Starting Member

Groups: Registered

Joined: 11/16/2002
Posts: 15
Location: ,
What would that look like on my page if I were to sent them a HTTP "200 OK" response? My page is all asp if that matters.
Thanks for you help, I am still pretty much a green bean at this stuff.
Nathan
rixhq
#4 Posted : Sunday, November 17, 2002 8:12:41 PM
Rank: Starting Member

Groups: Registered

Joined: 11/17/2002
Posts: 4
Location: ,

your page isn't usually the one sending a 200 response...
it's the webserver your page is running on which should do it... if it doesn't send a 200 response there are several possible reasons:
- the link is incorrect so paypal gets a 404 response
- your page contains an error so it sends a 500 server error instead to paypal
- if you are sending a redirect code (=usually 304)

you could try to simulate what paypal does by creating a webform which posts the ipn vars to your script and see what happens.





Regards,

Ricardo.
nathaned
#5 Posted : Sunday, November 17, 2002 10:42:52 PM
Rank: Starting Member

Groups: Registered

Joined: 11/16/2002
Posts: 15
Location: ,
Thanks for your guys' help...

So if anywhere in my page I have a response.redirect the server will send the status of 300. In my script I handle it like this...

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/connstore.asp" -->

<%

Dim Item_ID 'variable passed back by PayPal


'read post from PayPal system and add 'cmd'
str = Request.Form
Item_ID = Request.Form("Item_Number1")
Payment_status = Request.Form("payment_status")

' Post back to PayPal system to validate
str = str & "&cmd=_notify-validate"
set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP.4.0")
objHttp.open "POST", "https://www.paypal.com/cgi-bin/webscr", false
objHttp.Send str

' Check notification validation
If (Item_ID <> "") then
if (objHttp.status <> 200 ) then
response.Redirect("pagenotavail.htm")
'check to see if it was a purchase made through www.rrrtifax.com
elseif (Payment_status = "PENDING") then
set Cm = Server.CreateObject("ADODB.Command")
Cm.ActiveConnection = MM_connStore_STRING
Cm.CommandText = "UPDATE tblProducts SET SoldFlag = true WHERE Item_ID = '" & Item_ID & "'"
Cm.CommandType = 1
Cm.Execute
response.Redirect("thankyou.htm")
elseif (Payment_status = "FAILED") then
response.Redirect("statusfailed.htm")
elseIf (objHttp.responseText <> "VERIFIED" and Payment_status = "COMPLETED") then


'update the item to sold after a confirmation from paypal
set Cm = Server.CreateObject("ADODB.Command")
Cm.ActiveConnection = MM_connStore_STRING
Cm.CommandText = "UPDATE tblProducts SET SoldFlag = true WHERE Item_ID = '" & Item_ID & "'"
Cm.CommandType = 1
Cm.Execute


'We end the insert into our database table
End If
End If
response.Redirect("thankyou.htm")%>

Would these redirects be my problem?

Thanks again,
Nathan
nathaned
#6 Posted : Monday, November 18, 2002 12:39:59 AM
Rank: Starting Member

Groups: Registered

Joined: 11/16/2002
Posts: 15
Location: ,
Got it, you can't have a response.redirect in your ipn page otherwise you http status will be a 300.

Nathan
EliteWeaver
#7 Posted : Monday, November 18, 2002 1:00:06 AM
Rank: Starting Member

Groups: Registered

Joined: 10/22/2002
Posts: 239
Location: ,
Template = server.mappath("thankyou.htm")
Set Output = CreateObject("Scripting.FileSystemObject")
Set Template = Output.OpenTextFile(Template, 1, False)
HTML_Output = Template.ReadAll
HTML_Output = Replace(HTML_Output, "<-Receiver_Email->", Receiver_Email)

' bah, blah, blah down the list we go....

Response.Write (HTML_Output)
Template.Close
Set Template = Nothing
Set Output = Nothing

Pull your page into your IPN script itself like so and use some variable tags to greet your customers by <-First_Name-> in the process ;-)


Hope this helped?


Kindest regards,

Marcus Cicero
EliteWeaver UK
nathaned
#8 Posted : Monday, November 18, 2002 1:51:17 AM
Rank: Starting Member

Groups: Registered

Joined: 11/16/2002
Posts: 15
Location: ,
Thanks, I just solved it calling a sub with the html
DaveC
#9 Posted : Monday, November 18, 2002 9:23:10 AM
Rank: Starting Member

Groups: Registered

Joined: 11/16/2002
Posts: 37
Location: ,
Your IPN doesn't need a redirect. This page is solely used by paypal and the customer never sees it.

Web development - http://www.revilloc.com
EliteWeaver
#10 Posted : Monday, November 18, 2002 5:09:27 PM
Rank: Starting Member

Groups: Registered

Joined: 10/22/2002
Posts: 239
Location: ,
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by DaveC
[br]Your IPN doesn't need a redirect. This page is solely used by paypal and the customer never sees it.

Web development - http://www.revilloc.com
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

I think Nathan is processing the "duplicate" IPN that gets sent to the PayPal return page when the customer clicks "continue" after payment has been made. In this case the customer will see it ;-)

Marcus -
nathaned
#11 Posted : Wednesday, November 20, 2002 6:00:38 PM
Rank: Starting Member

Groups: Registered

Joined: 11/16/2002
Posts: 15
Location: ,
Upon transaction success the customer is directed to the the ipn page so that I can personalize a confirmation for the customer letting him/her know that the transaction has processed and when to expect them to ship. I think this is a better solution so that the customer isn't bombarded with 5 emails about their transaction.
nuander
#12 Posted : Wednesday, November 27, 2002 2:00:15 PM
Rank: Starting Member

Groups: Registered

Joined: 11/27/2002
Posts: 10
Location: ,
I'm confused...

Are you using both the IPN profile URL AND posting a URL in the "return" variable as well?

If so, what is the order of events? What if paypal's server sends the IPN response before the user can click on the "Continue" link on the paypal payment page?

Also, if you are using an ipn page, won't PayPal get an http 200 response when your page is "hit" and not from a response.redirect or from the
objHttp.open "POST", "https://www.paypal.com/cgi-bin/webscr", false
objHttp.Send str
?

Thanks
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFVision Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF | YAF © 2003-2009, Yet Another Forum.NET
This page was generated in 0.514 seconds.