CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 CC ASP developer challenge PayPal IPN

Print topic Send  topic

Author Message
Challenger
Posted: 06/04/2002, 10:11 AM

Hello all!
i am completely lost trying to intergrate the Paypal IPN into a website.
Purpose of the IPN. People place an order on your site, it is sent to Paypal, Paypal responds back if APPROVED or DECLINED, You send a reply back saying you received the response.

The challenge (use bookstore I guess)
1. Place order
2. order sent to paypal
3. confirmation received and stored in database

Good luck!
Tony
Posted: 06/05/2002, 1:45 AM

Hi,
have you search on 'paypal' keyword on this discussion board?
challenger
Posted: 06/05/2002, 5:52 AM

Yes, but there isn't any examples of this. This is the ASP example given.

ASP/VBScript
(requires Microsoft XML Parser <http://msdn.microsoft.com/xml>)

<%@LANGUAGE="VBScript"%>
<%
Dim str, OrderID, Txn_id, Payment_status
Dim objHttp

' read post from PayPal system and add 'cmd'
str = Request.Form
OrderID = Request.Form("item_number")
Txn_id = Request.Form("txn_id")
Payment_status = Request.Form("payment_status")

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

' assign posted variables to local variables
' note: additional IPN variables also available -- see IPN documentation
Item_name = Request.Form("item_name")
Receiver_email = Request.Form("receiver_email")
Item_number = Request.Form("item_number")
Invoice = Request.Form("invoice")
Payment_status = Request.Form("payment_status")
Payment_gross = Request.Form("payment_gross")
Txn_id = Request.Form("txn_id")
Payer_email = Request.Form("payer_email")

' 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 an email address in your PayPal account
' process payment
elseif (objHttp.responseText = "INVALID") then
' log for manual investigation
else
' error
end if
set objHttp = nothing
%>

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.