Skip to main content

Status

The Status card displays the user's current Flex status and opens the Embedded Checkout when tapped.

Initialization​

Display the Status card by adding FlexStatusCardView to your layout and binding it.

XML Layout​

Add FlexStatusCardView to your layout file where you want the card to appear.

XML
<com.flex.checkout.components.FlexStatusCardView
android:id="@+id/status_card"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

Binding​

Call bind() on the view reference to connect the card to the Flex SDK. StatusCardConfig takes no options.

import com.flex.checkout.configuration.StatusCardConfig

binding.statusCard.bind(StatusCardConfig())
info

When the Status card CTA is tapped, it will automatically call openCheckout(). Make sure you have registered a token provider with loadToken and configured checkout callbacks with sdk.checkout() before binding the card.

val sdk = Flex.initialize(this, FlexConfig(
clientId = "your-flex-client-id"
))

sdk.loadToken {
val response = yourApi.getFlexToken()
response.token
}

sdk.checkout(CheckoutConfig(
onEvent = { event -> },
))

binding.statusCard.bind(StatusCardConfig())

Next Steps​

  • Configure Checkout callbacks to handle events and errors
  • Review the Installation guide for lifecycle management and error handling