Skip to content

Repository files navigation

PayPalSDK — Spreedly client experiment (Velotio in-house)

Internal experiment only. This repository lives under the Velotio GitHub org (velotio-tech) and exists solely as an engineering tryout for Spreedly client work. It is not an official PayPal product, not an official Spreedly SDK release, and not intended for production merchant use.

Why this exists

Spreedly’s iOS checkout work needs both Braintree and PayPal in the same application. Official SPM packages collide:

multiple packages ('braintree_ios', 'paypal-ios') declare targets with a conflicting name: 'PPRiskMagnes'

This repo tests a workaround: rebuild the PayPal iOS SDK as separate XCFrameworks, then distribute them from a single Swift package that does not declare the conflicting PPRiskMagnes target — so PayPal binaries can resolve alongside braintree_ios.

Audience

Who Use
Velotio / Spreedly iOS engineers Spike, validate SPM resolve + dual-SDK apps
Spreedly product / tech lead Review feasibility before any production approach
External merchants Do not use

Products

SPM product XCFramework
CorePayments XCFrameworks/CorePayments.xcframework
PaymentButtons XCFrameworks/PaymentButtons.xcframework
PayPalWebPayments XCFrameworks/PayPalWebPayments.xcframework
CardPayments XCFrameworks/CardPayments.xcframework
(built, not in Package.swift) FraudProtection.xcframework, PPRiskMagnes.xcframework

FraudProtection / PPRiskMagnes are produced by the build script and committed under XCFrameworks/, but not declared in Package.swift — declaring PPRiskMagnes would recreate the SPM name clash with Braintree.

Add via SPM (experiment apps only)

dependencies: [
    .package(url: "https://github.com/velotio-tech/PayPalSDK.git", branch: "main")
],
targets: [
    .target(
        name: "MyApp",
        dependencies: [
            .product(name: "CorePayments", package: "PayPalSDK"),
            .product(name: "PaymentButtons", package: "PayPalSDK"),
            .product(name: "PayPalWebPayments", package: "PayPalSDK"),
        ]
    )
]

In Xcode: File → Add Package Dependencies…git@github.com:velotio-tech/PayPalSDK.git

Add via CocoaPods (experiment apps only)

PayPalSDK.podspec vendors the same XCFrameworks. Default subspecs match SPM (no Magnes).

platform :ios, '16.0'
use_frameworks!

target 'MyApp' do
  pod 'Braintree', '~> 7.0'
  pod 'PayPalSDK', :git => 'https://github.com/velotio-tech/PayPalSDK.git', :branch => 'main'
  # Or pin a tag: :tag => '2.0.1'
  # Optional Magnes (avoid with Braintree): pod 'PayPalSDK/FraudProtection', ...
end

Subspecs: CorePayments, PaymentButtons, PayPalWebPayments, CardPayments, optional FraudProtection.

Proof demo: DemoCocoaPods/pod install then build the workspace (Braintree + PayPalSDK).

cd DemoCocoaPods && pod install
xcodebuild build -workspace DemoCocoaPods.xcworkspace -scheme DemoCocoaPods \
  -destination 'generic/platform=iOS Simulator' CODE_SIGNING_ALLOWED=NO

Magnes / Braintree note

Official paypal-ios and braintree_ios both declare SPM binary target PPRiskMagnes, so they cannot resolve together.

This package avoids that by not declaring PPRiskMagnes / FraudProtection in Package.swift. You can resolve this package alongside Braintree and use:

  • CorePayments
  • PaymentButtons
  • PayPalWebPayments
  • CardPayments

The Magnes XCFrameworks remain in XCFrameworks/ for manual experiments only.

Rebuild XCFrameworks

# One-time: vendor source
git clone --depth 1 https://github.com/paypal/paypal-ios.git vendor/paypal-ios

./scripts/build-xcframeworks.sh

Requires Xcode with iOS + Simulator SDKs.

Layout

Package.swift              # SPM
PayPalSDK.podspec          # CocoaPods
XCFrameworks/              # committed binaries (SPM + CocoaPods)
DemoDualSDK/               # SPM + Braintree proof
DemoCocoaPods/             # CocoaPods + Braintree proof
scripts/build-xcframeworks.sh
vendor/paypal-ios/         # gitignored build input
build/ logs/               # gitignored

Source version

See VERSION.md.

Disclaimer

PayPal SDK sources and binaries remain subject to PayPal’s upstream license. This repo only repackages them for an internal Spreedly feasibility experiment hosted in Velotio’s org. Do not publish, redistribute outside the engagement, or treat as a supported Spreedly distribution channel without explicit approval.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages