Merchant iOS SDKs
Parameters
doc

Revolut Pay iOS SDK parameters

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

How to integrate the Revolut Pay button

  1. Provide configuration information, such as, your Merchant API Public key and the environment. This step should be done on app launch, in AppDelegate.

    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 iOS SDK requires the public merchant key.

  2. 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).

  3. 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.

Configuration

RevolutPayKit.configure(
with: .init(
merchantPublicKey: "<yourPublicAPIKey>",
environment: .production
)
)

RevolutPayKit.configure method:

ParameterDescriptionFormatRequired
merchantPublicKeyThe merchant's public API key used for authorization.StringYes
environmentThis parameter specifies the environment in which the SDK operates. Default value: .production.

Possible values are:
  • .sandbox
  • .production
EnumYes

Button options

This is an example configuration, showing all possible parameters with example values:

let revolutPayKit = RevolutPayKit()

let button = revolutPayKit.button(
style: .init(size: .large),
returnURL: "${my_app_name}://revolut-pay", // <- Change with your actual return URL
savePaymentMethodForMerchant: true,
shouldRequestShipping: true,
customer: .init(
name: "Firstname Lastname",
dateOfBirth: .init(day: 1, month: 1, year: 1980),
email: "example@email.com",
phone: "+441234567890"
),
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
}
}
)

RevolutPayKit.button method:

ParameterDescriptionFormatRequired
styleContains styling parameters of the button.ObjectYes
returnURLUpon payment completion, the Revolut app tries to open this URL.

Possible values are:
StringYes
savePaymentMethodForMerchantIf true, the customer gives permission to the merchant to use the payment method (Revolut account or card details saved via Revolut Pay) in the future.

The customer only needs to authorise this payment method once, then the merchant can use this payment method to take future payments without further action required from the customer.

This feature is useful when managing recurring payments or setting up scheduled payments in the future.

To learn more about merchant initiated transactions, see: Create Revolut Pay button: Merchant initiated transactions. Default: false.
BooleanNo
shouldRequestShippingIf 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
createOrderCallback function handling the order creation operation executed after the user taps the Revolut Pay button. In this callback:
  1. Your app makes a request to your back end. For more information on backend integration, see: Merchant API: Create an order.
  2. Your backend responds with the orderToken that the user wants to pay for.
  3. Pass the orderToken to the SDK through the createOrderHandler callback parameter. You must always pass a new orderToken, even during the same checkout session!
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.

ClosureYes
completionThe completion closure acts as a callback to manage the outcomes of payment operations initiated by the RevolutPayKit button. The closure is called once the payment process is concluded, covering scenarios of success, failure, or abandonment by the user.

Possible values
  • .success - The payment was successful.
  • .failure - An error occurred during the payment.
  • .userAbandonedPayment - The customer abandoned the payment flow.

Further considerations

The completion closure might indicate a failure even if the user later completes the payment, such as in scenarios where they initially abandon the payment or if there is a transient issue during payment processing. Therefore, it is crucial to verify the final payment status with your backend before concluding that the payment has failed permanently. This helps in avoiding scenarios where a transaction might be unintentionally processed more than once.
ClosureYes

RevolutPayButton.Style object:

ParameterDescriptionFormatRequired
sizeSize of the button, default: .large.

Possible values
  • .large
  • .medium
  • .small
  • .extraSmall
EnumNo
variantsColor schemes for light and dark modes of the phone, default: VariantModes(anyMode: .dark).

Possible values
  • .dark
  • .light
  • .darkOutlined
  • .lightOutlined
ObjectNo
radiusSize of the button's border radius, default: .small.

Possible values
  • .rounded
  • .medium
  • .small
  • .none
EnumNo
attachmentStyleAppearance of the attachment box displayed under the button. Specifies the reward value and currency. Can be initialized with a Text object.

Default value: Text(currency: .gbp, cashbackValue: .value25)
ObjectNo

RevolutPayButton.Style.Text object:

ParameterDescriptionFormatRequired
currencyThe currency displayed in the reward text in ISO 4217 format. Default value: .gbp

Possible values
  • .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
EnumNo
cashbackValueThe maximum reward value in the currency that you specified (e.g. £25). Default value: .value25

Possible values are:
  • .value10
  • .value25
EnumNo

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.GenericDateNo

GenericDate object:

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

To display the button and verify your implementation, see:

Promotional banner options

This is an example configuration, showing all possible parameters with example values:

let promotionalBanner = revolutPayKit.promotionalBanner(
style: .init(
accentColor: .red,
backgroundColor: .white,
bannerCornerRadius: 8,
componentCornerRadius: .circular,
border: .init(
color: .black,
width: 2
)
),
transactionId: "transaction-id",
amount: 10_00,
currency: .EUR,
customer: .init(
name: "Firstname Lastname",
email: "example@email.com",
phone: "+441234567890",
country: .unitedKingdom
)
)

RevolutPayKit.promotionalBanner method:

ParameterDescriptionFormatRequired
styleContains styling parameters of the promotional banner.ObjectNo
transactionIdThe ID of the transaction sent by the merchant corresponding to the promotional offer.StringYes
amountThe amount paid by the customer, given in minor currency unit. For example, €70.34 is represented by the value 70_34.Int64No
currencyThe payment currency in ISO 4217 format.

Possible values
  • .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
EnumYes
customerContains customer details the merchant already has. These details can be prefilled upon initializing the widget. Only valid details are prefilled.ObjectNo

PromotionalBanner.PromotionalBannerStyle object:

ParameterDescriptionFormatRequired
accentColorThe banner's accent colour. Other colours in the banner are derived from this. Default: nilUIColorNo
backgroundColorThe banner's background colour. Default: nil.UIColorNo
bannerCornerRadiusThe corner radius of the banner's view. Default: 16.0CGFloatYes
componentCornerRadiusThe corner radius of the banner's components. Default: .default

Possible values
  • .custom - Requires a CGFLoat value.
  • .circular
  • .default
EnumYes
borderContains styling parameters of the banner's border. Default: nilObjectNo

PromotionalBanner.PromotionalBannerStyle.Border object:

ParameterDescriptionFormatRequired
colorThe banner's border colour. Default: nilUIColorNo
widthThe banner's border width in pixels. Default: 1.0CGFLoatYes

PromotionalBanner.PromotionalBannerCustomer object:

ParameterDescriptionFormatRequired
nameCustomer's name. Example: "Firstname Lastname". Default: nilStringNo
emailCustomer's email. Example: "example@email.com". Default: nilStringNo
phoneCustomer's phone number, containing country code and '+' character. Example: "+441234567890". Default: nilStringNo
countryObject containing the customer's country code. Example: .unitedKingdom. Default: nil

Supported countries
  • .australia
  • .austria
  • .belgium
  • .brazil
  • .bulgaria
  • .canada
  • .croatia
  • .cyprus
  • .czechRepublic
  • .denmark
  • .estonia
  • .finland
  • .france
  • .germany
  • .greece
  • .hongKong
  • .hungary
  • .iceland
  • .india
  • .ireland
  • .italy
  • .japan
  • .kazakhstan
  • .latvia
  • .liechtenstein
  • .lithuania
  • .luxembourg
  • .macau
  • .malta
  • .mexico
  • .monaco
  • .netherlands
  • .newZealand
  • .norway
  • .poland
  • .portugal
  • .romania
  • .singapore
  • .slovakia
  • .slovenia
  • .spain
  • .sweden
  • .switzerland
  • .ukraine
  • .unitedKingdom
  • .usa
  • .vaticanCity
EnumNo
Was this page helpful?