Sample integration project for Cashfree Payment Gateway's iOS SDK, facilitating seamless and secure payment processing within your iOS application.
The easiest way to integrate Cashfree iOS SDK is through Swift Package Manager:
- Open your project in Xcode
- Go to File > Add Package Dependencies
- Enter the repository URL:
https://github.com/cashfree/core-ios-sdk.git
- Select the version rule (recommend "Up to Next Major Version")
- Choose the products you need:
CashfreePG
- Complete Payment Gateway SDK (recommended)CashfreePGCoreSDK
- Core payment processingCashfreePGUISDK
- UI componentsCashfreeAnalyticsSDK
- Analytics and trackingCFNetworkSDK
- Networking layer
Add the following to your Package.swift
file:
dependencies: [
.package(url: "https://github.com/cashfree/core-ios-sdk.git", from: "2.2.4")
]
Then add to your target dependencies:
.target(
name: "YourApp",
dependencies: [
.product(name: "CashfreePG", package: "core-ios-sdk")
]
)
Add the following to your Podfile
:
pod 'CashfreePG', '~> 2.2.4'
Then run:
pod install
The Cashfree iOS SDK is built with a modular architecture:
CashfreePG (Main SDK)
├── CashfreePGUISDK (UI Components)
│ └── CashfreePGCoreSDK (Core Payment Logic)
│ └── CashfreeAnalyticsSDK (Analytics & Tracking)
│ └── CFNetworkSDK (Networking Layer)
The Cashfree iOS SDK allows you to integrate Cashfree Payment Gateway into your application and start collecting payments from your customers. It has been designed to minimise the complexity of handling and integrating payments in your iOS project.
- SPM Integration Guide - Detailed SPM setup instructions
- API Documentation - Complete API reference
Please replace the values for orderId, token (Payment Session ID) and environment in the example iOS project inside the repo and run the application.
static var environment: CFENVIRONMENT = .SANDBOX
static let payment_session_id = "payment_session_id"
static let order_id = "order_id"
| Please refer our official iOS documentation here.
If you have questions, concerns, bug reports, etc, you can reach out to us using one of the following
- File an issue in this repository's Issue Tracker.
- Send a message in our discord channel. Join our discord server to get connected instantly.
- Send an email to care@cashfree.com
For general instructions on how to contribute please refer to CONTRIBUTING.