Mobile Payment Libraries Getting Started Guide
Important: Adaptive Payments is now a limited release product. It is restricted to select partners for approved use cases and should not be used for new integrations without guidance from PayPal.
Get up and running with this service:
The PayPal Mobile Payment Libraries (MPL) provides a secure, extensible, and scalable way to add PayPal functionality to your native mobile apps. Using MPL, you place a Pay with PayPal button in your app's payment flow, which lets customers use their PayPal accounts for payment transactions. MPL completely integrates the payment flow into your app, and customers complete their checkouts without needing to open a webview to process the payment.
PayPal provides MPL in native iOS and Android SDKs. Integration is easy; download the MPL SDK from the download link mentioned below and include the library files in your mobile app. From there, you need to add only a few lines of code to fully integrate a PayPal pay flow into your mobile app.
Note: For instructions on getting started with the PayPal NVP/SOAP APIs, how to use the Sandbox for testing, and how to move your app into production, see Apps 101.
When you call the MPL library from your app, it displays an Pay with PayPal button. The onClick event launches a PayPal login screen, where your customer logs in to their existing PayPal account. Because PayPal stores the account billing, shipping, and funding information, users don't have to re-enter this information to purchase items through your app.
When a buyer enters an MPL transaction flow, the library controls the buyer's entire checkout experience from your app. Once the customer completes the payment using their PayPal account, they are returned to your mobile app.
Because the Mobile Payment Libraries are build on PayPal's Adaptive Payments, you can accomplish many of the operations provided by that API with the MPL. For example, you can create mobile apps that provide for pre-approved and chained payments.
The figure below outlines the basic call flow:
MPL call sequence
While the above figure shows Android-specific calls, the call flow is the same no matter which environment your app supports (Android or iOS). In this call flow:
- Your application initializes the library.
- The library generates a Pay with PayPal button and returns the button code that you to add to your app.
- Your application sets all of the payment parameters, including the amount, currency, recipient, and any other pertinent details.
- When the customer clicks Pay with PayPal, the library initiates the PayPal checkout experience. The library displays a window on top of the app's Window object.
- After the customer completes the payment, the library returns a callback to your application with the transaction ID and status of the payment. Here, the library is still in control of the UI and has not returned control to your application.
- After the library flow is complete, the library returns a callback to your application indicating it is relinquishing control of the UI.
Make your first call
To begin integrating MPL into your app, download the appropriate SDK for your platform (Android or iOS), include the library components in your app, and code the MPL calls using the native language of your platform. The guides listed below detail how to make calls for each of the supported platforms:
Learn more about the Mobile Payment Libraries, and other PayPal Mobile solutions, from the following resources: