Guides • Accept Payments
Implement Revolut Pay on iOS
doc

Accept payments via Revolut Pay - iOS

Welcome to the implementation guide for Revolut Pay on iOS! This page provides a comprehensive walkthrough for integrating Revolut Pay into your iOS application.

Overview

Check the following high-level procedure of implementing Revolut Pay in your iOS app. Use the links to jump to the details of each step:

  1. Install iOS SDK
  2. Support the Revolut app URL scheme
  3. Configure iOS SDK
  4. Create Revolut Pay button
  5. Display Revolut Pay button
  6. Add URL handler
  7. Enable biometrics and passkeys support
  8. (Optional) Add the Revolut Pay promotional banner

Available versions and SDK support

The Revolut Pay iOS SDK comes in a variety of versions, each with its own unique set of integration methods:

  • Revolut Pay iOS SDK 2.x.x: This version supports a WebView-based payment flow, which relies on web-based user interfaces embedded within the app using a WebView. This version uses the web-based payment flow in case the customer doesn't have the Revolut app installed or redirects the customer to the Revolut app if it's installed.

    caution

    This version of the SDK is available in maintenance mode only, meaning that no new features will be introduced, and updates will be limited to critical bug fixes and security updates. It's recommended for developers to consider upgrading to newer versions.

  • Revolut Pay iOS SDK 3.x.x and newer: With the introduction of version 3.x.x, the SDK now supports native interfaces within the app. This integration offers a native payment flow regardless of whether the customer has the Revolut app installed, significantly enhancing the payment experience and making it more seamless for the user.

Privacy manifest files and SDK maintenance

Privacy manifests are crucial documents that detail the privacy practices of the third-party code in an app, using a single standard format. The privacy manifest is a property list that records the following information:

  • The types of data collected by your app or third-party SDK.
  • The required reasons APIs your app or third-party SDK uses.

Starting May 1, Apple requires all apps to include a privacy manifest to prevent them from being rejected during the App Store review process (see more: Upcoming third-party SDK requirements).

These steps are required to prepare your iOS application for changes in Apple's app review policies and ensure that your Revolut Pay integration adheres to the latest privacy standards.

info

Read more about the privacy manifest in Apple's documentation.

Native SDK

For merchants using the Native SDK (3.x.x), privacy manifests are available from version 3.2.1:

Update the SDK via CocoaPods

  1. In your Podfile, ensure you're using a version that supports the latest privacy standards:

    pod 'RevolutPayments/RevolutPay', '>= 3.2.1'

    This will update to the latest SDK version with native interface support.

  2. Run pod update to install the updates.

Add the privacy manifest

caution

As Revolut Pay is static, for Apple to take the manifest file into consideration, you need to merge the Revolut Pay iOS SDK's privacy manifest with your app's privacy manifest.

  1. The privacy manifest file is located within the RevolutPayments.zip archive under Frameworks/RevolutPay/RevolutPayNative.bundle/PrivacyInfo.xcprivacy.
  2. Download the archive from the latest Release and extract the privacy manifest.
  3. Add the privacy manifest to your app's resources:
    • If your app does not currently use a privacy manifest, simply add the SDK's file to your app's resources.
    • If you already have an existing privacy manifest, merge the SDK's manifest with your app's existing privacy document to ensure compliance with Apple's new requirements. Address any conflicts by integrating data handling practices from both the SDK and your app into a unified document.

Implement Revolut Pay on iOS

0. Before you start

Before you start this tutorial, ensure that you have completed the following steps:

1. Install iOS SDK

note

The minimum supported iOS version is: 13.0.

CocoaPods

To integrate Revolut Pay into your Xcode project through CocoaPods, add the following pod in your Podfile:

pod 'RevolutPayments/RevolutPay'
note

This will install the latest version of Revolut Pay iOS SDK. If your app relies on a web-based flow, check the following section to see which SDK version you should use.

Add the following code at the end of your Podfile:

post_install do |installer|
installer.generated_projects.each do |project|
project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
end
end
end
end

2. Support the Revolut app URL scheme

Beginning with iOS 9 and Xcode 7, apps must declare the URL schemes they intend to open, by specifying the schemes in the app's Info.plist file.

Our SDK opens the Revolut mobile app (if installed), when the user taps the Revolut Pay button, and your app therefore needs to declare the relevant URL scheme.

To declare the URL scheme, add the following to the Info.plist file:

<key>LSApplicationQueriesSchemes</key>
<array>
<string>revolut</string>
</array>

3. Configure iOS SDK

Import the Revolut Payments module by adding the following line:

import RevolutPayments

Before proceeding with any SDK usage, you must first configure the SDK by calling RevolutPayKit.configure(with:). This step can be done on app launch, in AppDelegate.

note

You need to first generate the Merchant Secret and Public API keys. To do this, you have to be accepted as a Merchant in your Revolut Business account. The iOS SDK requires the Merchant Public API key.

4. Create Revolut Pay button

First create a RevolutPayKit object. It provides all the necessary tools for processing the payment of a specific item or list of items (for example, the items on your Checkout screen).

let revolutPayKit = RevolutPayKit()

To create a Revolut Pay button, call the button or swiftUIButton method of the object. Through the function parameters, you can configure the visual style of the button and handle all the steps of the payment flow.

let button = revolutPayKit.button(
style: .init(size: .large),
returnURL: "myapp://revolut-pay", // <- Change with your actual return URL
createOrder: { createOrderHandler in
// Get the order token from your backend
createOrderOnBackEnd { orderToken in
createOrderHandler.set(orderToken: orderToken)
}
},
completion: { result in
switch result {
case .success:
// Handle successful payment
case .failure(let error):
// Handle payment error
case .userAbandonedPayment:
// Handle abandoned payment
}
}
)
info

For more information about the parameters and button styling, see: Parameters: iOS and Revolut Pay button guidelines.

Merchant initiated transactions

Pass the savePaymentMethodForMerchant parameter as true in order to save your customer's payment details during checkout. Customers are able to save both their Revolut account and card details via Revolut Pay.

This way, your customers can grant permission for you to initiate payments on their saved payment method stored by Revolut Pay, without any further action required from the customer. Use this feature to initiate recurring payments, e.g., to take payments for a subscription or to charge a customer later for a specific order.

By default, merchant initiated transactions are disabled.

To learn more about how to save and charge a customer's payment method, see: Charge a customer's saved payment method.

note

If you wish to save a customer's payment details using Revolut Pay - iOS, you need to meet one of the following requirements:

  • Have a customer object with email and assign it to the order by providing customer.id
  • Create a new customer with customer.email during order creation

Fast checkout

If you want the shipping address and delivery method to be quickly collected from the user through Revolut Pay, pass the shouldRequestShipping parameter as true.

This way, your app can skip the shipping flow during checkout and the user can use existing shipping details stored by Revolut Pay.

By default, Fast checkout is not enabled.

caution

Your backend must support Fast checkout for this functionality to work. For more information, see: Implement Revolut Pay with Fast checkout.

5. Display Revolut Pay button

To display the button, simply insert it into your view hierarchy. For example:

view.addSubview(button)
button.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
button.bottomAnchor.constraint(equalTo: view.bottomAnchor),
button.leadingAnchor.constraint(greaterThanOrEqualTo: view.leadingAnchor),
button.trailingAnchor.constraint(lessThanOrEqualTo: view.trailingAnchor),
button.centerXAnchor.constraint(equalTo: view.centerXAnchor)
])

6. Add URL handler

caution

The Revolut Pay SDK won't work properly without configuring your URL handler.

Integrating Revolut Pay into your iOS application requires setting up a URL handler to manage incoming deep links to the Revolut Pay SDK. There are two approaches to achieve this, depending on your app's architecture and iOS version support.

Using AppDelegate

For applications not utilising the Scene-based architecture, the URL handler should be added to the AppDelegate. This approach is straightforward and involves implementing a specific AppDelegate method designed to handle URLs.

Configure your AppDelegate to pass incoming deep links to the Revolut Pay SDK. This is required to properly handle redirection from the Revolut app. The purpose of the following method is to ensure the URL is passed to the correct handler - in this case, the RevolutPayKit:

func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
RevolutPayKit.handle(url: url)
return true
}

This setup ensures that any URL intended for Revolut Pay transactions is correctly intercepted and managed by the payment kit in your application.

Using UIScene

For apps supporting multiple scenes or windows, the UISceneDelegate is used to handle URLs. Add the following method to your scene delegate:

func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
if let url = URLContexts.first?.url {
RevolutPayKit.handle(url: url)
}
}

This approach caters to modern iOS applications, allowing them to handle payment URLs in a scene-specific context, which is essential for apps supporting multi-window environments on iPadOS or advanced iOS features.

7. Enable biometrics and passkeys support

You can integrate biometrics and passkeys with Revolut Pay in your iOS app, for an enhanced security experience. By completing these steps, you enable your users to enjoy the convenience and security of biometric authentication and passkeys when using Revolut Pay within your app.

This optional integration step not only enhances user experience but also adds a layer of security, making transactions both seamless and secure.

This process involves a simple registration and a minor configuration in Xcode. Here's how you can do it:

7.1 Register your app with Revolut

Before you can enable biometrics and passkeys, Revolut needs to recognise your app. This is achieved by registering your app's identifier with Revolut's merchant integration team.

  1. Prepare your app ID: Construct your App ID in the following format: <Team ID>.<Bundle ID>.

    • The Team ID is provided by Apple in your developer account
    • The Bundle ID is the unique identifier of your app
    Example

    If your Team ID is ABCD12345 and your Bundle ID is com.company.myshop, your App ID is ABCD12345.com.company.myshop.

  2. Email Revolut: Send an email to merchant-integration@revolut.com, providing your App ID. This step is crucial for Revolut to authorise and associate biometric and passkey features with your app.

7.2 Configure associated domains in Xcode

Once your app is registered with Revolut, the next step is to configure your Xcode project to handle web credentials.

  1. Open your project in Xcode: Launch Xcode and open the project that you are integrating Revolut Pay with.
  2. Navigate to Signing & Capabilities: Select your app's target in the project navigator, then click on the Signing & Capabilities tab.
  3. Add Associated Domains: Click on the + button to add a new capability and choose Associated Domains from the list.
  4. Enter domain for Revolut: Under the Associated Domains, add webcredentials:sso.revolut.com. This entry links your app with Revolut's single sign-on (SSO) service, enabling biometrics and passkeys for authentication.

(Optional) 8. Add the Revolut Pay promotional banner widget

Optionally, you can use the Revolut Pay promotional banner widget to offer rewards to customers who create a new Revolut account after checkout. You can add the widget to your app the following way.

8.1 Configure the promotional banner

First, you need to configure the promotional banner. To configure the promotional banner with minimal required parameters, call the revolutPayKit.promotionalBanner() method with the following parameters:

let promotionalBanner = revolutPayKit.promotionalBanner(
transactionId: "transaction-id", // Unique ID of the payment corresponding to the promotional offer
amount: 10_00,
currency: .EUR,
customer: .init()
)

This configuration will create a banner with default styling and without any additional information about the customer. Ideally, merchants should provide as much information as possible.

info

For more information about the parameters and styling options, see: Parameters: iOS - Promotional banner.

8.2 Display the promotional banner

After configuring the promotional banner, you have to display it in your app. To do this, simply insert it to your view hierarchy. For example:

view.addSubview(promotionalBanner)

promotionalBanner.translatesAutoresizingMaskIntoConstraints = false

NSLayoutConstraint.activate([
promotionalBanner.topAnchor.constraint(
equalTo: view.safeAreaLayoutGuide.topAnchor,
constant: 16
),
promotionalBanner.trailingAnchor.constraint(
equalTo: view.safeAreaLayoutGuide.trailingAnchor,
constant: -16
),
promotionalBanner.leadingAnchor.constraint(
equalTo: view.safeAreaLayoutGuide.leadingAnchor,
constant: 16
)
])
success

If all the steps have been followed correctly, you have successfully implemented Revolut Pay! 🎉


What's next

Was this page helpful?