PaymentSheet

A drop-in class that presents a bottom sheet to collect and process a customer's payment.

Constructors

Link copied to clipboard
constructor(activity: ComponentActivity, callback: PaymentSheetResultCallback)

Constructor to be used when launching PaymentSheet from a ComponentActivity.

constructor(activity: ComponentActivity, externalPaymentMethodConfirmHandler: ExternalPaymentMethodConfirmHandler, callback: PaymentSheetResultCallback)

Constructor to be used when launching PaymentSheet from a ComponentActivity and external payment methods are specified in your Configuration.

constructor(activity: ComponentActivity, createIntentCallback: CreateIntentCallback, paymentResultCallback: PaymentSheetResultCallback)

Constructor to be used when launching PaymentSheet from a ComponentActivity and intending to create and optionally confirm the PaymentIntent or SetupIntent on your server.

constructor(activity: ComponentActivity, createIntentCallback: CreateIntentCallback, externalPaymentMethodConfirmHandler: ExternalPaymentMethodConfirmHandler, paymentResultCallback: PaymentSheetResultCallback)

Constructor to be used when launching PaymentSheet from a ComponentActivity and intending to create and optionally confirm the PaymentIntent or SetupIntent on your server and external payment methods are specified in your Configuration.

constructor(fragment: Fragment, callback: PaymentSheetResultCallback)

Constructor to be used when launching the payment sheet from a Fragment.

constructor(fragment: Fragment, externalPaymentMethodConfirmHandler: ExternalPaymentMethodConfirmHandler, callback: PaymentSheetResultCallback)

Constructor to be used when launching the payment sheet from a Fragment and external payment methods are specified in your Configuration.

constructor(fragment: Fragment, createIntentCallback: CreateIntentCallback, paymentResultCallback: PaymentSheetResultCallback)

Constructor to be used when launching PaymentSheet from a Fragment and intending to create and optionally confirm the PaymentIntent or SetupIntent on your server.

constructor(fragment: Fragment, createIntentCallback: CreateIntentCallback, externalPaymentMethodConfirmHandler: ExternalPaymentMethodConfirmHandler, paymentResultCallback: PaymentSheetResultCallback)

Constructor to be used when launching PaymentSheet from a Fragment and intending to create and optionally confirm the PaymentIntent or SetupIntent on your server and external payment methods are specified in your Configuration.

Types

Link copied to clipboard
class Address(val city: String? = null, val country: String? = null, val line1: String? = null, val line2: String? = null, val postalCode: String? = null, val state: String? = null) : Parcelable
Link copied to clipboard
Link copied to clipboard
class BillingDetails(address: PaymentSheet.Address? = null, email: String? = null, name: String? = null, phone: String? = null) : Parcelable
Link copied to clipboard
class BillingDetailsCollectionConfiguration(name: PaymentSheet.BillingDetailsCollectionConfiguration.CollectionMode = CollectionMode.Automatic, phone: PaymentSheet.BillingDetailsCollectionConfiguration.CollectionMode = CollectionMode.Automatic, email: PaymentSheet.BillingDetailsCollectionConfiguration.CollectionMode = CollectionMode.Automatic, address: PaymentSheet.BillingDetailsCollectionConfiguration.AddressCollectionMode = AddressCollectionMode.Automatic, attachDefaultsToPaymentMethod: Boolean = false, allowedCountries: Set<String> = emptySet()) : Parcelable

Configuration for how billing details are collected during checkout.

Link copied to clipboard
class Builder(resultCallback: PaymentSheetResultCallback)

Builder to add optional callbacks to PaymentSheet.

Link copied to clipboard
class ButtonThemes(val link: PaymentSheet.ButtonThemes.LinkButtonTheme = LinkButtonTheme.WHITE) : Parcelable

Theme configuration for wallet buttons

Link copied to clipboard

Options to block certain card brands on the client

Link copied to clipboard
class Colors(@ColorInt primary: Int, @ColorInt surface: Int, @ColorInt component: Int, @ColorInt componentBorder: Int, @ColorInt componentDivider: Int, @ColorInt onComponent: Int, @ColorInt onSurface: Int, @ColorInt subtitle: Int, @ColorInt placeholderText: Int, @ColorInt appBarIcon: Int, @ColorInt error: Int) : Parcelable
Link copied to clipboard
object Companion
Link copied to clipboard

Configuration for PaymentSheet

Link copied to clipboard
Link copied to clipboard

Defines a custom payment method type that can be displayed in Payment Element.

Link copied to clipboard
interface FlowController

A class that presents the individual steps of a payment sheet flow.

Link copied to clipboard
class GooglePayConfiguration @JvmOverloads constructor(environment: PaymentSheet.GooglePayConfiguration.Environment, countryCode: String, currencyCode: String? = null, amount: Long? = null, label: String? = null, buttonType: PaymentSheet.GooglePayConfiguration.ButtonType = ButtonType.Pay, additionalEnabledNetworks: List<String> = emptyList()) : Parcelable
Link copied to clipboard

Defines the visual style of icons in Payment Element

Link copied to clipboard
class Insets(startDp: Float, topDp: Float, endDp: Float, bottomDp: Float) : Parcelable
Link copied to clipboard

Contains information needed to render PaymentSheet. The values are used to calculate the payment methods displayed and influence the UI.

Link copied to clipboard

Configuration related to Link.

Link copied to clipboard

Defines the layout orientations available for displaying payment methods in PaymentSheet.

Link copied to clipboard
class PrimaryButton(colorsLight: PaymentSheet.PrimaryButtonColors = PrimaryButtonColors.defaultLight, colorsDark: PaymentSheet.PrimaryButtonColors = PrimaryButtonColors.defaultDark, shape: PaymentSheet.PrimaryButtonShape = PrimaryButtonShape(), typography: PaymentSheet.PrimaryButtonTypography = PrimaryButtonTypography()) : Parcelable
Link copied to clipboard
class PrimaryButtonColors(@ColorInt background: Int?, @ColorInt onBackground: Int, @ColorInt border: Int, @ColorInt successBackgroundColor: Int = PRIMARY_BUTTON_SUCCESS_BACKGROUND_COLOR.toArgb(), @ColorInt onSuccessBackgroundColor: Int = onBackground) : Parcelable
Link copied to clipboard
class PrimaryButtonShape(cornerRadiusDp: Float? = null, borderStrokeWidthDp: Float? = null, heightDp: Float? = null) : Parcelable
Link copied to clipboard
class PrimaryButtonTypography(@FontRes fontResId: Int? = null, fontSizeSp: Float? = null) : Parcelable
Link copied to clipboard
class Shapes(cornerRadiusDp: Float, borderStrokeWidthDp: Float, bottomSheetCornerRadiusDp: Float = cornerRadiusDp) : Parcelable
Link copied to clipboard
class ShopPayConfiguration(val shopId: String, val billingAddressRequired: Boolean = true, val emailRequired: Boolean = true, val shippingAddressRequired: Boolean, val allowedShippingCountries: List<String>, val lineItems: List<PaymentSheet.ShopPayConfiguration.LineItem>, val shippingRates: List<PaymentSheet.ShopPayConfiguration.ShippingRate>) : Parcelable

Configuration related to Shop Pay, which only applies when using wallet buttons.

Link copied to clipboard
class Spacing(spacingDp: Float) : Parcelable
Link copied to clipboard

TermsDisplay controls how mandates and legal agreements are displayed. Use TermsDisplay.NEVER to never display legal agreements. The default setting is TermsDisplay.AUTOMATIC, which causes legal agreements to be shown only when necessary.

Link copied to clipboard
class Typography(sizeScaleFactor: Float, @FontRes fontResId: Int?, custom: PaymentSheet.Typography.Custom) : Parcelable
Link copied to clipboard
class WalletButtonsConfiguration(willDisplayExternally: Boolean = false, val visibility: PaymentSheet.WalletButtonsConfiguration.Visibility = Visibility(), val buttonThemes: PaymentSheet.ButtonThemes = ButtonThemes()) : Parcelable

Configuration for wallet buttons

Functions

Link copied to clipboard
fun presentWithPaymentIntent(paymentIntentClientSecret: String, configuration: PaymentSheet.Configuration? = null)

Present PaymentSheet to process a PaymentIntent.

Link copied to clipboard
fun presentWithSetupIntent(setupIntentClientSecret: String, configuration: PaymentSheet.Configuration? = null)

Present PaymentSheet to process a SetupIntent.