Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>After reading this post here <a href="https://stackoverflow.com/questions/8789129/transaction-details-from-paypal-using-pay-key-in-android">Transaction details from paypal using Pay-key in android</a></p> <p>I am able to come up with my solution. But I will have to create ASYNC class to make it work.</p> <p>So it is something like this</p> <pre><code>public class MyPaypalActivity extends Activity implements OnClickListener { String resultExtra; //some methods you can fill in yourself to integrate with paypal @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); switch(resultCode) { case Activity.RESULT_OK: String payKey = data.getStringExtra(PayPalActivity.EXTRA_PAY_KEY); data.getStringExtra(PayPalActivity.EXTRA_PAY_KEY); resultExtra = data.getStringExtra(PayPalActivity.EXTRA_PAY_KEY); new RetreivePaypalData().execute(resultExtra); break; case Activity.RESULT_CANCELED: break; case PayPalActivity.RESULT_FAILURE: Toast.makeText(this,"Paymnet Failed",Toast.LENGTH_LONG).show(); String errorID = data.getStringExtra(PayPalActivity.EXTRA_ERROR_ID); String errorMessage = data.getStringExtra(PayPalActivity.EXTRA_ERROR_MESSAGE); break; } } class RetreivePaypalData extends AsyncTask&lt;String, Void, String&gt; { private Exception exception; protected String doInBackground(String... args) { try{ HttpPost httppost = null; httppost = new HttpPost("https://svcs.sandbox.paypal.com/AdaptivePayments/PaymentDetails"); httppost.setHeader("X-PAYPAL-SECURITY-USERID", "mybusiness_blalbal.fff.cm"); httppost.setHeader("X-PAYPAL-SECURITY-PASSWORD", "3243535554"); httppost.setHeader("X-PAYPAL-SECURITY-SIGNATURE", "AR908E09RG7H0G0GREJ3GH9GHGHDFKGHGIHE99GFDIGHIH34ERGHI"); httppost.setHeader("X-PAYPAL-APPLICATION-ID", "APP-80W284485P519543T"); httppost.setHeader("X-PAYPAL-REQUEST-DATA-FORMAT", "NV"); httppost.setHeader("X-PAYPAL-RESPONSE-DATA-FORMAT", "NV"); // Add your data List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(); nameValuePairs.add(new BasicNameValuePair("payKey", resultExtra)); nameValuePairs.add(new BasicNameValuePair("requestEnvelope.errorLanguage", "en_US")); httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); HttpResponse response = Client.getInstance().execute(httppost); HttpEntity entity = response.getEntity(); InputStream is = entity.getContent(); byte[] data1; data1 = new byte[256]; StringBuffer buffer = new StringBuffer(); int len = 0; while (-1 != (len = is.read(data1)) ) { buffer.append(new String(data1, 0, len)); } Log.e("log_tag",""+buffer.toString()); //Make the comparison case-insensitive. is.close(); }catch(Exception e) { Log.e("Got Error","error "+ e ); } Log.e("Paykey","resultExtra "+ resultExtra ); return null; } protected void onPostExecute(String d) { // TODO: check this.exception // TODO: do something with the data } } } </code></pre> <p>Just a rough solution. Need to tweak.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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