Merchant Android SDKs
Parameters
doc

Android parameters

This page contains information about the available parameters for the Revolut Pay Android SDK. For detailed instructions on how to install the SDK, see: Accept payments via Revolut Pay - Android

How to integrate the Revolut Pay button

  1. Import the SDK inside your project.

  2. Provide configuration information, such as, your Merchant API Public key, your return URI, and the environment of your backend.

    note

    You need to first generate the Merchant API key. To do this, you have to be accepted as a Merchant in your Revolut Business account. The Android SDK requires the public merchant key.

  3. Create a Revolut Pay button, using the RevolutPayments.revolutPay.provideButton() method, or adding an .xml file to the layout directory.

  4. Customize button with the available parameters, handle clicks, confirm payments.

Configuration

RevolutPayments.revolutPay.init(
environment: MAIN,
returnUri: "<yourAppReturnUri>",
merchantPublicKey: "<yourPublicAPIKey>",
requestShipping: false,
customer: Customer?)
ParameterDescriptionFormatRequired
environmentDefault value: MAIN.

Possible values are:
  • SANDBOX
  • MAIN
EnumYes
returnUriA URI that represents a deep link used by the Revolut app, to return to your app after the payment is confirmed or rejected.StringYes
merchantPublicKeyThe merchant's public API key used for authorization.StringYes
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 (for more information, see: Implement Revolut Pay with Fast checkout). Default: false.BooleanNo
customerObject containing customer details the merchant already has. These details can be prefilled upon initializing the widget. Only valid details are prefilled.ObjectNo

customer object:

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
dateOfBirthObject containing customer's date of birth.ObjectNo
countryObject containing customer's country code.ObjectNo

dateOfBirth object:

ParameterDescriptionFormatRequired
dayCustomer's birth day.Number, between 1-31Yes
monthCustomer's birth month.Number, between 1-12Yes
yearCustomer's birth year.Number, 4 digitsYes

country object:

ParameterDescriptionFormatRequired
valueISO 3166 2-letter country code associated with the customer.String, 2-letter, uppercaseYes

Kotlin/Java configuration for the Revolut Pay button

You can integrate the button inside your code with Kotlin/Java.

val buttonParams = ButtonParams(
radius = Radius.SMALL,
buttonSize = Size.MEDIUM,
variantModes = VariantModes(
lightMode = Variant.LIGHT_OUTLINED,
darkMode = Variant.DARK_OUTLINED
),
boxText = BoxText.NONE
)

val button = RevolutPayments.revolutPay.provideButton(context: Context, buttonParams)
addView(button)

Kotlin/Java parameters

context object: An instance of Context used to create a view.

buttonParams object:

ParameterDescriptionFormatRequired
RadiusDefines the corner radius of the button. Default value: NONE

Possible values are:
  • NONE
  • SMALL
  • MEDIUM
  • LARGE
EnumYes
SizeDefines the size of the button. Default value: LARGE

Possible values are:
  • EXTRA_SMALL
  • SMALL
  • MEDIUM
  • LARGE
EnumYes
BoxTextDefines the appearance of the view which is shown under the Revolut Pay button for informing the user about the provided reward. Default value: NONE

Possible values are:
  • NONE
  • GET_CASHBACK_VALUE
EnumYes
BoxTextCurrencyDefines the reward currency of the view which is shown under the Revolut Pay button. Default value: GBP

Possible values are:
  • GBP
  • EUR
  • USD
EnumNo
BoxTextValueDefines the reward value, shown under the Revolut Pay button. Default value: HIGH

Possible values are:
  • HIGH
  • MEDIUM
EnumNo
VariantModesOnly used in Kotlin/Java integration. Defines the dark and light theme variants used in different display modes of the device.

Values to define are:
  • lightMode
  • darkMode
ClassYes
lightModeDefines the style of the button used when device is in the light mode. Default value: Variant.LIGHT

Possible values are:
  • Variant.DARK
  • Variant.LIGHT
  • Variant.DARK_OUTLINED
  • Variant.LIGHT_OUTLINED
EnumYes
darkModeDefines the style of the button used when device is in the dark mode. Default value: Variant.DARK

Possible values are:
  • Variant.DARK
  • Variant.LIGHT
  • Variant.DARK_OUTLINED
  • Variant.LIGHT_OUTLINED
EnumYes

XML layout configuration for the Revolut Pay button

You can also integrate the button into your layout by adding it to an .xml file in the layout directory.

<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_BoxTextValue="Medium"
app:revolutPay_VariantDarkTheme="Dark"
app:revolutPay_VariantLightTheme="Light"
/>

XML parameters

ParameterDescriptionFormatRequired
revolutPay_RadiusDefines the corner radius of the button. Default value: None

Possible values are:
  • None
  • Small
  • Medium
  • Large
EnumYes
revolutPay_SizeDefines the size of the button. Default value: Large

Possible values are:
  • ExtraSmall
  • Small
  • Medium
  • Large
EnumYes
revolutPay_BoxTextDefines the appearance of the view which is shown under the Revolut Pay button for informing the user about the provided reward. Default value: None

Possible values are:
  • None
  • GetCashbackValue
EnumYes
revolutPay_BoxTextCurrencyDefines the reward currency of the view which is shown under the Revolut Pay button. Default value: GBP

Possible values are:
  • GBP
  • EUR
  • USD
EnumNo
revolutPay_BoxTextValueDefines the reward value, shown under the Revolut Pay button. Default value: High

Possible values are:
  • High
  • Medium
EnumNo
revolutPay_VariantLightThemeDefines the style of the button used when device is in the light mode. Default value: Light

Possible values are:
  • Dark
  • Light
  • DarkOutlined
  • LightOutlined
EnumYes
revolutPay_VariantDarkThemeDefines the style of the button used when device is in the dark mode. Default value: Dark

Possible values are:
  • Dark
  • Light
  • DarkOutlined
  • LightOutlined
EnumYes

Kotlin/Java configuration for the Revolut Pay promotional banner widget

val bannerParams = PromoBannerParams(
transactionId = "<transactionId>",
currency = "EUR",
paymentAmount = 150,
customer = Customer?
)

val widget = RevolutPayments.revolutPay.providePromotionalBannerWidget(context: Context, bannerParams)
addView(button)

Kotlin/Java parameters

context object: An instance of Context used to create a view.

bannerParams object:

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, given with 3-letter currency code (e.g. 'USD').EnumYes
paymentAmountThe amount to be paid by the customer, given in the lowest denomination (e.g. cents).LongNo
customerObject containing customer details the merchant already has. These details can be prefilled upon initializing the widget. Only valid details are prefilled.ObjectNo

customer object:

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
dateOfBirthObject containing customer's date of birth.ObjectNo
countryObject containing customer's country code.ObjectNo

dateOfBirth object:

ParameterDescriptionFormatRequired
dayCustomer's birth day.Number, between 1-31Yes
monthCustomer's birth month.Number, between 1-12Yes
yearCustomer's birth year.Number, 4 digitsYes

country object:

ParameterDescriptionFormatRequired
valueISO 3166 2-letter country code associated with the customer.String, 2-letter, uppercaseYes

What's next

Check out the following pages for more information about:

Was this page helpful?