Classic ASP & PayPal's ASP

Posted on 2009-05-21
Medium Priority
Last Modified: 2013-11-29

I'm wondering if someone can help me put together a little code.  I'm a Classic ASP Programmer, and I need some help to fill in the blanks (...) of the following code:

Any help would be greatly appreciated.
If ... Then 'Payment has been received successfully and is in my PP
	Session("Payer_Name") = ... 'First & Last Name
	Session("Payer_EMail") = ...
	Session("Sellers_TransID") = ... 'the same number as within the confirmation e-mail at the top-right corner
End If
Response.Write(Session("Payer_Name") & "<br>")
Response.Write(Session("Payer_EMail") & "<br>")
Response.Write(Session("Sellers_TransID") & "<br>")

Open in new window

Question by:APD Toronto
  • 2

Expert Comment

by:Alpha Au
ID: 24447619
where does the data come from? a textbox? or else?

if they are from textbox, you can use request.from("textboxname")

Expert Comment

by:Alpha Au
ID: 24447622
sorry for the typo, it should be
LVL 11

Accepted Solution

Sven earned 2000 total points
ID: 24448159

Author Comment

by:APD Toronto
ID: 24462924
I have looked over PP's site 10 times, but I feel tha there is either a problem with  GoDaddy's Windows Shared Hosting (IIS7),  or with the first couple of lines of my code:
I've read http://developer.paypal-portal.com/pdn/board/message?board.id=ipn&message.id=12284&query.id=556338#M12284 , and my code is below, but I still get a "INVALID"  Can anyone help?

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")
' 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
elseif (objHttp.responseText = "INVALID") then
' log for manual investigation
' error
end if
set objHttp = nothing

Open in new window


Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

The Internet has made sending and receiving information online a breeze. But there is also the threat of unauthorized viewing, data tampering, and phoney messages. Surprisingly, a lot of business owners do not fully understand how to use security t…
There are more than 1000 cryptocurrencies available across the world, but Bitcoin has gained a significant advantage over others. The cryptocurrencies are capitalizing the market with more than $150 billion dollars.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

588 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question