iOS Mobile SDKs

PayU offers various iOS SDKs that each serve a unique use case. Before you begin integrating PayU iOS SDKs into your application, complete the following prerequisites to ensure a smooth integration process.

1. Account Setup

Register and Activate Your PayU Account
StepActionLink
1Register for a PayU Merchant AccountRegister
2Complete KYC and activate your accountActivate Account
3Access your Test Merchant Key and SaltGet Test Credentials
⚠️

Important: Never use production credentials during development. Always use test credentials until you're ready for go-live.

Obtain Your Credentials

You'll need the following credentials from the PayU Dashboard. Refer to Access Merchant Key and Salt.

CredentialDescription
Merchant KeyUnique identifier for your account
Merchant SaltUsed for hash generation
Client IDFor OAuth-based authentication
Client SecretFor OAuth-based authentication

2. Development Environment Requirements

Minimum System Requirements
RequirementMinimum VersionRecommended
Xcode16.0+26.0
iOS Deployment TargetiOS 13.0iOS 15.0+
Swift5.0+5.7+
macOSSequoia 15.0Tahoe 26.0
Package Manager Support

PayU iOS SDKs are available through:

Package ManagerSupportedNotes
CocoaPods✅ YesRecommended for most projects
Swift Package Manager✅ YesAvailable for select SDKs
Manual Integration✅ YesFramework files available
CocoaPods Setup

Add the following to your Podfile:

# Podfile example
platform :ios, '12.0'
use_frameworks!

target 'YourApp' do
  # Add the SDK you need
  pod 'PayUIndia-CheckoutPro'  # For Checkout Pro SDK
  # pod 'PayUIndia-PG-SDK'     # For Core SDK
end

Then run:

pod install

3. Apple Privacy & Compliance

Privacy Manifest Configuration

Starting with iOS 17, Apple requires apps to declare the data they collect. PayU SDKs collect certain data for payment processing.

Required Privacy Manifest Entries

Add the following to your app's PrivacyInfo.xcprivacy file:

<dict>
    <key>NSPrivacyTracking</key>
    <false/>
    <key>NSPrivacyTrackingDomains</key>
    <array/>
    <key>NSPrivacyCollectedDataTypes</key>
    <array>
        <dict>
            <key>NSPrivacyCollectedDataType</key>
            <string>NSPrivacyCollectedDataTypePaymentInfo</string>
            <key>NSPrivacyCollectedDataTypeLinked</key>
            <false/>
            <key>NSPrivacyCollectedDataTypeTracking</key>
            <false/>
            <key>NSPrivacyCollectedDataTypePurposes</key>
            <array>
                <string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
            </array>
        </dict>
    </array>
</dict>
Required App Permissions

Depending on the SDK and payment methods you enable, add these to your Info.plist:

<!-- For UPI Intent (opening UPI apps) -->
<key>LSApplicationQueriesSchemes</key>
<array>
    <string>phonepe</string>
    <string>tez</string>
    <string>paytm</string>
    <string>bhim</string>
    <string>upi</string>
</array>

<!-- For camera access (card scanning, if enabled) -->
<key>NSCameraUsageDescription</key>
<string>Camera access is required to scan your card details</string>

<!-- For network access -->
<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <false/>
</dict>

4. Server-Side Hash Generation Setup

PayU uses hash-based verification for security. Hash must be generated on your server, never on the client.

Hash Generation Flow

Hash Formula

v1 Hashing

hash = SHA512(key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5||||||salt)

v2 Hashing

   hash = SHA512(hashStringWithoutSalt | salt)
Sample Server-Side Code
const crypto = require('crypto');

function generatePayUHash(params, salt) {
    const hashString = `${params.key}|${params.txnid}|${params.amount}|${params.productinfo}|${params.firstname}|${params.email}|${params.udf1 || ''}|${params.udf2 || ''}|${params.udf3 || ''}|${params.udf4 || ''}|${params.udf5 || ''}||||||${salt}`;
    
    return crypto.createHash('sha512').update(hashString).digest('hex');
}
import hashlib

def generate_payu_hash(params, salt):
    hash_string = f"{params['key']}|{params['txnid']}|{params['amount']}|{params['productinfo']}|{params['firstname']}|{params['email']}|{params.get('udf1', '')}|{params.get('udf2', '')}|{params.get('udf3', '')}|{params.get('udf4', '')}|{params.get('udf5', '')}||||||{salt}"
    
    return hashlib.sha512(hash_string.encode()).hexdigest()
function generatePayUHash($params, $salt) {
    $hashString = $params['key'] . '|' . $params['txnid'] . '|' . $params['amount'] . '|' . $params['productinfo'] . '|' . $params['firstname'] . '|' . $params['email'] . '|' . ($params['udf1'] ?? '') . '|' . ($params['udf2'] ?? '') . '|' . ($params['udf3'] ?? '') . '|' . ($params['udf4'] ?? '') . '|' . ($params['udf5'] ?? '') . '||||||' . $salt;
    
    return hash('sha512', $hashString);
}
🔒

Security Note: Never embed your Salt in the iOS app. Always generate hashes server-side.

5. Choose Your SDK

Based on your requirements, select the appropriate SDK:

Your RequirementRecommended SDKIntegration Effort
Fastest integration, pre-built UICheckout Pro SDKLow
Full UI customizationCore SDKMedium
UPI payments onlyUPI SDKLow
Improved card success ratesCore SDK + Native OTP AssistMedium
One-click UPI paymentsUPI Bolt SDKLow
Native 3D Secure experience[3DS 2.0 SDK]doc:ios-3ds-sdk)Medium

6. Webhook Setup

Configure webhooks to receive real-time payment notifications.

Required Webhook Events
EventDescription
payment.successPayment completed successfully
payment.failedPayment failed
payment.pendingPayment is pending
refund.successRefund processed successfully
refund.failedRefund failed
Webhook Configuration
  1. Navigate to Dashboard → Settings → Webhooks
  2. Click Create New Webhook
  3. Enter your webhook URL (must be HTTPS)
  4. Select the events you want to receive
  5. Save and note the webhook secret for verification
📘

Note: For detailed webhook setup, refer to Webhooks for Payments.

Choose your integration

Note: The best SDK for you will depend on your specific needs and requirements.

If you need a quick and easy way to integrate a payment interface into your app, then the Checkout Pro SDK is a good option. If you need more control over the look and feel of the payment interface, then the Core SDK is a good choice. And if you need to accept payments through UPI, OlaMoney, PhonePe, or Native OTP Assist, then the respective SDKs are a good fit.

Here is a comparison table that summarizes the key features of the different SDKs:

SDKFeaturesUse Case
iOS CheckoutPro SDKComplete ready-to-use native checkout UI allows you to get started quickly with minimal effort. This SDK is a great choice for small and medium sized businesses that operates on limited tech resource.| Low Effort Integration, | Non-Seamless Checkout | Limited Tech | Resource |
iOS Core SDKCreate your own UI for the payment flow by leveraging various methods exposed in the Core SDK. This SDK is more suitable for larger enterprises that can allocate dedicated engineering resource to develop customised payment flow.| Seamless Checkout | Medium Effort | Enterprise Businesses |
iOS UPI SDKThis SDK best suited for creating a custom payment UI for UPI only checkout.Low Effort Integration|UPI Checkout
iOS Ola Money SDKAllows you to integrate OlaMoney payments into your iOS app.Low Effort Integration|OlaMoney Checkout
iOS Custom Browser SDKCollect netbanking payment on the bank's pageLow Effort Integration|PhonePe Checkout
iOS Native OTP Assist SDKAllows you to capture OTP (One Time Password) directly from your iOS app without redirecting the user to the bank's 3D secure page.Native OTP Support| Low Effort Integration
iOS 3DS 2.0 SDKprovide a native experience rather than redirecting customer to a bank page. The UI is standardised according to EMVCO guidelines and offers customisation.Native OTP Support
iOS UPI Bolt SDKAllows you to simpler and more efficient payment experience to the merchants. It will eliminate any third-party redirection and higher success rate.One-Click Payment| UPI Checkout

Next Steps

Once you've completed the prerequisites above, proceed with your chosen SDK integration:

  1. Integrate Checkout Pro SDK - For quick, ready-to-use checkout
  2. Integrate Core SDK - For custom payment flows

Did this page help you?