|
Hi
There is an update. We have finally got the response from paypal and everything is working now.
i am attaching 3 files. a.html is the first request to obtain securetoken from paypal in order to submit the transaction.
that is happening in a correct manner (for security reason , i have removed the password from a.html).
but now when the response is coming from paypal side , a file gets downloaded in the browser whereas paypal should give the response either through querystring or hidden field or some other manner directly in our side rather than giving us this file which downloads in browser. this file is attached and named as "download (14)".
now because of this problem we are unable to send next request which requires values which are sent by paypal . but manually i have tried to post next request which is b.html and it is working fine and i have attached this file for reference as well.
Now another problem is paypal after processing the payment is returning us all values on successful page but is returned as shown in the error.jpg which is attached and is returning in form tag . So how should i read this response as this is not querystring. You can check this in the screnshot : error.jpg . as i am unable to read this , i am unable to process this further . These are 2 blocking issues now. ideally 1st blocking issue i have surpassed by using another dll of paypal but because of this second , i am unable to move further.
For future, please let me know how to read first response as well where file gets downloaded in browser though we are sending fields in hidden fields as in a.html.
NOTE :I am unable to add the attachments of 4 files as named above. How do i do that on this forum?
|
|
|
|
|
Are you using PayPal Pro?
If so, are you using the paired value version or the xml version?
We wrote our PayPal stuff years ago, and not many of our customers use their products and services, so I'm not familiar with PayPal PayFlow.
Basically their is the AIM version and the CIM version of services, CIM uses their pages to collect information, and with AIM, you have to write the whole thing.
I can help you, but your post is confusing me.
[EDIT]
Well after reading your post a couple of more times, and eating lunch, I suspect your using the CIM method, in which you created a webform with textboxes, that post to PayPal, and return the results back to your form.
It's been 10 years since I've used PayPal in that manner. I don't remember how it works exactly, so I going to pass on this subject. If your doing the latter, let me know.
modified 2-May-12 16:04pm.
|
|
|
|
|
No this is their new product. Payflow link or paypal advanced payments.
Ok i just want to know i am receiving reply from paypal on a specific page but in visual studio 2005 when i see that response while debugging , it is shown inside form. i am not sure what is form is ? when you will debug and when you will try to see the value of a variable it will open the response element and there is a option form there , it shows response there in the format
city=delhi&country=india. i thought this was querystring so was tring to read through request.querystring but then my variables didnt fill with the response though response is still there on the page. i think i dont know how to read response when it comes in form element in visual studio 2005.
Please help if you can.i can send you a screenshot image which i am seeing an option to upload here. if you can give me your email, i can do that or some other way if you still didnt understand what i am saying.
Thanks.
|
|
|
|
|
That's called a named / value pair, it's not a query string. Don't confuse what you transmit in a web request with what you type in the browser url window.
name = value
amount = value
and is separated by any char you choose. They just happen to choose a ampersand, so it looks like a query string. The separator char can be a | as well. JSON uses something similar as well. Other companies let you choose the sep character when transmitting the request, so we use the | char. PayPal wants to use the ampersand to make it more confusing.
[LESSON]
A web response is the pure essence, or purpose of response.write. response.write is not for returning a html tag like response.write("<>< >""), but is made to return a request like response.write("name=John Doe&amount=40.00¤cycode=USD") in which there is no html.
So when you transmit, you build your name/value string
strPostBuild = New StringBuilder
With strPostBuild
.Append("USER=" & API_UserName)
.Append("&PWD=" & API_Password)
.Append("&SIGNATURE=" & API_Signature)
.Append("&VERSION=" & API_Version)
.Append("&METHOD=" & API_Method)
.Append("&TRANACTIONID=" & API_TransactionID)
.Append("&AMT=" & API_Amount)
.Append("&TRANSACTIONENTITY=" & "ORDER")
.Append("&CURRENCYCODE=" & API_CurrencyCode)
End With
strPost = strPostBuild.ToString
Then you parse the response from PayPal
Dim values As String
values = TheGatewayResponse
Dim Capture As String() = Nothing
Capture = values.Split("&")
Dim ResponseCollection As NameValueCollection = New NameValueCollection
Dim ResponseName As String = Nothing
Dim ResponseValue As String = Nothing
Dim slashPosition As Integer = 0
For Each DataField In Capture
slashPosition = DataField.LastIndexOf("=")
ResponseName = Left(DataField, slashPosition)
ResponseValue = DataField.Substring(slashPosition + 1)
ResponseCollection.Add(ResponseName, ResponseValue)
Next
I can't tell you what the Form is for, you would have to paste response string only in order for me to interpret it.
[WARNING]
Oh, a warning to you. I mock PayPal for providing sample code for programmers, because they never end up learning how it really works. Entry level programmers will make a few tweaks to the code, get it to work, and think they are code god, but when it breaks, they can't fix it, and run back to the paypal forum for help, in which perhaps maybe 1 guy knows how it works.
You should write your own code from scratch, and build on it to make it better. Then when you write for UPS, Payment Tech, you will have a clue as to how it works.
|
|
|
|
|
Hi
We have changed the complete design of our website . Now this website is live and previously was using techniques like gzipping .
Now when we changed the design , i opened the url as the code was on QA server. all the design got messed up because previous css classes and html and images was changed and my system cached in previous running css. Then i refreshed it , and it was ok.
But now the question : Our production users wont be knowing this issue and might not refresh the page so it will come distorted to them as well.
So i want a code something like this which will have the logic :
when we go live with this code in production and users who will be coming after our upload , their local cache should be deleted and everything should be downloaded again from the server on their browser but this should happen only for their first visit after our code upload , further visits after the first one should use the local cache which will be our new design.
Please help regarding this asap. Our website is in ASP.NET 2005 and running on IIS 7 and windows 2008 R2.
|
|
|
|
|
To the best of my knowledge, you can't do that. .Net law will not allow html to alter the users computers.
I think there is a metatag in the page header that tells the browser that everything is new, might be the cache tag. Look into the header tags first.
|
|
|
|
|
Right now iis is installed on my workstation and visual studio.net 2010 professional. The two items are not setup to communicte with each other. Thus my goal is to have asp.net communicate with IIS.
I tried to run the command aspnet_regii.exe -1 in the C:\Windows\Microsoft.NET\Framework64\v2.0.50727 directory but obtained the message, "This utility has limited capabilites on the Windows Vista Operating system. It is recommended that you use the "turn on or off windows features" options of the programs component of the Control Panel to install or remove ASP.NET. It is also recommended that you use the IIS Maanger component or the Appcmd.exe tool to configure ASP.NEt application".
In addition, the most current version of my directory for the .net framework is the following:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319.
Thus can you tell me what you think would be the best way to have asp.net communicate with iis on my workstation?
|
|
|
|
|
Start here[^
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
I haven't seen this to be a problem since .Net 2.0. Are you sure you need to do this? What is the actual problem you are having that makes you think you need to do this?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
My goal is to use my workstation for the following:
1. To test enhancements that I make to a C# web form 2010 application using cassini as my web server.
2. I also want to deploy this web application to my workstation and run it under iis7.
Thus I want to use cassini as the web server to develop the code and deploy the application to my workstation and run it under iis as the web server. I want to keep these functions separate.
Thus can you tell me how to setup iis on my workstation as a separate server than I can use?
|
|
|
|
|
If you read through the information I have pointed to above you will be able to work it out.
In any case you can do both interchangeably if you want. You can debug under both Cassini and IIS quit easily.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
It will use cassini by default. Then you can also copy the code to another folder or do a deployment project and have IIS point to it. It is easy to do this so I guess I am confused as to what part specifically you are stuck on.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Here is what I am having trouble with:
1. according to the link:
http://msdn.microsoft.com/en-us/library/k6h9cz8h(VS.100).aspx, "if you install the .NET Framework 4 before you enable IIS, you must run the ASP.NET IIS Registration tool in order to register the .NET Framework with IIS and create application pools that use the .NET Framework 4."
This is a true statement for me.
I want to run the option 'aspnet_regiis i' in the following directory path: %windir%\Microsoft.NET\Framework64\v4.0.30319.
However the following applies:This option creates two application pools, ASP.NET v4.0 and ASP.NET v4.0 Classic. The DefaultAppPool application pool and the Classic .NET AppPool application pools are set to the .NET Framework 4 version of the CLR.
I already have the 'DefaultAppPool application pool and the Classic .NET AppPool application pools' created somehow. Should I delete what I have already and/or do these application pools somehowc onnect to cassini that I need to be aware of?
2. On the url linK http://msdn.microsoft.com/en-us/library/aa964620.aspx, I want to follow the directions in the following section: Installing IIS and ASP.NET on Windows Vista.
However these directions say to use the default web site. However on the production server at my small company, the default web site is removed and a new one is created. If I use a new website that I create,
will this hurt how the default cassini web server is used?
3. When I create a setup and deployment package of the code that I want to deploy on my workstation, what properties do I set so the deployment package knows how to locate the iis web server?
|
|
|
|
|
My goal is to make enhancements to a C# web form 2010 application and test the code with the default cassini web server that comes as a the default server to visual studio 2010 professional. I also want to deploy this web application to my workstation and run it under iis7 that is comptabile with iis6.
To be able to use cassini and iis7 on my workstation, I want to ask about the following configuration setings:
1. When the code is placed into production right now the network administrator removes the "Default web site", "DefaultAppPool","classic .NET AppPool". However I do not think I should remove these items so I can use the default cassini that comes with visual studio. Is this correct or not? Can you give me an explaination for your reason?
2. Since the production environment creates its own website and application pools, can you tell me if I should do the same thing? If so, can you tell me or point me to references on how to setup the web sites and application pools? If not, can you tell me how I can use the default settings that come with visual studio to use both cassini and iis to test with?
.
|
|
|
|
|
1. The app pools are used in IIS. You can remove any you want and then create any you want and put your site into any App pool you want.
2. Cassini is the built-in engine Visual Studio uses so you don't have to configure IIS.
IIS and Cassini are independent of each other.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
So you are saying that anything that I setup for iis will not affect cassini since they use totally different items so they can act as a web server?
|
|
|
|
|
That is my understanding. I have never seen them conflict.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hello,
I'm new with ASP.NET and I need to create dynamic buttons.
<script runat="server">
Sub submit(Source As Object, e As EventArgs)
button2.Visible = True
lbl1.Visible = True
button3.Visible = True
End Sub
</script>
<script runat="server">
Sub submit1(Source As Object, e As EventArgs)
lbl1.Text += 1
End Sub
</script>
<script runat="server">
Sub submit2(Source As Object, e As EventArgs)
button2.Visible = False
lbl1.Visible = False
button3.Visible = False
End Sub
</script>
<html>
<body style="height: 184px">
<form id="Form1" runat="server">
<asp:Button id="button1" Text="ADD" runat="server" OnClick="submit" />
<p>
<asp:Button id="button2" Text="COUNT" runat="server" visible="false" OnClick="submit1" />
</p>
<p>
<asp:Label id="lbl1" Text=0 runat="server" Visible=false />
<asp:Button id="button3" Text="REMOVE" runat="server" visible="false" OnClick="submit2" />
</p>
</form>
</body>
</html>
I made this code but it's not really a dynamic, because it uses visible true/false commands.
Can any one help me to make them dynamic.
Thank you.
|
|
|
|
|
|
The term dynamic button means that instead of using an object in the webform, you create the object in code, in the code behind page.
in vb
Dim txt_FirstName_Field As Textbox
txt_FirstName_Field = new TextBox
With txt_FirstName_Field
.ID = "txtFirstName"
.Text = "SomeValue"
End With
controls.Add( txt_FirstName_Field );
I don't remember the last line for code behind pages
|
|
|
|
|
i am creating an application, in which i am providing user to download a file only if he is login. if he is logined in then he will be redirect to login page first once login again he will be back to that download page. this is done. but the problem is when i directly going to login page then it doesn't work it goes to null reference please help me to solve this problem. tnx in advance
|
|
|
|
|
How are you sending the user back to the original page after he logs in. perhaps you are setting some page url in session or query string.
If yes then, perhaps when user lands on login page directly this value is null . SO you need to check if this value is null and perhaps push the user to the home page.
|
|
|
|
|
i am storing page url in a session as it was previously visited and then send to that page, when it is reffer from that download page it works perfectly but when it is going directly to the login page it gives error of null ref to that session
|
|
|
|
|
Session["url1"] = url;
string s = Request.QueryString["page"].ToString();
if (Request.QueryString["page"].ToString() == null)
{
Session["s"] = Convert.ToString(0);
}
else
{
Session["s"] = Convert.ToString(1);
}
}
if (b == true && Session["s"] == Convert.ToString(1))
{
Session["logintrue"] = "logintrue";
Session["member_name1"] = member_nm;
Session["member_email1"] = member_eml;
Session["member_id1"] = member_id;
string s = Request.QueryString["page"].ToString();
Response.Redirect(s);
}
else if (b == true && Session["s"] == Convert.ToString(0))
{
Session["logintrue"] = "logintrue";
Request.QueryString["page"].ToString();
Response.Redirect("~/member.aspx");
}
else
{
lbl_error.Text = "Invalid email or password";
}
condition is somthing like this... it lands to link stored in "s" which is the download page link, but it doesn't work when user directly lands to login.aspx
|
|
|
|
|
You have to capture the previous url, and write it to a temp location before on or before Page.Load. You may want to consider url encoding the url before storage, and url decoding before sending them back to where they came from.
Make sure you capture the complete url including querystrings.
So write the capture, and make a textbox to store it in, then check the value. Then write the redirect, and the url in the browser url bar for accuracy.
|
|
|
|