Overview
The Yuno iOS SDK provides a pre-built payment UI that handles payment method rendering, card tokenization, and 3DS authentication. It supports UIKit and SwiftUI.The iOS SDK maintains SAQ-A PCI compliance (the simplest compliance level. Card data never touches your servers).
Prerequisites
- Xcode 15 or later
- iOS 14.0+ deployment target
- Swift 5.9+
- Yuno API keys (Authentication)
- At least one payment method enabled in your Dashboard
Installation
- CocoaPods
- Swift Package Manager
Add the Yuno SDK to your Then install:Open the
Podfile:.xcworkspace file (not .xcodeproj) after installation.SDK Initialization
Initialize the SDK early in your app lifecycle, typically inAppDelegate or @main App struct.
Configuration options
| Parameter | Type | Required | Description |
|---|---|---|---|
publicApiKey | String | Yes | Your Yuno public API key |
environment | YunoEnvironment | Yes | .sandbox or .production |
language | YunoLanguage | No | UI language (.english, .spanish, .portuguese). Defaults to device locale |
cardFlow | CardFlow | No | .oneStep (default) or .multiStep for card entry |
Full Checkout
Full Checkout renders all enabled payment methods with a single call. Yuno manages the entire UI.Create a checkout session (server-side)
Create a session from your backend:Pass the
checkout_session token to your iOS app.Seamless Checkout
Seamless Checkout gives you control over payment method selection while Yuno handles the payment form.3DS Handling
The SDK handles 3D Secure authentication automatically. When a payment requires 3DS, the SDK presents the authentication challenge within the checkout flow. No additional code is required. TheyunoPaymentResult delegate method receives the final result after 3DS completes.
Apple Pay
To enable Apple Pay in the Yuno iOS SDK:Configure Apple Pay in Xcode
Enable the Apple Pay capability in your target’s Signing & Capabilities tab. Add your merchant identifier.
Enable Apple Pay in Yuno Dashboard
Navigate to Dashboard > Settings > Payment Methods and enable Apple Pay for your account.
Customization
Customize the checkout appearance to match your app’s design.| Property | Type | Description |
|---|---|---|
primaryColor | UIColor | Primary accent color for buttons and highlights |
backgroundColor | UIColor | Background color of the checkout sheet |
textColor | UIColor | Primary text color |
cornerRadius | CGFloat | Corner radius for cards and buttons |
fontFamily | String | Font family name |
buttonStyle | ButtonStyle | .rounded or .rectangular |
Localization
The SDK supports automatic localization based on the device locale. Override with:Error Handling
Handle SDK errors through the delegate:Common error codes
Testing in Sandbox
Test with Yuno test cards
Use Yuno-provided test card numbers to simulate different outcomes (approval, decline, 3DS). See Testing.
Sandbox transactions use simulated providers. Some payment methods may have limited availability in sandbox compared to production.
Troubleshooting
SDK not initializing
- Verify you are calling
Yuno.initialize()before any other SDK method - Confirm the public API key is correct and matches your environment
- Check that the deployment target is iOS 14.0+
Checkout not appearing
- Ensure the checkout session token is valid and not expired
- Verify the presenting view controller is in the view hierarchy
- Check that at least one payment method is enabled in Dashboard for the specified country
Payment failing silently
- Implement the
yunoPaymentResultdelegate method to capture all outcomes - Enable verbose logging for debugging:
- Check Xcode console for SDK log output
Build errors after installation
- CocoaPods: Run
pod deintegrate && pod installto clean and reinstall - SPM: Reset package caches via File > Packages > Reset Package Caches
- Ensure
use_frameworks!is present in your Podfile
API Reference
Full parameter reference, delegate methods, enrollment, and Info.plist entries
Full parameter reference, delegate methods, enrollment, and Info.plist entries
YunoConfig Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
publicApiKey | String | Yes | . | Your Yuno public API key |
environment | YunoEnvironment | Yes | . | .sandbox or .production |
language | YunoLanguage | No | Device locale | UI language (.english, .spanish, .portuguese, .indonesian, .malay, .thai) |
cardFlow | CardFlow | No | .oneStep | .oneStep (single form) or .multiStep (step-by-step card entry) |
enableLogging | Bool | No | false | Enable verbose SDK logging to Xcode console |
appearance | YunoAppearance | No | Default theme | Visual customization |
Full Checkout Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
from | UIViewController | Yes | Presenting view controller |
checkoutSession | String | Yes | Checkout session ID from your server |
countryCode | String | Yes | ISO 3166-1 alpha-2 country code |
applePay | YunoApplePayConfig | No | Apple Pay configuration |
delegate | YunoPaymentDelegate | Yes | Delegate to receive payment results |
Seamless Checkout Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
from | UIViewController | Yes | Presenting view controller |
checkoutSession | String | Yes | Checkout session ID |
paymentMethodType | String | Yes | Payment method type (e.g., "CARD", "PIX") |
countryCode | String | Yes | ISO 3166-1 alpha-2 country code |
vaultedToken | String? | No | Vaulted token for saved payment methods |
delegate | YunoSeamlessDelegate | Yes | Delegate to receive payment lifecycle events |
Delegate Methods
YunoPaymentDelegate:| Method | Parameters | Description |
|---|---|---|
yunoPaymentResult(_:) | YunoPaymentResult | Called with the final payment outcome |
yunoDidCancel() | . | Called when the user dismisses the checkout |
| Method | Parameters | Description |
|---|---|---|
yunoCreatePayment(oneTimeToken:tokenWithInformation:) | String, YunoTokenData | Called when a token is generated. Create payment server-side, then call Yuno.continuePayment() |
yunoPaymentResult(_:) | YunoPaymentResult | Called with the final payment outcome |
yunoDidFail(error:) | YunoError | Called when the SDK encounters an error |
Enrollment
Start card enrollment (vaulting) for returning customers:| Method | Parameters | Description |
|---|---|---|
yunoDidCompleteEnrollment(result:) | YunoEnrollmentResult | Called when enrollment completes |
yunoDidFailEnrollment(error:) | YunoError | Called when enrollment encounters an error |
CREATED, READY_TO_ENROLL, ENROLLED, ENROLL_FAILED, EXPIRED, REJECTED, DECLINED, UNENROLLEDExtended Customization
Additional appearance properties beyond the basics:| Property | Type | Description |
|---|---|---|
errorColor | UIColor | Color for error messages and invalid field states |
borderColor | UIColor | Border color for input fields |
borderWidth | CGFloat | Border width for input fields |
.systemBackground, .label) for automatic adaptation.Info.plist Entries
Apple Pay:Next steps
Mobile SDK Overview
Compare all mobile SDK options.
Android SDK
Building for Android? Start here.
Customization
Theme and style your checkout.
Testing
Test card numbers and sandbox setup.