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
Import the SDK inside your project.
Provide configuration information, such as, your Merchant API Public key, your return URI, and the environment of your backend.
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.
Create a Revolut Pay button, using the RevolutPayments.revolutPay.provideButton()
method, or adding an .xml
file to the layout directory.
Customize button with the available parameters, handle clicks, confirm payments.
RevolutPayments.revolutPay.init(
environment: MAIN,
returnUri: "<yourAppReturnUri>",
merchantPublicKey: "<yourPublicAPIKey>",
requestShipping: false,
customer: Customer?)
Parameter | Description | Format | Required |
---|---|---|---|
environment | Default value: MAIN . Possible values are:
| Enum | Yes |
returnUri | A URI that represents a deep link used by the Revolut app, to return to your app after the payment is confirmed or rejected. | String | Yes |
merchantPublicKey | The merchant's public API key used for authorization. | String | Yes |
requestShipping | If 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 . | Boolean | No |
customer | Object containing customer details the merchant already has. These details can be prefilled upon initializing the widget. Only valid details are prefilled. | Object | No |
customer
object:
Parameter | Description | Format | Required |
---|---|---|---|
name | Customer's name. Example: 'Firstname Lastname' | String | No |
email | Customer's email. Example: 'example@email.com' | String | No |
phone | Customer's phone number, containing country code and '+' character. Example: '+441234567890' | String | No |
dateOfBirth | Object containing customer's date of birth. | Object | No |
country | Object containing customer's country code. | Object | No |
dateOfBirth
object:
Parameter | Description | Format | Required |
---|---|---|---|
day | Customer's birth day. | Number, between 1-31 | Yes |
month | Customer's birth month. | Number, between 1-12 | Yes |
year | Customer's birth year. | Number, 4 digits | Yes |
country
object:
Parameter | Description | Format | Required |
---|---|---|---|
value | ISO 3166 2-letter country code associated with the customer. | String, 2-letter, uppercase | Yes |
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)
context
object: An instance of Context
used to create a view.
buttonParams
object:
Parameter | Description | Format | Required |
---|---|---|---|
Radius | Defines the corner radius of the button. Default value: NONE Possible values are:
| Enum | Yes |
Size | Defines the size of the button. Default value: LARGE Possible values are:
| Enum | Yes |
BoxText | Defines 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:
| Enum | Yes |
BoxTextCurrency | Defines the reward currency of the view which is shown under the Revolut Pay button. Default value: GBP Possible values are:
| Enum | No |
BoxTextValue | Defines the reward value, shown under the Revolut Pay button. Default value: HIGH Possible values are:
| Enum | No |
VariantModes | Only used in Kotlin/Java integration. Defines the dark and light theme variants used in different display modes of the device. Values to define are:
| Class | Yes |
lightMode | Defines the style of the button used when device is in the light mode. Default value: Variant.LIGHT Possible values are:
| Enum | Yes |
darkMode | Defines the style of the button used when device is in the dark mode. Default value: Variant.DARK Possible values are:
| Enum | Yes |
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"
/>
Parameter | Description | Format | Required |
---|---|---|---|
revolutPay_Radius | Defines the corner radius of the button. Default value: None Possible values are:
| Enum | Yes |
revolutPay_Size | Defines the size of the button. Default value: Large Possible values are:
| Enum | Yes |
revolutPay_BoxText | Defines 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:
| Enum | Yes |
revolutPay_BoxTextCurrency | Defines the reward currency of the view which is shown under the Revolut Pay button. Default value: GBP Possible values are:
| Enum | No |
revolutPay_BoxTextValue | Defines the reward value, shown under the Revolut Pay button. Default value: High Possible values are:
| Enum | No |
revolutPay_VariantLightTheme | Defines the style of the button used when device is in the light mode. Default value: Light Possible values are:
| Enum | Yes |
revolutPay_VariantDarkTheme | Defines the style of the button used when device is in the dark mode. Default value: Dark Possible values are:
| Enum | Yes |
val bannerParams = PromoBannerParams(
transactionId = "<transactionId>",
currency = "EUR",
paymentAmount = 150,
customer = Customer?
)
val widget = RevolutPayments.revolutPay.providePromotionalBannerWidget(context: Context, bannerParams)
addView(button)
context
object: An instance of Context
used to create a view.
bannerParams
object:
Parameter | Description | Format | Required |
---|---|---|---|
transactionId | The token of the order connected to the promotional offer. caution The Create an order endpoint was updated to a new version and now returns We strongly advise upgrading to the new Create an order endpoint. | String | Yes |
currency | Currency of the order, given with 3-letter currency code (e.g. 'USD'). | Enum | Yes |
paymentAmount | The amount to be paid by the customer, given in the lowest denomination (e.g. cents). | Long | No |
customer | Object containing customer details the merchant already has. These details can be prefilled upon initializing the widget. Only valid details are prefilled. | Object | No |
customer
object:
Parameter | Description | Format | Required |
---|---|---|---|
name | Customer's name. Example: 'Firstname Lastname' | String | No |
email | Customer's email. Example: 'example@email.com' | String | No |
phone | Customer's phone number, containing country code and '+' character. Example: '+441234567890' | String | No |
dateOfBirth | Object containing customer's date of birth. | Object | No |
country | Object containing customer's country code. | Object | No |
dateOfBirth
object:
Parameter | Description | Format | Required |
---|---|---|---|
day | Customer's birth day. | Number, between 1-31 | Yes |
month | Customer's birth month. | Number, between 1-12 | Yes |
year | Customer's birth year. | Number, 4 digits | Yes |
country
object:
Parameter | Description | Format | Required |
---|---|---|---|
value | ISO 3166 2-letter country code associated with the customer. | String, 2-letter, uppercase | Yes |
Check out the following pages for more information about: