Welcome to the implementation guide for Revolut Pay on iOS! This page provides a comprehensive walkthrough for integrating Revolut Pay into your iOS application.
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:
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.
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 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:
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.
Read more about the privacy manifest in Apple's documentation.
For merchants using the Native SDK (3.x.x
), privacy manifests are available from version 3.2.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.
Run pod update
to install the updates.
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.
RevolutPayments.zip
archive under Frameworks/RevolutPay/RevolutPayNative.bundle/PrivacyInfo.xcprivacy
.Before you start this tutorial, ensure that you have completed the following steps:
The minimum supported iOS version is: 13.0.
To integrate Revolut Pay into your Xcode project through CocoaPods, add the following pod in your Podfile
:
pod 'RevolutPayments/RevolutPay'
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
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>
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
.
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.
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
}
}
)
For more information about the parameters and button styling, see: Parameters: iOS and Revolut Pay button guidelines.
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.
If you wish to save a customer's payment details using Revolut Pay - iOS, you need to meet one of the following requirements:
email
and assign it to the order by providing customer.id
customer.email
during order creationIf 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.
Your backend must support Fast checkout for this functionality to work. For more information, see: Implement Revolut Pay with Fast checkout.
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)
])
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.
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.
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.
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:
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.
Prepare your app ID: Construct your App ID in the following format: <Team ID>.<Bundle ID>
.
If your Team ID is ABCD12345
and your Bundle ID is com.company.myshop
, your App ID is ABCD12345.com.company.myshop
.
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.
Once your app is registered with Revolut, the next step is to configure your Xcode project to handle web credentials.
+
button to add a new capability and choose Associated Domains from the list.webcredentials:sso.revolut.com
. This entry links your app with Revolut's single sign-on (SSO) service, enabling biometrics and passkeys for authentication.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.
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.
For more information about the parameters and styling options, see: Parameters: iOS - 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
)
])
If all the steps have been followed correctly, you have successfully implemented Revolut Pay! 🎉