您好我想在我的Android应用程序中添加多个paypal帐户,用户必须在付款时从已保存的帐户中进行选择。为此我使用paypal的Future支付选项
@Override
protected void onActivityResult (int requestCode, int resultCode, Intent data) {
if (resultCode == Activity.RESULT_OK) {
PayPalAuthorization auth = data
.getParcelableExtra(PayPalFuturePaymentActivity.EXTRA_RESULT_AUTHORIZATION);
if (auth != null) {
try {
String authorization_code = auth.getAuthorizationCode();
sendAuthorizationToServer(auth);
} catch (JSONException e) {
Log.e("FuturePaymentExample", "an extremely unlikely failure occurred: ", e);
}
}
} else if (resultCode == Activity.RESULT_CANCELED) {
Log.i("FuturePaymentExample", "The user canceled.");
} else if (resultCode == PayPalFuturePaymentActivity.RESULT_EXTRAS_INVALID) {
Log.i("FuturePaymentExample",
"Probably the attempt to previously start the PayPalService had an invalid PayPalConfiguration. Please see the docs.");
}
}
通过这种方式我获得了身份验证代码,但我还需要一些帐户参考,以便为用户提供帐户选择选项。如何使用auth代码获取电子邮件参考,还是应该采取其他方法? 谢谢!