Mobile SDKs

Native Mobile Integration

Integrate payments into your iOS and Android applications with our native SDKs. Built for performance, security, and ease of use.

Choose Your Platform

iOS SDK

Native iOS integration

Integrate payments into your iOS app with our Swift SDK

Swift 5.0+
iOS 12.0+
Get Started

Android SDK

Native Android integration

Integrate payments into your Android app with our Kotlin SDK

Kotlin
API 21+
Get Started

iOS SDK

Installation

Install the ZyPay iOS SDK using Swift Package Manager or CocoaPods

Package.swift
dependencies: [
    .package(url: "https://github.com/zypay/zypay-ios-sdk.git", from: "2.0.0")
]

Basic Usage

Initialize the SDK and create your first payment

Initialize SDK
import ZyPaySDK

// Initialize the SDK
let zypay = ZyPaySDK(
    publicKey: "pk_test_1234567890abcdef",
    environment: .sandbox
)

// Create a payment
let paymentRequest = PaymentRequest(
    amount: Amount(value: 1000, currency: "USD"),
    customer: Customer(
        email: "customer@example.com",
        firstName: "John",
        lastName: "Doe"
    ),
    description: "Test payment"
)

zypay.createPayment(paymentRequest) { result in
    switch result {
    case .success(let payment):
        print("Payment created: \(payment.id)")
    case .failure(let error):
        print("Payment failed: \(error.localizedDescription)")
    }
}

Payment Form Integration

Use our pre-built payment form components

Payment Form
import ZyPaySDK
import UIKit

class PaymentViewController: UIViewController {
    @IBOutlet weak var paymentFormView: UIView!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        // Create payment form
        let paymentForm = ZyPayPaymentForm(
            publicKey: "pk_test_1234567890abcdef",
            amount: Amount(value: 1000, currency: "USD")
        )
        
        // Set up payment form
        paymentForm.delegate = self
        paymentForm.present(in: paymentFormView)
    }
}

extension PaymentViewController: ZyPayPaymentFormDelegate {
    func paymentForm(_ form: ZyPayPaymentForm, didCompletePayment payment: Payment) {
        print("Payment successful: \(payment.id)")
        // Handle successful payment
    }
    
    func paymentForm(_ form: ZyPayPaymentForm, didFailWithError error: Error) {
        print("Payment failed: \(error.localizedDescription)")
        // Handle payment error
    }
}

Android SDK

Installation

Install the ZyPay Android SDK using Gradle

build.gradle (Module: app)
dependencies {
    implementation 'com.zypay:zypay-android-sdk:2.0.0'
}
build.gradle (Project)
allprojects {
    repositories {
        google()
        mavenCentral()
        maven { url 'https://jitpack.io' }
    }
}

Basic Usage

Initialize the SDK and create your first payment

Initialize SDK
import com.zypay.sdk.ZyPaySDK
import com.zypay.sdk.models.*

class MainActivity : AppCompatActivity() {
    private lateinit var zypay: ZyPaySDK
    
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        
        // Initialize the SDK
        zypay = ZyPaySDK(
            publicKey = "pk_test_1234567890abcdef",
            environment = Environment.SANDBOX
        )
        
        // Create a payment
        val paymentRequest = PaymentRequest(
            amount = Amount(value = 1000, currency = "USD"),
            customer = Customer(
                email = "customer@example.com",
                firstName = "John",
                lastName = "Doe"
            ),
            description = "Test payment"
        )
        
        zypay.createPayment(paymentRequest) { result ->
            when (result) {
                is Result.Success -> {
                    val payment = result.data
                    println("Payment created: ${payment.id}")
                }
                is Result.Error -> {
                    val error = result.exception
                    println("Payment failed: ${error.message}")
                }
            }
        }
    }
}

Payment Form Integration

Use our pre-built payment form components

Payment Form
import com.zypay.sdk.ui.ZyPayPaymentForm
import com.zypay.sdk.models.*

class PaymentActivity : AppCompatActivity() {
    private lateinit var paymentForm: ZyPayPaymentForm
    
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_payment)
        
        // Create payment form
        paymentForm = ZyPayPaymentForm(
            publicKey = "pk_test_1234567890abcdef",
            amount = Amount(value = 1000, currency = "USD")
        )
        
        // Set up payment form
        paymentForm.setPaymentFormListener(object : PaymentFormListener {
            override fun onPaymentSuccess(payment: Payment) {
                println("Payment successful: ${payment.id}")
                // Handle successful payment
            }
            
            override fun onPaymentError(error: Exception) {
                println("Payment failed: ${error.message}")
                // Handle payment error
            }
        })
        
        // Present payment form
        paymentForm.present(this)
    }
}

SDK Features

Security

Built-in security features to protect your users' payment data

  • PCI DSS compliance
  • Tokenization
  • Fraud detection

Performance

Optimized for performance and minimal impact on your app

  • Lightweight SDK
  • Fast initialization
  • Efficient networking

Easy Integration

Simple APIs and pre-built components for quick integration

  • Pre-built forms
  • Customizable UI
  • Comprehensive docs

Best Practices

Do

  • Initialize SDK in Application class
  • Handle network errors gracefully
  • Validate amounts on the server
  • Test with different devices
  • Implement proper loading states

Don't

  • Store sensitive data locally
  • Ignore error handling
  • Use test keys in production
  • Block the main thread
  • Skip security updates

Download SDKs

iOS SDK

Download the latest iOS SDK and get started with native iOS integration

v2.0.0
Latest
Download iOS SDK

Android SDK

Download the latest Android SDK and get started with native Android integration

v2.0.0
Latest
Download Android SDK

Ready to Build Mobile Payments?

Start integrating payments into your mobile applications today. Download our SDKs and follow our comprehensive guides.