Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to get user name, phone and email from PayPal Mobile Payment Library
    text
    copied!<p>I'm using the PayPal <a href="https://www.x.com/developers/paypal/how-to-guides/how-accept-payments-android-app-using-mpl">Mobile Payment Library</a> to make users pay for journeys from my android app.</p> <p>When the user clicks on Pay using Paypal button, the login screen shows up, when the user logs in, he is able to make the payment successfully. This is all works fine for my app. All what I need is get the user details after the user has completed/cancelled the payment in the onActivityResult code.</p> <p>Please see my code below, unfortunately it doesn't get me the details from the paypal account, so I'm wondering if there's another method to get user details from paypal after he logs in.</p> <pre><code>@Override public void onActivityResult(int requestCode, int resultCode, Intent data) { switch (requestCode) { case PAYPAL_REQUESTCODE: { Log.w("tag","jemail#"+ PayPal.getInstance().getAccountEmail()); Log.w("tag","jname#"+ PayPal.getInstance().getAccountName()); Log.w("tag","jphone#"+ PayPal.getInstance().getAccountPhone()); Log.w("tag","jdialcode#"+ PayPal.getInstance().getAccountCountryDialingCode()); switch(resultCode) { case Activity.RESULT_OK: { String payKey = data.getStringExtra(PayPalActivity.EXTRA_PAY_KEY); Log.d("tag", "PayPal payment succeeded"); Log.d("tag", "PayPal payKey: " + payKey); </code></pre> <p>What I do is that I login, then cancel the transaction Here is the Log that I get</p> <pre><code>04-30 12:30:19.672: W/tag(24697): jemail# 04-30 12:30:19.672: W/tag(24697): jname# 04-30 12:30:19.672: W/tag(24697): jphone#+44 04-30 12:30:19.672: W/tag(24697): jdialcode#44 </code></pre> <p>Then I click back in my app, then click next to go to the payment page again, and click on the pay with paypal button again, this time I would be already logged in, then I cancel transaction</p> <pre><code>04-30 12:30:43.878: W/tag(24697): jemail# 04-30 12:30:43.878: W/tag(24697): jname#H.O.P.E 04-30 12:30:43.878: W/tag(24697): jphone#+44 04-30 12:30:43.878: W/tag(24697): jdialcode#44 </code></pre>
 

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