Express CheckOut Payment Error
rijsat
New Community Member
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
Dec-21-2017
08:40 PM
MY expression checkout works in local environment but getting error in production.
Error: You must provide a request body if you set ContentLength>0 or SendChunked==true. Do this by calling [Begin]GetRequestStream before [Begin]GetResponse.
Here My Code:
Public Function HttpCall(ByVal NvpRequest As String) As String 'CallNvpServer Dim url As String = pendpointurl 'To Add the credentials from the profile Dim codec As New NVPCodec() Dim strPost As String = (NvpRequest & "&") + buildCredentialsNVPString() strPost = (strPost & "&BUTTONSOURCE=") + HttpUtility.UrlEncode(BNCode) 'satya ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 ' Dim objRequest As HttpWebRequest = DirectCast(WebRequest.Create(url), HttpWebRequest) objRequest.AllowWriteStreamBuffering = False objRequest.Timeout = Timeout objRequest.Method = "POST" objRequest.ContentLength = strPost.Length Try Using myWriter As New StreamWriter(objRequest.GetRequestStream()) myWriter.Write(strPost) End Using Catch e As Exception ' ' if (log.IsFatalEnabled) ' { ' log.Fatal(e.Message, this); ' } End Try 'Retrieve the Response returned from the NVP API call to PayPal Dim objResponse As HttpWebResponse = DirectCast(objRequest.GetResponse(), HttpWebResponse) Dim result As String Using sr As New StreamReader(objResponse.GetResponseStream()) result = sr.ReadToEnd() End Using 'Logging the response of the transaction ' if (log.IsInfoEnabled) ' { ' log.Info("Result :" + ' " Elapsed Time : " + (DateTime.Now - startDate).Milliseconds + " ms" + ' result); ' } ' Return result End Function
0 REPLIES 0

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
Related Content
- Pay after delivery in About Payments
- Questionable resellers citing paypal as a payment option in About Protections
- Missing products from transaction, order's products not tally with ecommerce website and paypal in About Payments
- shopify in Selling on your website
- PayPal Sandbox testing authorisation without logging in in About Payments