9. Log In with PayPal
Client Server
1. Open Authorization 2. Provide a login page
Endpoint URL 3. Return the Authorization
4. Check callbacks for Token after a successful
Authorization Token login
5. Request a valid Access 6. Check Authorization Token
Token & return the Access Token
7. Retrieve user’s resources if it’s valid
10. Log In with PayPal
NAME Date of Birth
Creation Date
EMAIL Language
Gender Locale
Time Zone
Phone Number Address
Verified
28. Mobile Payments Library
Adding the PayPal Activity:
<activity
android:name="com.paypal.android.MEP.PayPalActivity"
android:configChanges="keyboardHidden|orientation" />
Best to be used with a translucent Theme
android:theme="@android:style/Theme.Translucent.NoTitleBar"
29. Mobile Payments Library
DECLARING THE NEEDED PERMISSIONS:
Internet
<uses-permission
android:name="android.permission.INTERNET" />
READ Phone state
<uses-permission
android:name="android.permission.READ_PHONE_STATE" />
Access Wifi State
<uses-permission
android:name="android.permission.ACCESS_WIFI_STATE" />
36. Mobile Payments Library
GET THE INTENT:
Intent payIntent =
instance.checkout(invoice, context);
startActivityForResult(payIntent, REQUEST);
Can be used with a Delegate instead
Intent payIntent =
instance.checkout(
invoice, context, delegate
);
startActivity(payIntent);
37. Mobile Payments Library
Receive the result:
protected void onActivityResult(
int requestCode, int resultCode, Intent data) {
if (requestCode == REQUEST) {
switch (resultCode) {
case Activity.RESULT_OK:
showText("Success");
break;
case Activity.RESULT_CANCELED:
showText("Canceled");
break;
case PayPalActivity.RESULT_FAILURE:
showText("Failure");
break;
}
}
}