Learn about PXP's PayPal components for iOS.
PayPal is one of the most widely used payment options in Europe, the US and many other parts of the world. PayPal is also widely adopted across industries, from retail to hospitality to gaming to many others. With the PayPal component for iOS, you can provide your customers with a secure and convenient checkout experience.
With the PayPal components, you can benefit from:
- Fast checkout: Retrieve stored shipping information from PayPal, so you can offer customers a "checkout with PayPal" experience.
- High customisability: Set the style and button text of the payment buttons, with the maximum level of customised branding allowed by PayPal.
- Flexible rendering: Each PayPal button is made available as a separate component, so you can place the buttons anywhere in your checkout flow — including separately from each other.
- Vaulting consent: Collect user consent to save PayPal account information for future transactions (requires backend token exchange implementation).
- Native iOS integration: Seamlessly integrated with SwiftUI for modern iOS app development, using the native PayPal iOS SDK.
- Secure web authentication: Secure payment processing using PayPal's web-based authentication flow with proper SSL/TLS handling.
The PayPal components will determine availability for Pay Later automatically and only render the button if available in the shopper's region.
The PayPal components support the following payment options:
- PayPal: A digital payment platform that allows users to make payments and transfer money online. It enables customers to pay using their PayPal balance, linked bank accounts, or cards.
- PayPal Pay later: A buy-now-pay-later service that allows customers to split their purchases into multiple payments over time. It offers both short-term (Pay in 4) and long-term financing options, with no interest on Pay in 4 if payments are made on time.
Venmo isn't currently supported on native Android or iOS. It's only available with our Web SDK.
You can configure the components to drive your desired flow:
- Pay now flow: A synchronous, single-step payment process where the customer completes the payment immediately during checkout and you receive the payment confirmation right away.
- Confirm payment flow: An asynchronous, two-step payment process where the customer authorises the payment and you choose whether to capture the funds later on. If these aren't captured within the time limit (29 days for PayPal), then the authorisation expires.
When you initiate a transaction, you have to provide key information in the transactionData object:
- The amount and currency.
- The entry type (
EntryType), which describes the origin of the transaction and determines the supported payment methods and available features. For PayPal, use.ecomfor e-commerce transactions. - The intent (
PayPalIntentType), which describes the purpose of a transaction, indicating the intended money flow direction. Each intent dictates a specific transaction flow and affects how the transaction is handled by the system. - A merchant transaction identifier of your choosing, which identifies this specific transaction.
- The merchant transaction date.
PayPal supports the following intents:
| Intent | Description | PayPal usage |
|---|---|---|
PayPalIntentType.purchase | Immediate payment capture. | Used for the pay now flow. It captures a payment in one step. |
PayPalIntentType.authorisation | Payment authorisation only. | Used for "Confirm payment" flow. It authorises a payment for later capture. |
PayPal for iOS uses a compositional approach with two main components that can be used independently or combined:
- Button component: The main PayPal payment button and flow, built using the native PayPal iOS SDK.
- Consent component: A consent checkbox for vaulting PayPal account information for future transactions.
The button component is required for PayPal payments. The consent component is optional and only needed if you want to collect user consent for vaulting PayPal accounts (backend implementation required for token exchange and future payments).
The core PayPal button component for initiating PayPal payments, built using the native PayPal iOS SDK.
Use this when:
- You need PayPal payment functionality in your iOS app.
- You want full control over button styling and behaviour.
- You're implementing custom payment flows.
- Multiple button styles (gold, blue, silver, white, black, dark blue).
- Support for PayPal and Pay Later funding sources.
- Customisable button size, edges, and content insets.
- Optional custom SwiftUI content to replace default PayPal button.
- Native PayPal iOS SDK integration with web-based authentication.
A checkbox component for obtaining user consent to save PayPal account information for future transactions.
Use this when:
- You want to collect consent for vaulting PayPal accounts for future transactions.
- You need to obtain explicit user consent before saving PayPal account information.
- You're implementing custom consent flows.
- Customisable checkbox with text label.
- Can be linked to the PayPal button component for automatic consent validation.
- Alternatively, use the
onGetConsentcallback for custom consent mechanisms. - Native SwiftUI implementation.