Checkout Developer Portal

The Littlepay Checkout APIs and SDKs provide a simple and secure way to accept online payments from your front of office web and native mobile applications. Easily build secure web and mobile ticketing applications leveraging Littlepay’s network of transit acquirers.

Guides    API Reference

Littlepay Checkout iOS SDK

The Littlepay Checkout iOS SDK is an online payment solution for iOS applications. It supports card payment (including secure card authentication supporting 3DS1 and 3DS2), PayPal and Apple Pay.

Latest SDK version

1.0.6

Installation

System requirement

Xcode 12

CocoaPods

pod 'LittlepayCheckout', :git => "https://github.com/littlepay/littlepay-ios.git", :branch => '1.0.6'

Manual Installation

Alternatively, you can add Littlepay Checkout iOS SDK manually.

  1. Download LittlepayCheckout.xcframework and CardinalMobile.xcframework from https://gitlab.com/littlepay-oss/checkout/ios-sdk/-/tree/master/Frameworks.

  2. In your Xcode project, drag the LittlepayCheckout.xcframework and CardinalMobile.xcframework file into the Frameworks group in your Xcode Project (create the group if it doesn't already exist). In the Import dialog, tick the box to Copy items into destinations group folder (or Destination: Copy items if needed). The iOS SDK files are now available for linking to your project.

  3. Open Xcode and click on your project in the source list to the left of the main editor area.

  4. Select your application under the Targets section and go to the General tab.

  5. Expand the Embedded Binaries section then click the small “+” button at the bottom of the list.

  6. Add the LittlepayCheckout.xcframework and CardinalMobile.xcframework file from the list

Supported Payment Methods

  • Visa, MasterCard and AMEX Cards
  • PayPal
  • Apple Pay

Drop-in UI Usage

Make Payment

Import LittlepayCheckout in your checkout UIViewController.

Swift
    import LittlepayCheckout

Use CheckoutSdk, passing in a [Config object], to create a Littlepay SDK instance. Call makePayment method and pass client_token which should be returned in server api response when creating Order/Subscription.

Swift
    CheckoutSdk(
        config: configObject,       // Littlepay config object
    ).makePayment(
        using: clientSdkObject,     // The base64 string you receive
                                    // when your server creates an 
                                    // Order or sets up a Subscription 
                                    // (see [Littlepay API documentation](https://github.com/littlepay/littlepay-api))
        cardHolderName: "User Name",// optional, pre-populate card holder
                                    // name when collecting card details
        address: address            // optional, Address object when doing
                                    // 3DS authentication
    ) { paymentResult in
        // Callback to handle payment result
        print ("Payment Result: \(paymentResult)")
    }

Manage Saved Cards

Drop-in UI for user to add/remove their saved cards.

Swift
    CheckoutSdk(
        config: configObject,       // Littlepay config object
    ).manageSavedCards(
        clientSdkObject: token,     // The base64 string you receive
                                    // when your server creates an 
                                    // clientSdkObject  
                                    // (see [Littlepay API documentation](https://github.com/littlepay/littlepay-api))
        cardHolderName: "User Name",// optional, pre-populate card holder
                                    // name when collecting card details
    ) { result in
        // Callback when manage saved card flow ends
        print ("Manage Saved Cards finished with \(result).")
    }

Config object

applePayMerchantDetail(optional)

Apple Pay merchant details to support pay by Apple wallet,

skipSecurityWarning(optional)

Enable Checkout SDK to run on debug build, default to false.

Never set it to true in Production

LittlePayError

For a list of error types and error codes, see Littlepay shared documentation

Updated about a month ago

iOS SDK


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.