Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add informational banners variants to upsell promotional banner options #82

Merged
merged 2 commits into from
Sep 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 39 additions & 4 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -747,12 +747,20 @@ export interface UpsellModulePromotionalBannerInstance {
destroy: () => void
}

export interface WidgetUpsellPromotionalBannerOptions {
export type WidgetUpsellPromotionalBannerOptions =
| WidgetUpsellPromotionalBannerSignUpBannerOptions
| WidgetUpsellPromotionalBannerInformationalBannerOptions
| WidgetUpsellPromotionalBannerInformationalLinkOptions
| WidgetUpsellPromotionalBannerInformationalIconOptions

export interface WidgetUpsellPromotionalBannerSignUpBannerOptions {
/** Promotional banner which allows your customer to join Revolut and get rewards if applicable */
variant?: 'sign_up'
/** Unique id of transaction user has just performed */
transactionId: string
/** Max cashback amount */
/** Transaction amount */
amount?: number
/** Cashback currency */
/** Transaction currency */
currency: string
/** Prefilled customer details within the banner */
customer?: Partial<CustomerDetails>
Expand All @@ -765,6 +773,33 @@ export interface WidgetUpsellPromotionalBannerOptions {
}
}

export interface WidgetUpsellPromotionalBannerInformationalBannerOptions {
/** Promotional banner with a summary of Revolut Pay benefits, allowing to view more details on click */
variant: 'banner'
/** Checkout amount */
amount?: number
/** Checkout currency */
currency: string
}

export interface WidgetUpsellPromotionalBannerInformationalLinkOptions {
/** Promotional banner displayed as a link, allowing to view Revolut Pay details on click */
variant: 'link'
/** Checkout amount */
amount?: number
/** Checkout currency */
currency: string
}

export interface WidgetUpsellPromotionalBannerInformationalIconOptions {
/** Promotional banner displayed as an icon, allowing to view Revolut Pay details on click */
variant: 'icon'
/** Checkout amount */
amount?: number
/** Checkout currency */
currency: string
}

export interface UpsellModuleEnrollmentConfirmationBannerInstance {
mount: (
target: string | HTMLElement,
Expand All @@ -783,7 +818,7 @@ export interface WidgetUpsellEnrollmentConfirmationBannerOptions {
/** Whether promotional banner should be shown if user has not enrolled */
promotionalBanner?: boolean
/** Style object for promotional banner customisation */
promotionalBannerStyle?: WidgetUpsellPromotionalBannerOptions['style']
promotionalBannerStyle?: WidgetUpsellPromotionalBannerSignUpBannerOptions['style']
}

export interface RevolutUpsellModuleOptions {
Expand Down
Loading