I am using paypal
SDK in my project,I am able to make payment from my app,but i am not able to get access token
after payment,
This my onAc
This one worked for me, The issue was with Network connection security,so i changed my wifi, and it works perfectly fine
That was the reason i was getting this error
NoConnectionError: javax.net.ssl.SSLHandshakeException: Connection closed by peer
CODE
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("https://api.sandbox.paypal.com/v1/oauth2/token");
try {
String text="CLIENT ID"+":"+"SECRET ID";
byte[] data = text.getBytes("UTF-8");
String base64 = Base64.encodeToString(data, Base64.NO_WRAP);
httppost.addHeader("content-type", "application/x-www-form-urlencoded");
httppost.addHeader("Authorization", "Basic " + base64);
StringEntity se=new StringEntity("grant_type=client_credentials");
httppost.setEntity(se);
// Execute HTTP Post Request
HttpResponse response = httpclient.execute(httppost);
String responseContent = EntityUtils.toString(response.getEntity());
Log.d("Response", responseContent );
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
} catch (IOException e) {
// TODO Auto-generated catch block
}