Hi I use vb.NET. My question is pertaining to ASP.NET.
I'm POSTing using the WebClient in .NET to PayPal servers. There is an issue where some characters are being encoded. Particularly the @ symbol within an email address. The PayPal staff are telling me that the eMail is being POSTed as "name%40domain.com". The @ has been swapped out for %40
I have changed the encoding of the WebClient in numerous ways but nothing has helped. The tech at PayPal says that the server might have something to do with this automatic encoding. I contacted my domain admin and they had no clue.
Is there anyways I can stop the encoding of this POST and send the @ symbol within the email without it being encoded?
A snippet of my code where I'm changing the encoding to UTF8 is shown below. I would really like to hear from those who know. PayPal tech doesn't seem to be able to go any further.
Am I even using the WebClient.encoding correctly? Because I have seen no change no matter what I change it to.
Dim collection As New NameValueCollection
collection.Add("EMAIL", "name@domain.com")
Dim wc As New WebClient()
wc.Encoding = System.Text.Encoding.UTF8
Dim response As Byte() = wc.UploadValues(cURL, "POST", collection)
wc.Dispose()
This is something that just started about three to four days ago without any coding on my end.
"PS. I should mention that I am using PayPal hosted payment forms Layout "C" and am receiving error:
• Some required information is missing or incorrect. Please correct the fields below and try again.
• Error: Please enter a valid email address."
The error appears when the Credit card is submitted.
When the WebClient POST as shown above, I receive "RESULT=0&RESPMSG=Approved"
You would think the eMail would be rejected on the initial POST but it is not. The error only shows when I click on SUBMIT ORDER to send the CC numbers in the iFrame.
Thanks,