Accept credit cards and PayPal in your iOS app
Important: PayPal Mobile SDKs are Deprecated. The APIs powering them will remain operational long enough for merchants to migrate, but the SDKs themselves will no longer be updated. Please use Braintree Direct in supported countries. In other countries, use Express Checkout and choose the Braintree SDK integration option.
The PayPal iOS SDK makes it easy to add PayPal payments to mobile apps.
This documentation is available in Japanese: 日本語のドキュメント.
Note
There are 4 static libraries that you should link when building your application.
libPayPalMobile.a
,libCardIO.a
,libopencv_core.a', and
libopencv_imgproc.a` are required for all of the SDK functionality.The current version of the PayPal iOS SDK was built using Xcode 8.3.2.
The SDK supports two use cases for making payments - Single Payment and Future Payments - and a third use case for obtaining information about the customer - Profile Sharing.
Receive a one-time payment from a customer’s PayPal account. This can be either (1) an immediate payment which your servers should subsequently verify, or (2) an authorization for a payment which your servers must subsequently capture, or (3) a payment for an order which your servers must subsequently authorize and capture:
Note: Direct Credit Card (DCC) payments are now deprecated in this SDK. Please use Braintree Payments, a PayPal Company, which is the easiest way to accept PayPal, credit cards, and many other payment methods.
Your customer logs in to PayPal just one time and consents to future payments:
Later, when that customer initiates a payment:
Your customer logs in to PayPal and consents to PayPal sharing information with you:
platform :ios, '7.0'
pod 'PayPal-iOS-SDK'
PayPalMobile
directory (containing several .h files and libPayPalMobile.a) to your Xcode project. We recommend checking “Copy items…” and selecting “Create groups…”.TARGETS
section, not the PROJECTS
section):-lc++ -ObjC
to Other Linker Flags
Enable Modules (C and Objective-C)
Link Frameworks Automatically
Accelerate.framework
AudioToolbox.framework
AVFoundation.framework
CoreLocation.framework
CoreMedia.framework
MessageUI.framework
MobileCoreServices.framework
SystemConfiguration.framework
SafariServices.framework
LSApplicationQueriesSchemes
:com.paypal.ppclient.touch.v1
com.paypal.ppclient.touch.v2
org-appextension-feature-password-management
Your mobile integration requires different client_id
values for each environment: Live and Test (Sandbox).
Your server integrations for verifying or creating payments will also require the corresponding client_secret
for each client_id
.
You can obtain these PayPal API credentials by visiting the Applications page on the PayPal Developer site and logging in with your PayPal account.
Once logged in on this Applications page, you will be assigned test credentials, including Client ID, which will let you test your iOS integration against the PayPal Sandbox.
While testing your app, when logging in to PayPal in the SDK’s UI you should use a personal Sandbox account email and password. I.e., not your Sandbox business credentials.
You can create both business and personal Sandbox accounts on the Sandbox accounts page.
To obtain your live credentials, you will need to have a business account. If you don’t yet have a business account, there is a link at the bottom of that same Applications page that will get you started.
The SDK has built-in translations for many languages and locales. See the header files for a complete list.
The SDK supports multiple currencies. See the REST API country and currency documentation for a complete, up-to-date list.
If your app initiates a transaction with a currency that turns out to be unsupported for the user’s selected payment type, then the SDK will display an error to the user and write a message to the console log.
During development and testing, set the environment to Sandbox or NoNetwork/Mock mode, to avoid moving real money around. See the header files for more information.
When opening an issue, please include the environment (live or sandbox), SDK version, and a PayPal-Debug-ID
. The console log may have something like:
PayPal SDK: Request has failed with error: INTERNAL_SERVICE_ERROR - System error. Please try again later. (500) | PayPal Debug-ID: 463acd5lba23c [live, PayPal iOS SDK 2.14.1]
Additionally, information about the types of devices (iPhone 6s Plus, iPhone 5), iOS version, and any non-standard settings would be helpful to provide.
For merchant-specific issues, you should use the PayPal Merchant Technical Support site to open an issue.
Please do not post your client ID or secret in an issue.
User interface appearance and behavior is set within the library itself. For the sake of usability and user experience consistency, apps should not adjust appearance properties or attempt to modify the SDK’s behavior beyond the documented methods in the provided headers.
Specifically, if you are using UIAppearance
to modify the appearance of any UI elements in your app, you should reverse those changes prior to presenting our viewcontroller, and set them again after dismissing the viewcontroller.
Depending on your use case, you can now:
Please read our contributing guidelines prior to submitting a Pull Request.
Please refer to this repo’s license file.