Prerequisites

Following is a list of requirements that are needed in order for PayPal Checkout to function correctly.

RequirementSecure Web BrowserNative ExperienceNotes
URI Scheme
App LinkShould be registered as a valid Return URL in the PayPal Developer Portal
Merchant ID

Learn more about App Links.

Setting up for the SDK

If not already done, the Android application need to specify that it accepts internet permissions. If you would also like to add haptic feedback to the wallet for selection notices, please also include the vibration permission at the top of the AndroidManifest.xml of in the application

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="checkout.paypal.com.myapplication">
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.VIBRATE"/>

For PayPal to authenticate and be remembered in app, we rely on OpenID's AppAuth implimentation. Please add this activity to the AndroidManifest.xml to ensure the switch back to the app will take place using App Links, the url listed below, should match the generated App Links url.

Learn more about App Links. Remember an App Link needs to be registered in the PayPal Developer Portal as a Return URL.

<activity android:name="net.openid.appauth.RedirectUriReceiverActivity">
    <intent-filter android:autoVerify="true">
        <action android:name="android.intent.action.VIEW" />

        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />

        <data
            android:scheme="https"
            android:host="example.com"
            android:path="/buyingstuff"/>
    </intent-filter>
</activity>

Incase the native experience can not be loaded for a particular user, PayPal will ensure that conversion happens, by falling back to a Chrome Custom Tabs (or default browser). To ensure that the user makes it back to the app from the PayPal web experience, a custom scheme is employed. Please register an activity with a custom scheme you chose for the app. The host should stay paypalxo.

<activity android:name="com.paypal.pyplcheckout.PYPLCheckoutReceiver">
    <intent-filter android:autoVerify="true">
        <action android:name="android.intent.action.VIEW" />

        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />

        <data
            android:scheme="mystore"
            android:host="paypalxo" />
    </intent-filter>
</activity>

The completed AndroidManifest.xml should resemble the following.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="checkout.paypal.com.myapplication">
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.VIBRATE"/>

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name="net.openid.appauth.RedirectUriReceiverActivity">
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data
                    android:scheme="https"
                    android:host="example.com"
                    android:path="/buyingstuff"/>
            </intent-filter>
        </activity>

        <activity android:name="com.paypal.pyplcheckout.PYPLCheckoutReceiver">
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data
                    android:scheme="mystore"
                    android:host="paypalxo" />
            </intent-filter>
        </activity>
    </application>
</manifest>