Revolut Pay Mobile SDK
iOS
doc

iOS 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: Tutorials: 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
environmentDefault 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 error
}
}
)

RevolutPayKit.button method:

ParameterDescriptionFormatRequired
styleContains styling parameters of the button.ObjectYes
returnURLThe URL which Revolut app tries to open upon payment completion.

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 is called upon payment completion or failure. It will always be called, even if the user abandons the payment.

If the result is success, the user has successfully finalized the payment. If the result is failure, you should treat it accordingly.

note
According to your UX guidelines, you might or might not want to ignore the userAbandonedPayment error case, as it is thrown even when the user simply dismisses the web view flow.
Also, consider that the completion might be called with failure even though the payment succeeds afterwards. For example, if the user abandons the payment or polling fails because of an internal reason, they can still pay for the order later. Even though the SDK notified you that payment has failed. To avoid duplicate payments, you can check with your own backend whether the payment for the order was successful and then act accordingly.
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(
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
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.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?