Package-level declarations

Types

Link copied to clipboard
data class AddressSpec(val apiPath: IdentifierSpec = IdentifierSpec.Generic("billing_details[address]"), val allowedCountryCodes: Set<String> = CountryUtils.supportedBillingCountries, val displayFields: Set<DisplayField> = emptySet(), val showLabel: Boolean = true, val type: AddressType = AddressType.Normal(), val hideCountry: Boolean = false) : FormItemSpec, Parcelable
Link copied to clipboard
data class AffirmHeaderElement(val identifier: IdentifierSpec, val controller: Controller? = null) : FormElement
Link copied to clipboard
data class AffirmTextSpec(val apiPath: IdentifierSpec = IdentifierSpec.Generic("affirm_header")) : FormItemSpec

Header that displays promo information about Affirm

Link copied to clipboard
data class AfterpayClearpayHeaderElement(val identifier: IdentifierSpec, val controller: Controller? = null) : FormElement
Link copied to clipboard
data class AfterpayClearpayTextSpec(val apiPath: IdentifierSpec = IdentifierSpec.Generic("afterpay_text")) : FormItemSpec

Header that displays information about installments for Afterpay

Link copied to clipboard

A text field configuration for an AU bank account number

Link copied to clipboard
data class AuBankAccountNumberSpec(val apiPath: IdentifierSpec = IdentifierSpec.Generic( "au_becs_debit[account_number]" )) : FormItemSpec
Link copied to clipboard
data class AuBecsDebitMandateTextElement(val identifier: IdentifierSpec, val merchantName: String?, val controller: InputController? = null) : FormElement

This is an element that has static text because it takes no user input, it is not outputted from the list of form field values. If the stringResId contains a %s, the first one will be populated in the form with the merchantName parameter.

Link copied to clipboard
data class AuBecsDebitMandateTextSpec(val apiPath: IdentifierSpec = IdentifierSpec.Generic("au_becs_mandate")) : FormItemSpec
Link copied to clipboard
Link copied to clipboard
class BlikElement(val identifier: IdentifierSpec = IdentifierSpec.BlikCode, val controller: InputController = SimpleTextFieldController( textFieldConfig = BlikConfig() )) : SectionSingleFieldElement
Link copied to clipboard

A text field configuration for a BSB number, or Bank State Branch Number, a six-digit number used to identify the individual branch of an Australian financial institution

Link copied to clipboard
Link copied to clipboard
data class BsbSpec(val apiPath: IdentifierSpec = IdentifierSpec.Generic( "au_becs_debit[bsb_number]" )) : FormItemSpec
Link copied to clipboard
@Serializable
enum Capitalization : Enum<Capitalization>
Link copied to clipboard
class CardBillingAddressElement(identifier: IdentifierSpec, rawValuesMap: Map<IdentifierSpec, String?> = emptyMap(), countryCodes: Set<String> = emptySet(), countryDropdownFieldController: DropdownFieldController = DropdownFieldController( CountryConfig(countryCodes), rawValuesMap[IdentifierSpec.Country] ), sameAsShippingElement: SameAsShippingElement?, shippingValuesMap: Map<IdentifierSpec, String?>?, collectionMode: BillingDetailsCollectionConfiguration.AddressCollectionMode = BillingDetailsCollectionConfiguration.AddressCollectionMode.Automatic) : AddressElement

This is a special type of AddressElement that removes fields from the address based on the country. It is only intended to be used with the card payment method.

Link copied to clipboard
class CardDetailsSectionController(cardAccountRangeRepositoryFactory: CardAccountRangeRepository.Factory, initialValues: Map<IdentifierSpec, String?>, collectName: Boolean = false, cbcEligibility: CardBrandChoiceEligibility = CardBrandChoiceEligibility.Ineligible) : SectionFieldErrorController
Link copied to clipboard
class CardDetailsSectionElement(cardAccountRangeRepositoryFactory: CardAccountRangeRepository.Factory, initialValues: Map<IdentifierSpec, String?>, collectName: Boolean = false, cbcEligibility: CardBrandChoiceEligibility = CardBrandChoiceEligibility.Ineligible, val identifier: IdentifierSpec, val controller: CardDetailsSectionController = CardDetailsSectionController( cardAccountRangeRepositoryFactory = cardAccountRangeRepositoryFactory, initialValues = initialValues, collectName = collectName, cbcEligibility = cbcEligibility, )) : FormElement
Link copied to clipboard
data class CashAppPayMandateTextSpec(val apiPath: IdentifierSpec = IdentifierSpec.Generic("cashapp_mandate"), @StringRes val stringResId: Int = R.string.stripe_cash_app_pay_mandate) : FormItemSpec
Link copied to clipboard
data class CountrySpec(val apiPath: IdentifierSpec = IdentifierSpec.Country, val allowedCountryCodes: Set<String> = CountryUtils.supportedBillingCountries) : FormItemSpec

This is the specification for a country field.

Link copied to clipboard
class CvcController(cvcTextFieldConfig: CvcConfig = CvcConfig(), cardBrandFlow: StateFlow<CardBrand>, val initialValue: String? = null, val showOptionalLabel: Boolean = false) : TextFieldController, SectionFieldErrorController
Link copied to clipboard
Link copied to clipboard
@Serializable
enum DisplayField : Enum<DisplayField>
Link copied to clipboard
data class DropdownItemSpec(val apiValue: String? = null, val displayText: String = "Other") : Parcelable
Link copied to clipboard
data class DropdownSpec(val apiPath: IdentifierSpec, val labelTranslationId: TranslationId, val items: List<DropdownItemSpec>) : FormItemSpec
Link copied to clipboard
data class EmailElement(val identifier: IdentifierSpec = IdentifierSpec.Email, val initialValue: String? = "", val controller: TextFieldController = SimpleTextFieldController( EmailConfig(), initialValue = initialValue )) : SectionSingleFieldElement
Link copied to clipboard
data class EmailSpec(val apiPath: IdentifierSpec = IdentifierSpec.Email) : FormItemSpec
Link copied to clipboard
data class EmptyFormElement(val identifier: IdentifierSpec = IdentifierSpec.Generic("empty_form"), val controller: Controller? = null) : FormElement
Link copied to clipboard

This defines an empty form spec. It is not intended to be used when building forms for PaymentSheet. This form solves an issue where {@link CompleteFormFieldValueFilter#filterFlow()} returns null when filtering no elements. If given this EmptyFormSpec, the filtering will view the form as complete. {@link LayoutSpec#create()} is the way to build a form with no elements.

Link copied to clipboard
data class ExternalPaymentMethodSpec(val type: String, val label: String, val lightImageUrl: String, val darkImageUrl: String? = null) : Parcelable

Information for displaying external payment methods (EPMs), delivered in the v1/elements/sessions response.

Link copied to clipboard
class ExternalPaymentMethodsRepository @Inject constructor(errorReporter: ErrorReporter)
Link copied to clipboard

This is used to define each section in the visual form layout specification

Link copied to clipboard
object FormItemSpecSerializer : JsonContentPolymorphicSerializer<FormItemSpec>
Link copied to clipboard

A text field configuration for an IBAN, or International Bank Account Number, as defined in ISO 13616-1.

Link copied to clipboard
data class IbanSpec(val apiPath: IdentifierSpec = IdentifierSpec.Generic("sepa_debit[iban]")) : FormItemSpec
Link copied to clipboard
@Serializable
enum KeyboardType : Enum<KeyboardType>
Link copied to clipboard
data class KlarnaHeaderStaticTextSpec(val apiPath: IdentifierSpec = IdentifierSpec.Generic("klarna_header_text")) : FormItemSpec

This is for the Klarna header

Link copied to clipboard
data class KlarnaMandateTextSpec(val apiPath: IdentifierSpec = IdentifierSpec.Generic("klarna_mandate"), @StringRes val stringResId: Int = R.string.stripe_klarna_mandate) : FormItemSpec
Link copied to clipboard

This is a data representation of the layout of UI fields on the screen.

Link copied to clipboard
Link copied to clipboard
data class MandateTextElement(val identifier: IdentifierSpec, val stringResId: Int, val args: List<String>, val topPadding: Dp = 8.dp, val controller: InputController? = null) : FormElement
Link copied to clipboard
data class MandateTextSpec(val apiPath: IdentifierSpec = IdentifierSpec.Generic("mandate"), @StringRes val stringResId: Int) : FormItemSpec

Mandate text element spec.

Link copied to clipboard
data class NameSpec(val apiPath: IdentifierSpec = IdentifierSpec.Name, val labelTranslationId: TranslationId = TranslationId.AddressName) : FormItemSpec
Link copied to clipboard
data object OTPSpec : FormItemSpec
Link copied to clipboard
data class PhoneSpec(val apiPath: IdentifierSpec = IdentifierSpec.Phone) : FormItemSpec
Link copied to clipboard
data class PlaceholderSpec(val apiPath: IdentifierSpec = IdentifierSpec.Generic("placeholder"), val field: PlaceholderSpec.PlaceholderField = PlaceholderField.Unknown) : FormItemSpec
Link copied to clipboard
abstract class RenderableFormElement(val identifier: IdentifierSpec, val allowsUserInteraction: Boolean) : FormElement
Link copied to clipboard
Link copied to clipboard
data class SaveForFutureUseElement(val initialValue: Boolean, val merchantName: String?) : FormElement

This is an element that will make elements (as specified by identifier) hidden when "save for future" use is unchecked

Link copied to clipboard
@Serializable
@SerialName(value = "next_action_spec")
data class SelectorIcon : Parcelable
Link copied to clipboard
data class SepaMandateTextSpec(val apiPath: IdentifierSpec = IdentifierSpec.Generic("sepa_mandate"), @StringRes val stringResId: Int = R.string.stripe_sepa_mandate) : FormItemSpec

Mandate text element spec.

Link copied to clipboard
data class SharedDataSpec(val type: String, val fields: ArrayList<FormItemSpec> = arrayListOf(), val selectorIcon: SelectorIcon? = null) : Parcelable
Link copied to clipboard
data class SimpleTextSpec(val apiPath: IdentifierSpec, @StringRes val label: Int, val capitalization: Capitalization = Capitalization.None, val keyboardType: KeyboardType = KeyboardType.Ascii, val showOptionalLabel: Boolean = false) : FormItemSpec
Link copied to clipboard
data class StaticTextElement(val identifier: IdentifierSpec, val stringResId: Int, val controller: InputController? = null) : FormElement

This is an element that has static text because it takes no user input, it is not outputted from the list of form field values. If the stringResId contains a %s, the first one will be populated in the form with the merchantName parameter.

Link copied to clipboard
data class StaticTextSpec(val apiPath: IdentifierSpec = IdentifierSpec.Generic("static_text"), @StringRes val stringResId: Int) : FormItemSpec

This is for elements that do not receive user input

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class UpiElement(val controller: InputController = SimpleTextFieldController( textFieldConfig = UpiConfig() )) : SectionSingleFieldElement

Functions

Link copied to clipboard
fun BsbElementUI(enabled: Boolean, element: BsbElement, lastTextFieldIdentifier: IdentifierSpec?)
Link copied to clipboard
Link copied to clipboard
fun H4Text(text: String, modifier: Modifier = Modifier)
Link copied to clipboard
fun HyperlinkedText(text: String, modifier: Modifier = Modifier, color: Color = Color.Unspecified, style: TextStyle = LocalTextStyle.current)
Link copied to clipboard
fun SimpleDialogElementUI(titleText: String, messageText: String?, confirmText: String, dismissText: String, destructive: Boolean = false, onConfirmListener: () -> Unit, onDismissListener: () -> Unit)