Any one who tell me what’s wrong with this code. When I pass values to pay pal by using www.sandbox.paypal.com/cgi-bin/webscr all the code are working well.
The orders are generating accurately. The code after returning from paypal is as follows.
[code=asp]
<!--#include file="../includes/connection1.asp "-->
<!--#include file="Cart_Incl ude.asp"-->
<%
' read post from PayPal system and add 'cmd'
str ="cmd=_notif y-validate&"& Request.QuerySt ring
' post back to PayPal system to validate
set objHttp = Server.CreateOb ject("Msxml2.Se rverXMLHTTP")
'objHttp.open "POST", "https://www.sandbox.pay pal.com/cgi-bin/webscr", false
objHttp.open "POST", "https://www.paypal.com/cgi-bin/webscr", false
objHttp.setRequ estHeader "Content-type", "applicatio n/x-www-form-urlencoded"
objHTTP.setRequ estHeader "Content-Length", Len(str)
objHttp.Send str
if (objHttp.status <> 200 ) then
' HTTP error handling
Response.write "An Error Occured"
elseif (objHttp.respon seText = "VERIFIED") then
if request("Paymen t_Status") ="Completed" then
orderstatus=2
msg="error=Cong ratuation, Your Credits has been upgrated
successfully"
else
orderstatus=1
msg="error=Your Payment status is Pending, As Soon as it is verified we will send you a confirmation Email."
end if
set rs=server.creat eobject("adodb. recordset")
sql="select * from orders"
rs.open sql,conn,3,3
rs.addnew
rs("order_price ")=request("mc_ gross")
rs("contactname ")=request("fir st_name") & " "& request
("last_name" )
rs("address")=r equest("address _street")
rs("city")=requ est("address_ci ty")
rs("country")=r equest("address _country")
rs("zip")=reque st("address_zip ")
rs("order_quant ity")=request(" custom")
rs("order_statu s")=ordersta tus
rs("email")=req uest("payer_ema il")
rs("order_date" )=paymentdate
rs.update
set rs=nothing
Call InsetOrderDetai ls()
response.Redire ct("mesg.asp?" & msg)
else
response.Redire ct("mesg.asp?er ror=Error on receiving information, please contact to Admin")
end if
[/code]
But the problem become when i send data by using
www.paypal.com/cgi-bin/webscr. after receiveing data from paypal the else statement are execute such as
response.Redire ct("mesg.asp?er ror=Error on receiving information, please contact to Admin").
The orders are not generating by using www.paypal.com/cgi-bin/webscr.
Please Help Me.
Thank You
Mehtab Khan.
The orders are generating accurately. The code after returning from paypal is as follows.
[code=asp]
<!--#include file="../includes/connection1.asp "-->
<!--#include file="Cart_Incl ude.asp"-->
<%
' read post from PayPal system and add 'cmd'
str ="cmd=_notif y-validate&"& Request.QuerySt ring
' post back to PayPal system to validate
set objHttp = Server.CreateOb ject("Msxml2.Se rverXMLHTTP")
'objHttp.open "POST", "https://www.sandbox.pay pal.com/cgi-bin/webscr", false
objHttp.open "POST", "https://www.paypal.com/cgi-bin/webscr", false
objHttp.setRequ estHeader "Content-type", "applicatio n/x-www-form-urlencoded"
objHTTP.setRequ estHeader "Content-Length", Len(str)
objHttp.Send str
if (objHttp.status <> 200 ) then
' HTTP error handling
Response.write "An Error Occured"
elseif (objHttp.respon seText = "VERIFIED") then
if request("Paymen t_Status") ="Completed" then
orderstatus=2
msg="error=Cong ratuation, Your Credits has been upgrated
successfully"
else
orderstatus=1
msg="error=Your Payment status is Pending, As Soon as it is verified we will send you a confirmation Email."
end if
set rs=server.creat eobject("adodb. recordset")
sql="select * from orders"
rs.open sql,conn,3,3
rs.addnew
rs("order_price ")=request("mc_ gross")
rs("contactname ")=request("fir st_name") & " "& request
("last_name" )
rs("address")=r equest("address _street")
rs("city")=requ est("address_ci ty")
rs("country")=r equest("address _country")
rs("zip")=reque st("address_zip ")
rs("order_quant ity")=request(" custom")
rs("order_statu s")=ordersta tus
rs("email")=req uest("payer_ema il")
rs("order_date" )=paymentdate
rs.update
set rs=nothing
Call InsetOrderDetai ls()
response.Redire ct("mesg.asp?" & msg)
else
response.Redire ct("mesg.asp?er ror=Error on receiving information, please contact to Admin")
end if
[/code]
But the problem become when i send data by using
www.paypal.com/cgi-bin/webscr. after receiveing data from paypal the else statement are execute such as
response.Redire ct("mesg.asp?er ror=Error on receiving information, please contact to Admin").
The orders are not generating by using www.paypal.com/cgi-bin/webscr.
Please Help Me.
Thank You
Mehtab Khan.
Comment