Last updated: October 14, 2026
Complete these core setup steps one time, then integrate the payment methods you need.
You'll need the following before integrating the SDK:
The SDK ships as per-feature products. Add only what you use. Add FraudProtection, which provides device data used to reduce declines, plus the product for each payment method you integrate. With CocoaPods:
# Podfile
pod 'PayPal/CorePayments'
pod 'PayPal/FraudProtection' # device data (risk signals)
# Add the product(s) for the method(s) you integrate:
pod 'PayPal/PayPalPayments' # PayPal Checkout + Vault
pod 'PayPal/PaymentButtons' # PayPal buttons
# pod 'PayPal/CardPayments' # Card (ACDC)Or add the paypal-ios Swift Package and include the matching products.
You build every client (PayPalClient, CardClient) from a single CoreConfig. No network calls occur at initialization.
Replace <YOUR_CLIENT_ID> and <YOUR_MERCHANT_ID> with your actual values:
let config = CoreConfig(
clientID: "<YOUR_CLIENT_ID>",
environment: .sandbox, // .live for production
merchantID: "<YOUR_MERCHANT_ID>", // Required, encrypted merchant account ID
bnCode: nil // Partner integrations only
)Reuse this config across every method client. Switch .sandbox to .live for production.
PayPal checkout sends the buyer to the PayPal app, or an in-app browser, and back to your app through a Universal Link. In App Target › Signing & Capabilities › Associated Domains, add applinks:example.com and serve your AASA file at https://example.com/.well-known/apple-app-site-association. One domain covers both your return and cancel URLs.
Register the custom-scheme fallback under CFBundleURLTypes, and declare the PayPal app scheme under LSApplicationQueriesSchemes so the SDK can detect it. fallbackSchemeURL is optional on PayPalURLConfig, but set it regardless. Without it, a buyer whose Universal Link fails to open your app has no way back to checkout:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array><string>merchantapp</string></array>
</dict>
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>paypal</string>
</array>Define the matching URL config one time to pass to each method's session or checkout call:
let urlConfig = PayPalURLConfig(
returnAppURL: URL(string: "https://example.com/merchant-app/return")!,
cancelAppURL: URL(string: "https://example.com/merchant-app/cancel")!,
fallbackSchemeURL: URL(string: "merchantapp://return") // Optional; see note above
)Card (ACDC) does not require Associated Domains or custom-scheme registration.
Integrate a payment method: