Note that there are some explanatory texts on larger screens.

plurals
  1. POSet Express Checkout method returning an failure in the ack
    text
    copied!<p>I want to do the express checkout process in the paypal for the customers without redirecting the browser. I have written the code like</p> <pre><code> string sAPIUser = apiuser; string sAPIPassword = password; string sAPISignature = "signature"; string sAPIEndpoint = "https://api-3t.sandbox.paypal.com/nvp"; string sAppID = "APP-80W284485P519543T"; StringBuilder sRequest = new StringBuilder(); ASCIIEncoding encoding = new ASCIIEncoding(); string postData = ("&amp;METHOD=SetExpressCheckout"); postData += ("&amp;VERSION=63.0"); postData += ("&amp;PAYMENTREQUEST_0_AMT=10.00"); postData += ("&amp;PAYMENTREQUEST_0_CURRENCYCODE=USD"); postData += ("&amp;PAYMENTREQUEST_0_PAYMENTACTION=Sale"); postData += ("CANCELURL=http://www.google.com"); postData += ("RETURNURL=http://www.google.com"); byte[] data = encoding.GetBytes(postData); </code></pre> <p>// Prepare web request...</p> <pre><code> HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(sAPIEndpoint); myRequest.Method = "POST"; myRequest.Headers.Add("X-PAYPAL-SECURITY-USERID", sAPIUser); myRequest.Headers.Add("X-PAYPAL-SECURITY-PASSWORD", sAPIPassword); myRequest.Headers.Add("X-PAYPAL-SECURITY-SIGNATURE", sAPISignature); myRequest.Headers.Add("X-PAYPAL-SERVICE-VERSION", "1.3.0"); myRequest.Headers.Add("X-PAYPAL-REQUEST-DATA-FORMAT", "NV"); myRequest.Headers.Add("X-PAYPAL-RESPONSE-DATA-FORMAT", "NV"); myRequest.Headers.Add("X-PAYPAL-APPLICATION-ID", sAppID); myRequest.ContentType = "application/x-www-form-urlencoded"; myRequest.ContentLength = data.Length; // Send the request, read the response Stream newStream = myRequest.GetRequestStream(); newStream.Write(data, 0, data.Length); newStream.Close(); HttpWebResponse response = (HttpWebResponse)myRequest.GetResponse(); Stream responseStream = response.GetResponseStream(); Encoding encoding2 = Encoding.GetEncoding("utf-8"); StreamReader reader = new StreamReader(responseStream, encoding2); string theResponse = reader.ReadToEnd(); theResponse = HttpUtility.HtmlDecode(theResponse); </code></pre> <p>But i am getting the failure message in the <code>theResponse</code> variable. What error i am doing. The error is like</p> <pre><code> TIMESTAMP=2013%2d03%2d05T05%3a55%3a38Z&amp;CORRELATIONID=5c10035aca937&amp;ACK=Failure&amp;VERSION=63%2e0&amp;BUILD=5331358&amp;L_ERRORCODE0=10002&amp;L_SHORTMESSAGE0=Authentication%2fAuthorization%20Failed&amp;L_LONGMESSAGE0=You%20do%20not%20have%20permissions%20to%20make%20this%20API%20call&amp;L_SEVERITYCODE0=Error </code></pre> <p>How can i rectify this.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload