A headless version of Primer’s Universal Checkout is available if you need more customisation and control over the checkout experience. Headless Universal Checkout can be used with your own UI, giving you the required flexibility to move quickly when making design changes, while still having Universal Checkout capture sensitive PCI card data.

As with all versions of Universal Checkout, any payment method can be added and configured through Dashboard, meaning Primer handles the logic of when to display each method.

<aside> ⚠️ Headless Universal Checkout is currently available in beta on iOS SDK version 1.28.0-beta.8

</aside>

Contents


Step 1. Install

You can integrate PrimerSDK using CocoaPods or Swift Package Manager. Follow the relevant guide below.


Step 2. Initialise Primer’s Headless Universal Checkout

Request a client token from your backend.

<aside> 💡 Check our guide on how to set up the client session here.

</aside>

<aside> ❗ Remember that based on your client token, the Primer SDK internally retrieves information from the Primer Dashboard. This enables displaying only the merchant selected payment methods through headless UC.

</aside>

Once you have a client token, you can initialise Primer’s Headless Checkout with start(withClientToken:settings:delegate:completion:). The completion handler will return the available payment methods for the client session.

The completion will contain an array of the payment method type enum cases. Below you can find all the payment methods cases.