Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Paypal subscription IPN!
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Viccan
Starting Member

7 Posts

Posted - 07 March 2005 :  19:59:45  Show Profile
I've integratd my website into Snitz forums, i.e. I use Snitz login for the whole website. Now I want to charge new members for subscriotions, and understand the most practic way is to use Paypal. I can't get the IPN in paypal to work though. I use the IPN sample code at Paypals webpage that looks like:


<%@LANGUAGE="VBScript"%>
<%
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"

Response.Write("<br>")
Response.Write("str:" & str)
Response.Write("<br>")

' 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")


Response.Write("<br>")
Response.Write("objHttp.responseText:" & objHttp.responseText)
Response.Write("<br>")

' 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
else
' error
end if
set objHttp = nothing
%>

I know I have to modify the code after: elseif (objHttp.responseText = "VERIFIED") then. But I don't know how. I want the users that have paid to me be able to enter the protected area, while the ones that haven't be redirected to activate.asp. Can someone help me please?

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 09 March 2005 :  00:51:27  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
Look at the paypal pages more in depth. I've dealt with this before and paypal has some good references.

The IPN is unique to you and generated only when you activate it, and should only work with certain pages on your website, not all of them. I'm pretty sure you have to put a URL in there that it is to be used from.

-Stim
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 09 March 2005 :  16:19:19  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
One you get the hang of PayPal IPN it is pretty easy to work with. If you search these forums you should find some post's about it. If you are still having problems just send me a email by clicking on my name and I will see if I can give you quick guidence.

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.25 seconds. Powered By: Snitz Forums 2000 Version 3.4.07