Merchant Android SDKs
Methods and parameters
doc

Revolut Pay Android SDK

This page contains information about the methods, parameters, and data types of the Revolut Pay Android SDK.

info

For step-by-step instructions on installing and integrating the SDK, see: Accept payments via Revolut Pay - Android.

SDK components

RevolutPaymentsSDK object

This is the main entry point for configuring the SDK.

RevolutPaymentsSDK.configure method

Initialises the SDK with the necessary configuration. This method must be called before any other SDK method, typically in your Application's onCreate() method.

RevolutPaymentsSDK.configure(
configuration: RevolutPaymentsSDK.Configuration
)
ParameterDescriptionFormatRequired
configurationA RevolutPaymentsSDK.Configuration object containing the merchant public key and environment settings.ConfigurationYes

createController method

Creates a RevolutPaymentController to handle payment flows. This method is where you define the logic for handling payment results.

// For Activity
fun createController(
activity: ComponentActivity,
onResult: (PaymentResult) -> Unit
): RevolutPaymentController

// For Fragment
fun createController(
fragment: Fragment,
onResult: (PaymentResult) -> Unit
): RevolutPaymentController
ParameterDescriptionFormatRequired
activityThe ComponentActivity used to manage lifecycle and start payment flows.ComponentActivityYes
fragmentThe Fragment used to manage lifecycle and start payment flows.FragmentYes
onResultA callback function that handles payment result events. Receives a PaymentResult object.(PaymentResult) -> UnitYes

pay method (Controller)

Initiates the payment flow using the controller. This method is called on the RevolutPaymentController instance.

fun pay(orderParams: OrderParams)
ParameterDescriptionFormatRequired
orderParamsAn OrderParams object containing all the payment details including order token, return URI, and customer information.OrderParamsYes

isRevolutAppInstalled method

Checks if the Revolut Retail app is installed on the device.

fun isRevolutAppInstalled(context: Context): Boolean
ParameterDescriptionFormatRequired
contextThe current Context used to check for app installation.ContextYes

handle method

Handles deeplink URIs to trigger payment result callbacks when appropriate.

fun handle(uri: Uri)
ParameterDescriptionFormatRequired
uriThe deeplink URI to be handled by the SDK.UriYes

bindPaymentState method (Button Extension)

Binds the payment state to a RevolutPayButton, automatically showing a loading indicator while the payment is processing.

// For Activity
fun RevolutPayButton.bindPaymentState(
controller: RevolutPaymentController,
activity: ComponentActivity
)

// For Fragment
fun RevolutPayButton.bindPaymentState(
controller: RevolutPaymentController,
fragment: Fragment
)
ParameterDescriptionFormatRequired
controllerThe RevolutPaymentController instance to bind the payment state from.RevolutPaymentControllerYes
activityThe ComponentActivity used to manage the lifecycle for the binding.ComponentActivityYes
fragmentThe Fragment used to manage the lifecycle for the binding.FragmentYes

showBlockingLoading method (Button)

Shows or hides a blocking loading indicator on the RevolutPayButton.

fun RevolutPayButton.showBlockingLoading(loading: Boolean)
ParameterDescriptionFormatRequired
loadingIf true, shows the loading indicator and disables the button. If false, hides the loading indicator and enables the button.BooleanYes

provideButton method

Creates an instance of the Revolut Pay button, which you can programmatically add to your layout.

fun provideButton(
context: Context,
params: ButtonParams
): RevolutPayButton
ParameterDescriptionFormatRequired
contextThe current Context (e.g. your Activity or Fragment) used to create the button view.ContextYes
paramsA ButtonParams object defining how the button appears and behaves.ButtonParamsYes

providePromotionalBannerWidget method

Creates a promotional banner widget to display rewards and sign-up incentives.

fun providePromotionalBannerWidget(
context: Context,
params: PromoBannerParams,
themeId: Int? = 0
): View
ParameterDescriptionFormatRequired
contextThe current Context (e.g. your Activity or Fragment) used to create the button view.ContextYes
paramsA PromoBannerParams object that defines how the banner is set up.PromoBannerParamsYes
themeIdA custom theme resource for styling the banner. Defaults to 0 (the widget's default theme).Int (resource ID)No

Data structures

RevolutPaymentsSDK.Configuration class

data class Configuration(
val merchantPublicKey: String,
val environment: Environment
)
ParameterDescriptionFormatRequired
merchantPublicKeyThe merchant's public API key used for authorization, obtained from the Merchant API settings page. For the Sandbox environment use the Sandbox API Public key.StringYes
environmentThis parameter specifies the environment in which the SDK operates. Possible values: PRODUCTION, SANDBOXEnvironmentYes

OrderParams class

Contains all the parameters needed to initiate a payment.

data class OrderParams(
val orderToken: String,
val returnUri: Uri,
val requestShipping: Boolean,
val savePaymentMethodForMerchant: Boolean,
val customer: Customer?
)
ParameterDescriptionFormatRequired
orderTokenThe token for the order created via the Merchant API, passed to the SDK from your backend.StringYes
returnUriA URI that represents a deep link used by the Revolut app to return to your app after the payment is confirmed or rejected.UriYes
requestShippingIf true, the shipping address and delivery method are quickly collected through Revolut Pay from the user. Your backend must support Fast checkout for this functionality to work. Default: false.BooleanYes
savePaymentMethodForMerchantIf true, the customer gives permission for their payment method to be saved for future merchant-initiated transactions. Default is false.BooleanYes
customerA Customer object if you want to prefill user data in the payment flow. Only valid details are prefilled.CustomerNo

ButtonParams class

A ButtonParams object defining how the button appears and behaves.

class ButtonParams(
radius: Radius = Radius.NONE,
buttonSize: Size = Size.LARGE,
variantModes: VariantModes,
boxText: BoxText = BoxText.NONE,
boxTextCurrency: BoxTextCurrency? = BoxTextCurrency.GBP,
)
ParameterDescriptionFormatRequired
radiusDefines the corner radius of the button. Default value: Radius.NONE.RadiusYes
buttonSizeDefines the size of the button. Default value: Size.LARGE.SizeYes
variantModesDefines the dark and light theme variants used in different display modes of the device.VariantModesYes
boxTextDefines the appearance of the view which is shown under the Revolut Pay button for informing the user about the provided reward. Default value: BoxText.NONE.BoxTextYes
boxTextCurrencyDefines the reward currency of the view which is shown under the Revolut Pay button. Default value: BoxTextCurrency.GBP.BoxTextCurrencyNo

VariantModes class

class VariantModes(
lightMode: Variant = Variant.LIGHT,
darkMode: Variant = Variant.DARK
)
ParameterDescriptionFormatRequired
lightModeDefines the style of the button used when device is in the light mode. Default value: Variant.LIGHT.VariantYes
darkModeDefines the style of the button used when device is in the dark mode. Default value: Variant.DARK.VariantYes

PromoBannerParams class

data class PromoBannerParams(
val transactionId: String,
val currency: RevolutCurrency,
val paymentAmount: Long?,
val customer: Customer?
)
ParameterDescriptionFormatRequired
transactionIdThe token of the order connected to the promotional offer.
caution

The Create an order endpoint was updated to a new version and now returns token as the public identifier for the order. Previous integrations might still use the deprecated endpoint returning public_id.

We strongly advise upgrading to the new Create an order endpoint.

StringYes
currencyCurrency of the order using the RevolutCurrency enum.RevolutCurrencyYes
paymentAmountThe amount to be paid by the customer, given in the lowest denomination (e.g. cents).LongNo
customerA Customer object if you want to prefill user data in the banner flow. Only valid details are prefilled.CustomerNo

Customer class

Providing customer data can simplify the checkout process or pre-fill user info.

class Customer(
val name: String?,
val email: String?,
val phone: String?,
val dateOfBirth: DateOfBirth?,
val country: CountryCode?
)
ParameterDescriptionFormatRequired
nameCustomer's name. Example: 'Firstname Lastname'StringNo
emailCustomer's email. Example: 'example@email.com'StringNo
phoneCustomer's phone number, containing country code and '+' character. Example: '+441234567890'StringNo
dateOfBirthA DateOfBirth object containing customer's date of birth.DateOfBirthNo
countryA CountryCode object containing customer's country code.CountryCodeNo

DateOfBirth class

class DateOfBirth(
day: Int,
month: Int,
year: Int
)
ParameterDescriptionFormatRequired
dayCustomer's birth day.Int (between 1-31)Yes
monthCustomer's birth month.Int (between 1-12)Yes
yearCustomer's birth year.Int (4 digits)Yes

CountryCode class

class CountryCode(
val value: String
)
ParameterDescriptionFormatRequired
valueISO 3166 2-letter country code associated with the customer.String (2-letter, uppercase)Yes
note

Available country codes: The CountryCode class provides predefined constants for all supported countries (e.g., CountryCode.US, CountryCode.GB, CountryCode.DE, etc.) or you can create a custom one using CountryCode.fromValue("US").

Enums

Environment enum

The Environment enum defines the possible server environments that the SDK can point to.

enum class Environment {
PRODUCTION,
SANDBOX
}
ValueDescription
PRODUCTIONThe live environment for processing real transactions.
SANDBOXThe test environment for integration and development purposes.

Radius enum

The Radius enum defines the corner radius of the Revolut Pay button.

enum class Radius {
NONE,
SMALL,
MEDIUM,
LARGE
}
ValueDescription
NONENo corner radius (sharp corners).
SMALLA small corner radius.
MEDIUMA medium corner radius.
LARGEA large corner radius.

Size enum

The Size enum defines the width of the Revolut Pay button.

enum class Size {
EXTRA_SMALL,
SMALL,
MEDIUM,
LARGE
}
ValueDescription
EXTRA_SMALLAn extra-small button.
SMALLA small button.
MEDIUMA medium-sized button.
LARGEA large button.

Variant enum

The Variant enum defines the visual style of the Revolut Pay button, suitable for different themes. It is used within the VariantModes class.

enum class Variant {
DARK,
LIGHT,
DARK_OUTLINED,
LIGHT_OUTLINED
}
ValueDescription
DARKDark background with light text.
LIGHTLight background with dark text.
DARK_OUTLINEDLight background with a dark outline and text.
LIGHT_OUTLINEDDark background with a light outline and text.

BoxText enum

The BoxText enum defines the text content of the informational box displayed beneath the Revolut Pay button.

enum class BoxText {
NONE,
GET_CASHBACK_VALUE
}
ValueDescription
NONEThe informational box is not displayed.
GET_CASHBACK_VALUEDisplays text related to getting rewards.

BoxTextCurrency and RevolutCurrency enums

These enums define the supported ISO 4217 currency codes for use in transactions or for displaying rewards.

enum class BoxTextCurrency {
AED, AUD, BGN, CAD, CHF, CZK, DKK, EUR, GBP, HKD, HUF, ILS, JPY, MXN, NOK, NZD, PLN, QAR, RON, RUB, SAR, SEK, SGD, THB, TRY, USD, ZAR
}
// RevolutCurrency contains the same set of values.

Results

PaymentResult interface

The PaymentResult sealed interface represents the outcomes of the payment process. It is passed to the result callback when using the createController method.

sealed interface PaymentResult {
data object Success : PaymentResult
data class Failure(val exception: Throwable) : PaymentResult
data object UserAbandonedPayment : PaymentResult
}
ResultDescriptionProperties
SuccessCalled when the payment completes successfully.-
FailureCalled when the payment fails. Contains the exception with details about the error.exception: Throwable
UserAbandonedPaymentCalled when the user cancels the payment (for example, by navigating back on the summary screen).-

UI components and layouts

XML layout configuration for the Revolut Pay button

Instead of creating the button from Kotlin/Java, you can embed it directly in an XML layout:

<com.revolut.revolutpay.ui.button.RevolutPayButton
android:id="@+id/revolut_pay_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:revolutPay_Radius="Medium"
app:revolutPay_Size="Large"
app:revolutPay_BoxText="GetCashbackValue"
app:revolutPay_BoxTextCurrency="GBP"
app:revolutPay_VariantDarkTheme="Dark"
app:revolutPay_VariantLightTheme="Light"
/>
note

For details on the equivalent parameters, see ButtonParams class. The attribute names mirror those class properties (e.g., revolutPay_Radius = radius). The XML attribute values are case-insensitive (e.g. Medium or medium).

Was this page helpful?