How paypal/paypal-ios works
Project type and purpose
• This is an open-source PayPal iOS SDK, written in Swift, designed to be consumed by iOS apps via CocoaPods or SwiftPM.
• It provides modular libraries for card payments, PayPal web checkout, vaulting, payment buttons, fraud protection (Magnes), and core networking/analytics.
File structure
• Top-level “Sources” directory contains five independently versioned modules:
– CorePayments: networking clients, HTTP/GraphQL wrappers, analytics
– CardPayments: card-specific API clients, models, error handling
– PayPalWebPayments: web checkout client, request/response models
– FraudProtection: Magnes SDK integration & device data collector
– PaymentButtons: UI components (UIKit/SwiftUI) for PayPal/Venmo buttons
• “Demo” and “SampleApps” show consumer iOS apps that import the SDK modules, providing view models, SwiftUI/UIKit views, and example flows.
• “Frameworks/XCFrameworks” holds third-party risk/Magnes framework.
• CI/CD manifests in .github/workflows (build, tests, lint, release).
• UnitTests folder mirrors each module with XCTest coverage.
README for additional insights
• Confirms multi-package structure, iOS 14+ target, Swift 5.9+, supports UIKit & SwiftUI.
• Highlights authentication via client ID, external PayPal REST/GraphQL services, and analytics pipeline.