Skip to main content
The iOS SDK makes it easy to implement enrollment flows for saving payment methods to a customer account. Include the library in your project by following the same steps as in full-checkout.

Additional resources

Requirements

Parameters

For the full list of parameters, see the iOS SDK Common Reference.

full-checkout Enrollment (iOS)

The Yuno full-checkout iOS SDK provides enrollment with pre-built UI, card enrollment, status handling, and basic error management. See Requirements above.

Step 1: Create a customer and customer session

Create a customer in Yuno’s system using the Create customer endpoint before enrolling payment methods. This endpoint will return a customer_id that you’ll use to associate enrolled payment methods with the specific customer. Then create a customer session using the Create Customer Session endpoint. The session information will be used when calling the enrollment methods.
The response includes a customer_session ID that you’ll use in the next step.

Step 2: Include the library in your project

Including the library in your project is done in the same way as in payment flows. Follow the steps in Include the library in your project there.

CocoaPods

Run:

Swift Package Manager

Check the Release notes or Yuno iOS SDK repository for the current SDK version.

Step 3: Initialize SDK with the public key

Initialize the SDK:
  1. Get your Public API Key from the Yuno Dashboard
  2. Initialize the SDK by calling Yuno.initialize() with your API key:
Use the YunoConfig data class to customize the SDK’s behavior. Include this configuration when calling Yuno.initialize(). For example:

Step 4: Implement the enrollment delegate

Create a class that adopts the YunoEnrollmentDelegate protocol:
Swift 6 Concurrency RequirementsIf you’re using Swift 6, you’ll need to implement the YunoEnrollmentDelegate protocol with specific concurrency considerations. See the Swift 6 Concurrency guide for detailed implementation options and best practices.

Options

Step 5: Start the enrollment process

Call the enrollPayment() method to display the enrollment flow:
The SDK presents a full-screen UIViewController modally using the viewController provided in your delegate. In SwiftUI, wrap a UIViewController and return it via the viewController property.

Options

In SwiftUI, wrap a UIViewController and return it from the viewController property so the SDK can present the UI. Only needed when the enrollment flow uses deep links. If your payment method does not use deep links, skip this step. Otherwise, handle the return in your AppDelegate:
Make sure the url.scheme matches the callback_url used when creating the customer_session.

Step 7: Handle enrollment result

The SDK calls your yunoEnrollmentResult(_:) delegate method with the final status:

Enrollment Result States

Yuno.Result does not include tokens or error messages; it only returns a high-level status.

Complementary features

For styling, themes, form options, and additional configurations, see SDK customizations.

Common reference

For full parameter and customization details, see the iOS SDK Common Reference.