enrollmentConfirmationBanner()

Display confirmation messaging after checkout to inform customers about their enrollment status in promotional offers. The enrollment confirmation banner shows different messages based on whether the customer successfully enrolled, had an unfinished enrollment attempt, or is eligible for future enrollment.

Key features:

  • Enrollment success confirmation
  • Unfinished enrollment attempt messaging
  • Optional promotional banner for non-enrolled customers
  • Customer data pre-filling
  • Customisable styling
Revolut - Enrollment confirmation banner

Prerequisites

This promotional widget requires Upsell module initialisation.

Use in combination with:

Type signature

UpsellModuleEnrollmentConfirmationBannerInstance.mount(
target: HTMLElement,
options: EnrollmentConfirmationBannerOptions
): EnrollmentConfirmationBannerMethods

interface EnrollmentConfirmationBannerOptions {
orderToken: string
customer?: {
name?: string
email?: string
phone?: string
}
promotionalBanner?: boolean
promotionalBannerStyle?: {
border?: string
borderRadius?: string
backgroundColor?: string
primaryColor?: string
}
}

interface EnrollmentConfirmationBannerMethods {
destroy: () => void
}

Parameters

ParameterDescriptionTypeRequired
targetDOM element where the banner should be mountedHTMLElementYes
optionsConfiguration object for the enrollment confirmation bannerEnrollmentConfirmationBannerOptionsYes

EnrollmentConfirmationBannerOptions interface

ParameterDescriptionTypeRequired
orderTokenThe order token (order.token) associated with the current checkout sessionstringYes
customerPre-fill customer details for enrollment attemptsCustomerDetailsNo
promotionalBannerDisplay promotional banner for non-enrolled customers. Default: falsebooleanNo
promotionalBannerStyleCustomise promotional banner appearancePromotionalBannerStyleNo

Customer details

ParameterDescriptionTypeRequired
nameCustomer's full name (e.g., 'John Doe')stringNo
emailCustomer's email address. Instructions for claiming rewards are sent to this addressstringNo
phoneCustomer's phone number with country code (e.g., '+441234567890'). Pre-filled on banner if providedstringNo

Promotional banner style

ParameterDescriptionTypeRequired
borderCSS border attributes (e.g., '1px solid #000')stringNo
borderRadiusCSS border radius value. Applies to banner and interactive elementsstringNo
backgroundColorCSS background colourstringNo
primaryColorCSS primary colour for brandingstringNo

Return value

EnrollmentConfirmationBannerMethods

interface EnrollmentConfirmationBannerMethods {
destroy: () => void
}

The method returns an EnrollmentConfirmationBannerMethods object containing:

MethodDescriptionType
destroyRemove the banner and clean up resources() => void

How it works

The enrollment confirmation banner displays different messages based on the customer's enrollment status:

  1. Enrollment successful: Shows confirmation that the customer successfully enrolled in the promotional offer
  2. Unfinished enrollment attempt: Informs customers who gave consent but didn't provide valid contact details
  3. Not enrolled (optional): If promotionalBanner: true, displays promotional banner to encourage enrollment

Usage examples

Basic enrollment confirmation

Display enrollment confirmation with minimal configuration:

import RevolutCheckout from '@revolut/checkout'

const orderToken = '<token>'

const { enrollmentConfirmationBanner } = await RevolutCheckout.upsell({
publicToken: process.env.REVOLUT_PUBLIC_KEY,
mode: 'prod'
})

enrollmentConfirmationBanner.mount(
document.getElementById('enrollment-confirmation-banner'),
{
orderToken
}
)

With promotional banner fallback

Show promotional banner for customers who aren't enrolled:

import RevolutCheckout from '@revolut/checkout'

const orderToken = '<token>'

const { enrollmentConfirmationBanner } = await RevolutCheckout.upsell({
publicToken: process.env.REVOLUT_PUBLIC_KEY,
mode: 'prod'
})

enrollmentConfirmationBanner.mount(
document.getElementById('enrollment-confirmation-banner'),
{
orderToken,
promotionalBanner: true, // Show promotional banner for non-enrolled customers
promotionalBannerStyle: {
border: '1px solid #e5e5e5',
borderRadius: '8px',
backgroundColor: '#ffffff',
primaryColor: '#007681'
}
}
)

With customer pre-fill

Pre-fill customer details for unfinished enrollment attempts:

const { enrollmentConfirmationBanner } = await RevolutCheckout.upsell({
publicToken: process.env.REVOLUT_PUBLIC_KEY,
mode: 'prod'
})

enrollmentConfirmationBanner.mount(
document.getElementById('enrollment-confirmation-banner'),
{
orderToken: '<token>',
customer: {
name: 'John Doe',
email: '[email protected]',
phone: '+441234567890'
},
promotionalBanner: true,
promotionalBannerStyle: {
border: '1px solid #e5e5e5',
borderRadius: '8px',
backgroundColor: '#ffffff',
primaryColor: '#007681'
}
}
)

See also

Was this page helpful?