473,499 Members | 1,591 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting Error On PayPal

1 New Member
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.
Expand|Select|Wrap|Line Numbers
  1. <!--#include file="../includes/connection1.asp"-->
  2. <!--#include file="Cart_Include.asp"-->
  3. <%
  4. ' read post from PayPal system and add 'cmd'
  5. str ="cmd=_notify-validate&"& Request.QueryString 
  6. ' post back to PayPal system to validate
  7. set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
  8. 'objHttp.open "POST", "https://www.sandbox.paypal.com/cgi-bin/webscr", false
  9. objHttp.open "POST", "https://www.paypal.com/cgi-bin/webscr", false
  10. objHttp.setRequestHeader "Content-type", "application/x-www-form-urlencoded"
  11. objHTTP.setRequestHeader "Content-Length", Len(str)
  12. objHttp.Send str
  13.     if (objHttp.status <> 200 ) then
  14.        ' HTTP error handling
  15.        Response.write "An Error Occured"
  16.     elseif (objHttp.responseText = "VERIFIED") then
  17.       if request("Payment_Status") ="Completed" then
  18.        orderstatus=2
  19.        msg="error=Congratuation, Your Credits has been upgrated 
  20.                    successfully"
  21.       else
  22.        orderstatus=1
  23.        msg="error=Your Payment status is Pending, As Soon as it                 is verified we will send you a confirmation Email."
  24.     end if
  25.      set rs=server.createobject("adodb.recordset")
  26.      sql="select * from orders"
  27.      rs.open sql,conn,3,3
  28.      rs.addnew
  29.      rs("order_price")=request("mc_gross")
  30.      rs("contactname")=request("first_name") & " "& request
  31.                  ("last_name")
  32.      rs("address")=request("address_street")
  33.      rs("city")=request("address_city")
  34.      rs("country")=request("address_country")
  35.      rs("zip")=request("address_zip")
  36.      rs("order_quantity")=request("custom")
  37.      rs("order_status")=orderstatus
  38.      rs("email")=request("payer_email")
  39.      rs("order_date")=paymentdate
  40.      rs.update
  41.      set rs=nothing
  42.                  Call InsetOrderDetails()
  43.      response.Redirect("mesg.asp?"& msg)
  44.                else
  45.                  response.Redirect("mesg.asp?error=Error on receiving information, please contact to Admin")
  46.                end if
  47.  
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.Redirect("mesg.asp?error=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.
Mar 31 '08 #1
1 2402
jhardman
3,406 Recognized Expert Specialist
I usually check for error using the method
Expand|Select|Wrap|Line Numbers
  1. on error resume next
  2. ...
  3. if err.number <> 0 then %>
  4.    An error occurred. <br> Please notify <a
  5.    href="mailto:me@address.com">webmaster</a> if error continues.
  6.    error# <%=err.number%>: <%=err.description%> 
  7.    <% err.clear
  8. else 
  9.    'do your magic here
  10. end if %>
Try this method, let me know if it gives you a different output.

Jared
Apr 7 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
2687
by: Chefry | last post by:
I'm trying to set up an off the shelf script and keep getting an error. My host set up the mysql on my site and I changed the variables I had to in the settings.php file but I keep getting the...
3
2793
by: Stephane | last post by:
Hi, I'm trying to use PayPal and its Instant Payment Notification. In short, when a payment is made, PayPal send a post to my server and I post it back to PayPal. I'm using WebRequest to do...
2
4165
by: Tommy | last post by:
I have written some code to use paypal for users to make purchases from my site. I am using the paypal instant payment notification. When i get the notification from paypal I send the user an...
7
2556
by: Alan Silver | last post by:
Hello, I've just been looking at the free PayPal component from ComponentOne and am somewhat amazed how insecure it is. They include all the transaction details in plain text in the querystring,...
0
3834
by: PayPal Security Measures! | last post by:
<P><A href="http://www.paypal.com/cgi-bin/webscr?cmd=_home" target=_blank><IMG src="https://www.paypal.com/en_US/i/logo/paypal_logo.gif" border=0></A</P> <TABLE cellSpacing=0 cellPadding=0...
4
5147
by: lalith369100 | last post by:
Iam almost completed my project Now iam integrating paypal pro But While running sample programs it was showing error Message like this Error Number: 56 Error Message: Received error code 404...
0
1680
by: micahel | last post by:
Please chat with me by cnbbiz2008@hotmail.com to get the price and more photos, we take supplier paypal as payment. please see the photo album below for our product list. trainers supplier...
0
1740
by: Nicodemus | last post by:
Do You Belive? \ cheapbbc@sina.com wrote in news:aecf26b6-4c75-4d87-b09c-a7380875e0f3 @w34g2000prm.googlegroups.com:
0
1715
by: micahel | last post by:
Please chat with me by cnbbiz2008@hotmail.com to get the price and more photos, we take supplier paypal as payment. please see the photo album below for our product list. trainers supplier...
0
7130
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7007
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7220
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6893
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5468
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3098
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3090
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
664
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.