### onFinishInstallingUpdate Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.callable/-mobile-reader-listener/index.html Called when the reader has finished attempting to install a software update. ```APIDOC ### fun onFinishInstallingUpdate(update: ReaderSoftwareUpdate?, e: TerminalException?) Notifies the application that a reader software update process has completed, providing the update details or an error if one occurred. ``` -------------------------------- ### confirmSetupIntent Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/core/com.stripe.stripeterminal/-terminal/confirm-setup-intent.html Confirms a SetupIntent to finalize the setup of a payment method. A payment method must be attached to the intent before calling this method. ```APIDOC ## fun confirmSetupIntent(intent: SetupIntent, callback: SetupIntentCallback): Cancelable ### Description Confirms that your customer intends to set up the current or provided payment method. Before calling this, ensure a payment method is attached to the SetupIntent, potentially by using `collectSetupIntentPaymentMethod`. ### Parameters - **intent** (SetupIntent) - Required - A SetupIntent object that already has a payment method attached. - **callback** (SetupIntentCallback) - Required - The callback to be invoked when the confirmation process completes. ### Returns - **Cancelable** - An object that allows the operation to be canceled if the SDK is not currently waiting for a network response. ``` -------------------------------- ### fun installAvailableUpdate() Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/core/com.stripe.stripeterminal/-terminal/install-available-update.html Installs a pending update on the connected reader. The update installed is the one currently stored in Reader.availableUpdate. ```APIDOC ## fun installAvailableUpdate() ### Description Installs a pending update on the reader. The update that will be installed is whatever is currently stored in Reader.availableUpdate. When an update is initiated, the reader will become unresponsive until the update is complete. ### Usage - Progress updates are reported via `MobileReaderListener.onReportReaderSoftwareUpdateProgress`. - Completion or failure is reported via `MobileReaderListener.onFinishInstallingUpdate`. - If no reader is connected, a `TerminalException` is thrown. ``` -------------------------------- ### onCreate(application: Application) Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/core/com.stripe.stripeterminal/-terminal-application-delegate/on-create.html Initializes the Terminal application delegate. This method should be called during the application's lifecycle to ensure proper SDK setup. ```APIDOC ## onCreate ### Description Initializes the Stripe Terminal application delegate. This method is annotated with @JvmStatic and must be called with the current Application instance. ### Signature `fun onCreate(application: Application)` ### Parameters - **application** (Application) - The Android Application instance to be used for initialization. ``` -------------------------------- ### onStartInstallingUpdate Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.callable/-mobile-reader-listener/on-start-installing-update.html Callback method invoked when the reader begins installing a required update. ```APIDOC ## fun onStartInstallingUpdate(update: ReaderSoftwareUpdate, cancelable: Cancelable?) ### Description The SDK calls this method to notify the application that the reader has started installing a required update. This process occurs during the `connectReader` flow and is necessary to ensure the reader is properly configured. ### Parameters - **update** (ReaderSoftwareUpdate) - The update object containing details such as the estimated time to complete the installation. - **cancelable** (Cancelable?) - An optional object used to cancel the installation. Note that required updates cannot be canceled without causing a connection failure, and some incremental updates may provide a null value. ``` -------------------------------- ### setCustomer(customer: String?) Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-setup-intent-parameters/-builder/set-customer.html Sets the ID of the Customer this SetupIntent belongs to. If provided, the payment method will be attached to this customer upon successful setup. ```APIDOC ## fun setCustomer(customer: String?): SetupIntentParameters.Builder ### Description Sets the ID of the Customer this SetupIntent belongs to, if one exists. If present, the SetupIntent’s payment method will be attached to the Customer on successful setup. Note that payment methods attached to other Customers cannot be used with this SetupIntent. ### Parameters - **customer** (String?) - Optional - The ID of the Customer to associate with the SetupIntent. ### Returns - **SetupIntentParameters.Builder** - The builder instance for chaining. ``` -------------------------------- ### onFinishInstallingUpdate(update: ReaderSoftwareUpdate?, e: TerminalException?) Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.callable/-mobile-reader-listener/on-finish-installing-update.html Invoked when a reader software update installation process has completed. This method provides the update details and any potential exception encountered during the process. ```APIDOC ## onFinishInstallingUpdate ### Description Called when the terminal has finished installing a `ReaderSoftwareUpdate`. This method notifies the listener of the outcome of the update process. ### Signature `open fun onFinishInstallingUpdate(update: ReaderSoftwareUpdate?, e: TerminalException? = null)` ### Parameters - **update** (`ReaderSoftwareUpdate?`) - The `ReaderSoftwareUpdate` that was installed or failed to be installed. This will be null if the `Reader.availableUpdate` field is null. - **e** (`TerminalException?`) - Any `TerminalException` that was thrown during the installation attempt. This will be null if the update completed successfully. ``` -------------------------------- ### createSetupIntent(params, callback) Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/core/com.stripe.stripeterminal/-terminal/create-setup-intent.html Creates a new SetupIntent with the provided parameters and a callback to handle the result. ```APIDOC ## fun createSetupIntent(params: SetupIntentParameters, callback: SetupIntentCallback) ### Description Creates a new SetupIntent with the given parameters. ### Parameters - **params** (SetupIntentParameters) - Arguments used for creating the resulting SetupIntent. - **callback** (SetupIntentCallback) - The callback invoked when the operation completes. ``` -------------------------------- ### Create a SetupIntent Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/ktx/com.stripe.stripeterminal.ktx/create-setup-intent.html Demonstrates how to call createSetupIntent within a coroutine, handling potential TerminalException errors. ```kotlin try { val setupIntent = terminal.createSetupIntent( SetupIntentParameters.Builder() .setCustomer("cus_123") .build(), createConfiguration ) // Handle successful creation} catch (e: TerminalException) { // Handle creation failure} ``` -------------------------------- ### setCollectionReason(collectionReason) Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-collect-setup-intent-configuration/-builder/index.html Sets the reason for the setup intent. ```APIDOC ## fun setCollectionReason(collectionReason: CollectionReason) ### Description Specifies the reason for the setup intent. ### Parameters - **collectionReason** (CollectSetupIntentConfiguration.CollectionReason) - Required - The reason for collecting the setup intent. ``` -------------------------------- ### discoveryConfiguration Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-easy-connect-configuration/-apps-on-devices-easy-connection-configuration/discovery-configuration.html Retrieves the discovery configuration for the AppsOnDevices connection setup. ```APIDOC ## Property: discoveryConfiguration ### Description Returns the configuration for the discovery process used by AppsOnDevicesEasyConnectionConfiguration. ### Signature `val discoveryConfiguration: DiscoveryConfiguration.AppsOnDevicesDiscoveryConfiguration` ### Returns - **DiscoveryConfiguration.AppsOnDevicesDiscoveryConfiguration** - The specific discovery configuration object for AppsOnDevices. ``` -------------------------------- ### createSetupIntent(params, callback, createConfiguration) Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/core/com.stripe.stripeterminal/-terminal/create-setup-intent.html Creates a new SetupIntent with the provided parameters, a callback, and optional configuration overrides. ```APIDOC ## fun createSetupIntent(params: SetupIntentParameters, callback: SetupIntentCallback, createConfiguration: CreateConfiguration?) ### Description Creates a new SetupIntent with the given parameters and optional configuration overrides. ### Parameters - **params** (SetupIntentParameters) - Arguments used for creating the resulting SetupIntent. - **callback** (SetupIntentCallback) - The callback invoked when the operation completes. - **createConfiguration** (CreateConfiguration?) - The configuration containing optional overrides used when creating this SetupIntent. ``` -------------------------------- ### SetupIntentNextAction.redirectToUrl Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-setup-intent-next-action/redirect-to-url.html Accesses the redirect instructions for a SetupIntent, if available. ```APIDOC ## Property: redirectToUrl ### Description Contains instructions for authenticating by redirecting your customer to another page or application. ### Signature `val redirectToUrl: RedirectUrl?` ### Returns - **RedirectUrl?** - An object containing the redirect details if the next action requires a URL redirection, otherwise null. ``` -------------------------------- ### createSetupIntent Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/core/com.stripe.stripeterminal/-terminal/index.html Create a new SetupIntent with the given parameters. ```APIDOC ## createSetupIntent(params: SetupIntentParameters, callback: SetupIntentCallback, createConfiguration: CreateConfiguration?) ### Description Create a new SetupIntent with the given parameters. ### Parameters - **params** (SetupIntentParameters) - Required - The parameters for the SetupIntent. - **callback** (SetupIntentCallback) - Required - The callback to be invoked when the operation completes. - **createConfiguration** (CreateConfiguration) - Optional - Additional configuration for the creation process. ``` -------------------------------- ### SetupIntentNextAction constructor Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-setup-intent-next-action/-setup-intent-next-action.html Initializes a new instance of SetupIntentNextAction with the specified redirect URL and action type. ```APIDOC ## SetupIntentNextAction ### Description Constructs a new SetupIntentNextAction object to represent the next action required for a SetupIntent. ### Signature `SetupIntentNextAction(redirectToUrl: RedirectUrl?, type: String?)` ### Parameters - **redirectToUrl** (RedirectUrl?) - Optional - The URL to redirect to for the next action. - **type** (String?) - Optional - The type of the next action. ``` -------------------------------- ### Install Stripe Terminal SDK Source: https://github.com/stripe/stripe-terminal-android/blob/master/README.md Add the Stripe Terminal dependency to your build.gradle.kts file. ```kotlin dependencies { implementation("com.stripe:stripeterminal:5.6.0") } ``` -------------------------------- ### Collect Inputs Example Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/ktx/com.stripe.stripeterminal.ktx/collect-inputs.html Demonstrates how to use collectInputs within a coroutine scope and handle potential exceptions. ```kotlin val job = coroutineScope.launch { try { val results = terminal.collectInputs(collectInputsParameters) // Handle successful input collection } catch (e: TerminalException) { // Handle input collection failure }}// Cancelling the job will cancel the collect inputs operationjob.cancel() ``` -------------------------------- ### fun build(): SetupIntentCancellationParameters Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-setup-intent-cancellation-parameters/-builder/build.html Constructs a new SetupIntentCancellationParameters object based on the parameters set in the builder. ```APIDOC ## build() ### Description Constructs and returns a new instance of `SetupIntentCancellationParameters` using the values configured in the `Builder`. ### Signature `fun build(): SetupIntentCancellationParameters` ### Returns - **SetupIntentCancellationParameters**: The configured parameters object. ``` -------------------------------- ### build() Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-setup-intent-cancellation-parameters/-builder/index.html Builds the SetupIntentCancellationParameters instance. ```APIDOC ### Method `build(): SetupIntentCancellationParameters` Constructs and returns a `SetupIntentCancellationParameters` object based on the configured properties. ``` -------------------------------- ### initAppsOnDevices(context: Context, logLevel: LogLevel) Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/handoffclient/com.stripe.stripeterminal.appsondevices/-apps-on-devices/-companion/init-apps-on-devices.html Initializes the Apps on Devices SDK for the given context. ```APIDOC ## initAppsOnDevices ### Description Initializes the Apps on Devices SDK for the given context. This method must be called to prepare the SDK for use within the Android application. ### Signature `@JvmStatic fun initAppsOnDevices(context: Context, logLevel: LogLevel = LogLevel.NONE)` ### Parameters - **context** (Context) - Required - The Context of the running Android application. - **logLevel** (LogLevel) - Optional - The level of logging verbosity to use in this SDK instance (defaults to LogLevel.NONE). ``` -------------------------------- ### SetupIntentParameters.Builder() Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-setup-intent-parameters/-builder/-builder.html Initializes a new instance of the SetupIntentParameters.Builder class. ```APIDOC ## SetupIntentParameters.Builder() ### Description Creates a new instance of the `SetupIntentParameters.Builder` class, which is used to configure and build `SetupIntentParameters` objects for Stripe Terminal operations. ### Signature `public Builder()` ``` -------------------------------- ### Collect Payment Method Example Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/ktx/com.stripe.stripeterminal.ktx/collect-payment-method.html Demonstrates how to use the collectPaymentMethod suspend function within a coroutine scope, including error handling and cancellation. ```kotlin val job = coroutineScope.launch { try { val intentWithPaymentMethod = terminal.collectPaymentMethod(paymentIntent, config) // Handle successful collection } catch (e: TerminalException) { // Handle collection failure }}// Cancelling the job will cancel the collect operationjob.cancel() ``` -------------------------------- ### Retrieve a SetupIntent Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/ktx/com.stripe.stripeterminal.ktx/retrieve-setup-intent.html Demonstrates how to call retrieveSetupIntent within a try-catch block to handle potential TerminalException errors. ```kotlin try { val setupIntent = terminal.retrieveSetupIntent("seti_123_secret_456") // Handle successful retrieval} catch (e: TerminalException) { // Handle retrieval failure} ``` -------------------------------- ### onReportAvailableUpdate(update: ReaderSoftwareUpdate) Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.callable/-mobile-reader-listener/on-report-available-update.html This method is invoked by the SDK when a reader software update is available. It is required for Bluetooth and USB readers and should be handled to inform the user or trigger an update installation. ```APIDOC ## onReportAvailableUpdate ### Description Notifies the application that a software update is available for the connected reader. This method is required for Bluetooth and USB readers and should be handled to initiate the update process via `Terminal.installAvailableUpdate`. ### Signature `open fun onReportAvailableUpdate(update: ReaderSoftwareUpdate)` ### Parameters - **update** (ReaderSoftwareUpdate) - The update object containing details such as `estimatedUpdateTime` and `requiredAt` to help manage the update lifecycle. ``` -------------------------------- ### val setupIntent: SetupIntent? Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.api/-api-error/setup-intent.html Retrieves the SetupIntent associated with the API error, if applicable. ```APIDOC ## setupIntent ### Description Returns the `SetupIntent` object if the current `ApiError` is related to a `SetupIntent`. If the error is not related to a `SetupIntent`, this property returns `null`. ### Property Signature `val setupIntent: SetupIntent?` ### Return Type - **SetupIntent?** - The associated SetupIntent object, or null if not applicable. ``` -------------------------------- ### SetupIntentCancellationParameters.Builder() Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-setup-intent-cancellation-parameters/-builder/-builder.html Initializes a new instance of the SetupIntentCancellationParameters.Builder class. ```APIDOC ## Constructor: SetupIntentCancellationParameters.Builder() ### Description Creates a new instance of the `Builder` class, which is used to construct `SetupIntentCancellationParameters` objects. ### Signature `public Builder()` ``` -------------------------------- ### Process a SetupIntent using Kotlin Coroutines Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/ktx/com.stripe.stripeterminal.ktx/process-setup-intent.html Demonstrates how to call processSetupIntent within a coroutine scope and handle potential exceptions. ```kotlin val job = coroutineScope.launch { try { val processedIntent = terminal.processSetupIntent( setupIntent, AllowRedisplay.ALWAYS, collectConfig ) // Handle successful processing } catch (e: TerminalException) { // Handle processing failure }}// Cancelling the job will cancel the setup processing operationjob.cancel() ``` -------------------------------- ### abstract fun readData(completion: ExternalUsbChannel.DataCompletionCallback) Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-external-usb-channel/read-data.html Reads data from the external channel. This method is called once by the SDK to start the data reading process. The integration is responsible for continuously reading data from the USB channel and forwarding it to the SDK via the provided DataCompletionCallback until the channel is disconnected. ```APIDOC ## readData ### Description Reads data from the external channel. Called once from the SDK to start reading data from the reader. The integration should continuously read data from the Usb channel and forward it to the SDK via the DataCompletionCallback, this should continue until the channel is no longer connected. ### Signature `abstract fun readData(completion: ExternalUsbChannel.DataCompletionCallback)` ### Parameters - **completion** (ExternalUsbChannel.DataCompletionCallback) - Required - The callback used to forward data read from the USB channel to the SDK. ``` -------------------------------- ### Initialize Dokka Theme Configuration Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/index.html Handles the initial theme selection for the documentation site based on local storage or system preferences. ```javascript var pathToRoot = ""; document.documentElement.classList.replace("no-js","js"); const storage = localStorage.getItem("dokka-dark-mode") if (storage == null) { const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches if (osDarkSchemePreferred === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } else { const savedDarkMode = JSON.parse(storage) if(savedDarkMode === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } ``` -------------------------------- ### SetupIntentParameters.Builder Methods Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-setup-intent-parameters/-builder/index.html Methods available on the Builder class to configure SetupIntent parameters. ```APIDOC ## Builder() ### Description Initializes a new instance of the SetupIntentParameters.Builder. ## build() ### Description Creates a final instance of SetupIntentParameters with the parameters that have been set with this builder. ## setCustomer(customer: String?) ### Description Set the ID of the Customer this SetupIntent belongs to, if one exists. ## setDescription(description: String?) ### Description Set an arbitrary string attached to the object. Often useful for displaying to users. ## setMetadata(metadata: Map?) ### Description Set of key-value pairs that you can attach to an object. ## setOnBehalfOf(onBehalfOf: String?) ### Description The Stripe account ID for which this SetupIntent is created. ## setPaymentMethodTypes(paymentMethodTypes: List) ### Description The list of payment method types (e.g. card_present) that this SetupIntent is allowed to set up. The default value is PaymentMethodType.CARD_PRESENT. ## setUsage(usage: String?) ### Description Indicates how the payment method is intended to be used in the future. ``` -------------------------------- ### Confirming a SetupIntent with Coroutines Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/ktx/com.stripe.stripeterminal.ktx/confirm-setup-intent.html Demonstrates how to use confirmSetupIntent within a coroutine scope, including error handling and automatic cancellation support. ```kotlin val job = coroutineScope.launch { try { val confirmedIntent = terminal.confirmSetupIntent(setupIntent) // Handle successful confirmation } catch (e: TerminalException) { // Handle confirmation failure }}// Cancelling the job will cancel the confirm operationjob.cancel() ``` -------------------------------- ### build() Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-tap-to-pay-ux-configuration/-color-scheme/-builder/build.html Creates a ColorScheme instance with the provided configuration. ```APIDOC ## build() ### Description Creates a `ColorScheme` instance with the configuration previously set on the `Builder`. ### Signature `fun build(): TapToPayUxConfiguration.ColorScheme` ### Returns - **TapToPayUxConfiguration.ColorScheme** - The configured color scheme object. ``` -------------------------------- ### build() Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-setup-intent-parameters/-builder/build.html Creates a final instance of SetupIntentParameters with the parameters that have been set with this builder. ```APIDOC ### Method `fun build(): SetupIntentParameters` ### Description Creates a final instance of `SetupIntentParameters` with the parameters that have been set with this builder. ### Returns - **SetupIntentParameters** - A configured instance of `SetupIntentParameters`. ``` -------------------------------- ### onSuccess(setupIntent: SetupIntent) Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.callable/-setup-intent-callback/on-success.html This method is invoked when an SDK operation involving a SetupIntent completes successfully. ```APIDOC ## onSuccess ### Description This method is called after the successful completion of an SDK method. It provides the resulting SetupIntent object. ### Signature `abstract fun onSuccess(setupIntent: SetupIntent)` ### Parameters - **setupIntent** (SetupIntent) - The SetupIntent object resulting from the SDK method call. ``` -------------------------------- ### processSetupIntent Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/ktx/com.stripe.stripeterminal.ktx/index.html Processes a SetupIntent on the connected reader. ```APIDOC ## suspend fun Terminal.processSetupIntent(intent: SetupIntent, allowRedisplay: AllowRedisplay, collectConfig: CollectSetupIntentConfiguration = CollectSetupIntentConfiguration.Builder().build()): SetupIntent ### Description Processes a SetupIntent to collect payment method details. ### Parameters - **intent** (SetupIntent) - Required - The SetupIntent to process. - **allowRedisplay** (AllowRedisplay) - Required - Configuration for redisplay. - **collectConfig** (CollectSetupIntentConfiguration) - Optional - Configuration for collecting setup details. ``` -------------------------------- ### processSetupIntent Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/core/com.stripe.stripeterminal/-terminal/index.html Processes a SetupIntent by collecting a payment method and confirming the intent. ```APIDOC ## processSetupIntent(intent, allowRedisplay, collectConfig, callback) ### Description Processes a SetupIntent by collecting a setup intent payment method and confirming the intent. This is a convenience method that combines the two-step process of collecting a payment method and confirming the setup intent into a single call. ### Parameters - **intent** (SetupIntent) - Required - **allowRedisplay** (AllowRedisplay) - Required - **collectConfig** (CollectSetupIntentConfiguration) - Optional - **callback** (SetupIntentCallback) - Required ### Returns - **Cancelable** - An object that can be used to cancel the operation. ``` -------------------------------- ### SetupIntent.paymentMethod Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-setup-intent/payment-method.html Retrieves the full PaymentMethod object associated with the SetupIntent. ```APIDOC ## Property: paymentMethod ### Description Returns the full PaymentMethod object associated with the SetupIntent, if available. ### Signature `val paymentMethod: PaymentMethod?` ### Returns - **PaymentMethod?** - The PaymentMethod object, or null if no payment method is associated with this SetupIntent. ``` -------------------------------- ### fun build(): CollectSetupIntentConfiguration Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-collect-setup-intent-configuration/-builder/build.html Constructs and returns a new CollectSetupIntentConfiguration object based on the parameters set in the builder. ```APIDOC ## build() ### Description Constructs an instance of `CollectSetupIntentConfiguration` using the values configured in the `Builder`. ### Signature `fun build(): CollectSetupIntentConfiguration` ### Returns - **CollectSetupIntentConfiguration** - The configured instance of the setup intent configuration. ``` -------------------------------- ### init() Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/core/com.stripe.stripeterminal/-terminal/-companion/index.html Initializes the Stripe Terminal SDK with the provided context, log level, token provider, and listeners. ```APIDOC ### Method fun init(context: Context, logLevel: LogLevel = LogLevel.NONE, tokenProvider: ConnectionTokenProvider, listener: TerminalListener, offlineListener: OfflineListener?) fun init(context: Context, logLevel: LogLevel = LogLevel.NONE, tokenProvider: ConnectionTokenProvider, listener: TerminalListener, offlineListener: OfflineListener?, localeConfig: LocaleConfig) ### Description Initializes a terminal for the given context. This must be called before interacting with the Terminal instance. ``` -------------------------------- ### build() Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-collect-setup-intent-configuration/-builder/index.html Constructs a new CollectSetupIntentConfiguration instance based on the configured properties. ```APIDOC ## fun build() ### Description Creates and returns a new instance of `CollectSetupIntentConfiguration` using the parameters set on this builder. ### Returns - `CollectSetupIntentConfiguration` - The configured object. ``` -------------------------------- ### val isLiveMode: Boolean Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-setup-intent/is-live-mode.html Returns true if the SetupIntent exists in live mode, or false if it exists in test mode. ```APIDOC ## Property: isLiveMode ### Description Indicates whether the SetupIntent object exists in live mode or test mode. ### Signature `val isLiveMode: Boolean` ### Return Value - **Boolean**: `true` if the object exists in live mode, `false` if the object exists in test mode. ``` -------------------------------- ### retrieveSetupIntent(clientSecret: String, callback: SetupIntentCallback) Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/core/com.stripe.stripeterminal/-terminal/retrieve-setup-intent.html Retrieves a SetupIntent using the provided client secret. This is useful when the SetupIntent is created on your backend server. ```APIDOC ## retrieveSetupIntent(clientSecret: String, callback: SetupIntentCallback) ### Description Retrieves a SetupIntent with a client secret. If the information required to create a SetupIntent isn't readily available in your app, you can create the SetupIntent on your server and use this method to retrieve the SetupIntent in your app. ### Parameters - **clientSecret** (String) - The client secret of the SetupIntent to be retrieved. - **callback** (SetupIntentCallback) - The callback to be called when retrieval completes. ``` -------------------------------- ### SetupIntentParameters.NULL Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-setup-intent-parameters/-companion/-n-u-l-l.html Access the default instance of SetupIntentParameters which contains no specified parameters. ```APIDOC ## SetupIntentParameters.NULL ### Description Returns a default instance of `SetupIntentParameters` with no parameters configured. ### Signature `val NULL: SetupIntentParameters` ``` -------------------------------- ### TapToPayUxConfiguration.Builder() Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-tap-to-pay-ux-configuration/-builder/-builder.html Initializes a new instance of the TapToPayUxConfiguration.Builder class. ```APIDOC ## Builder() ### Description Creates a new instance of the `TapToPayUxConfiguration.Builder` to construct a `TapToPayUxConfiguration` object. ### Signature `public Builder()` ``` -------------------------------- ### collectSetupIntentPaymentMethod Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/core/com.stripe.stripeterminal/-terminal/collect-setup-intent-payment-method.html Collects a payment method for a SetupIntent. If successful, the callback returns a SetupIntent with status REQUIRES_CONFIRMATION, which should then be confirmed using confirmSetupIntent. ```APIDOC ## collectSetupIntentPaymentMethod ### Signature `fun collectSetupIntentPaymentMethod(intent: SetupIntent, allowRedisplay: AllowRedisplay, config: CollectSetupIntentConfiguration = CollectSetupIntentConfiguration.Builder().build(), callback: SetupIntentCallback): Cancelable` ### Description Collects a payment method for a SetupIntent. If collecting a payment method fails, the callback will be called with an error. If successful, the callback will be called with a SetupIntent with status REQUIRES_CONFIRMATION. ### Parameters - **intent** (SetupIntent) - The SetupIntent to which the payment method should be attached. - **allowRedisplay** (AllowRedisplay) - Field to reflect whether this payment method can be shown again to its customer in a checkout flow. - **config** (CollectSetupIntentConfiguration) - An optional configuration to configure per-collection overrides. - **callback** (SetupIntentCallback) - The callback to be invoked when the command completes. ### Returns - **Cancelable** - A handle that allows the operation to be canceled at any time. ``` -------------------------------- ### MotoConfiguration.Builder() Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-moto-configuration/-builder/index.html Initializes a new instance of the MotoConfiguration.Builder. ```APIDOC ### Constructor `Builder()` Creates a new builder instance for configuring MO/TO transaction settings. ``` -------------------------------- ### ScanOptions(scanners, formats, showControls, enableLight, timeout) Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-scan-options/-scan-options.html Initializes a new instance of ScanOptions with the specified configuration parameters. ```APIDOC ## Constructor: ScanOptions ### Description Creates a configuration object for scanning operations within the Stripe Terminal SDK. ### Signature `ScanOptions(scanners: List, formats: Set = setOf(BarcodeFormat.ALL_FORMATS), showControls: Boolean = true, enableLight: Boolean = false, timeout: Duration = 1.minutes)` ### Parameters - **scanners** (List) - Required - A list of available scanners to be used. - **formats** (Set) - Optional - The set of barcode formats to scan for. Defaults to all formats. - **showControls** (Boolean) - Optional - Whether to display UI controls during the scan. Defaults to true. - **enableLight** (Boolean) - Optional - Whether to enable the device light during the scan. Defaults to false. - **timeout** (Duration) - Optional - The duration before the scan operation times out. Defaults to 1 minute. ``` -------------------------------- ### initAppsOnDevices Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/handoffclient/com.stripe.stripeterminal.appsondevices/-apps-on-devices/-companion/index.html Initializes the Apps on Devices SDK for the given context. ```APIDOC ### fun initAppsOnDevices(context: Context, logLevel: LogLevel = LogLevel.NONE) Initializes the Apps on Devices SDK for the given context. This must be called before attempting to access the instance. #### Parameters - **context** (Context) - The application context. - **logLevel** (LogLevel) - Optional. The logging level for the SDK, defaults to LogLevel.NONE. ``` -------------------------------- ### TippingConfiguration.Builder() Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-tipping-configuration/-builder/-builder.html Initializes a new instance of the TippingConfiguration.Builder class. ```APIDOC ### Constructor `TippingConfiguration.Builder()` #### Description Creates a new instance of the `TippingConfiguration.Builder` to configure tipping settings for terminal operations. ``` -------------------------------- ### CollectSetupIntentConfiguration.Builder() Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-collect-setup-intent-configuration/-builder/-builder.html Initializes a new instance of the CollectSetupIntentConfiguration.Builder class. ```APIDOC ## Builder() ### Description Creates a new instance of the `CollectSetupIntentConfiguration.Builder` to construct a `CollectSetupIntentConfiguration` object. ### Signature `public CollectSetupIntentConfiguration.Builder()` ``` -------------------------------- ### retrieveSetupIntent Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/ktx/com.stripe.stripeterminal.ktx/index.html Retrieves a SetupIntent by its secret. ```APIDOC ## suspend fun Terminal.retrieveSetupIntent(secret: String): SetupIntent ### Description Fetches a SetupIntent object from the Stripe API using the provided client secret. ### Parameters - **secret** (String) - Required - The client secret of the SetupIntent. ``` -------------------------------- ### fun build(): MotoConfiguration Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-moto-configuration/-builder/build.html Constructs and returns a new MotoConfiguration instance based on the parameters set in the Builder. ```APIDOC ## fun build() ### Description Constructs a new `MotoConfiguration` object using the values configured in the `MotoConfiguration.Builder`. ### Signature `fun build(): MotoConfiguration` ### Returns - **MotoConfiguration** - The configured instance of `MotoConfiguration`. ``` -------------------------------- ### confirmSetupIntent Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/ktx/com.stripe.stripeterminal.ktx/index.html Confirms a SetupIntent using the Stripe Terminal SDK. ```APIDOC ## suspend fun Terminal.confirmSetupIntent(intent: SetupIntent): SetupIntent ### Description Confirms a SetupIntent object to finalize the setup process. ### Parameters - **intent** (SetupIntent) - The SetupIntent to be confirmed. ``` -------------------------------- ### Terminal.init(context, logLevel, tokenProvider, listener, offlineListener, localeConfig) Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/core/com.stripe.stripeterminal/-terminal/-companion/init.html Initializes the Stripe Terminal instance with the required configuration and listeners. ```APIDOC ## fun init(context: Context, logLevel: LogLevel, tokenProvider: ConnectionTokenProvider, listener: TerminalListener, offlineListener: OfflineListener?, localeConfig: LocaleConfig) ### Description Initializes a terminal for the given context. This method must be called to set up the Terminal instance before performing any operations. ### Parameters - **context** (Context) - The Context of the running Android application. - **logLevel** (LogLevel) - The level of logging verbosity to use in this Terminal instance (default: LogLevel.NONE). - **tokenProvider** (ConnectionTokenProvider) - The provider to use when a new connection token is needed. - **listener** (TerminalListener) - The listener to inform of events in the Terminal lifecycle. - **offlineListener** (OfflineListener?) - The listener to inform of stripe connectivity events and results from forwarded payments made while offline. - **localeConfig** (LocaleConfig) - Configures localization of API error messages. ``` -------------------------------- ### TapToPayUxConfiguration.ColorScheme.Builder() Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-tap-to-pay-ux-configuration/-color-scheme/-builder/-builder.html Initializes a new instance of the Builder class for configuring TapToPayUxConfiguration.ColorScheme. ```APIDOC ## Builder() ### Description Creates a new instance of the `Builder` class to construct a `ColorScheme` object for `TapToPayUxConfiguration`. ### Signature `public Builder()` ``` -------------------------------- ### Create a PaymentIntent Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/ktx/com.stripe.stripeterminal.ktx/create-payment-intent.html Demonstrates how to create a PaymentIntent using PaymentIntentParameters and handle potential TerminalException errors. ```kotlin try { val paymentIntent = terminal.createPaymentIntent( PaymentIntentParameters.Builder() .setAmount(1000) .setCurrency("usd") .build(), createConfiguration ) // Handle successful creation} catch (e: TerminalException) { // Handle creation failure} ``` -------------------------------- ### build() Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-tap-to-pay-ux-configuration/-builder/build.html Constructs a new TapToPayUxConfiguration instance using the configuration defined in the builder. ```APIDOC ### Method `fun build(): TapToPayUxConfiguration` ### Description Creates a `TapToPayUxConfiguration` instance with the configuration provided to the builder. ### Returns - **TapToPayUxConfiguration** - The configured instance of the TapToPayUxConfiguration. ``` -------------------------------- ### UsbDiscoveryConfiguration(timeout: Int, isSimulated: Boolean) Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-discovery-configuration/-usb-discovery-configuration/-usb-discovery-configuration.html Initializes a new configuration for USB device discovery. ```APIDOC ## UsbDiscoveryConfiguration ### Description Initializes a configuration object for discovering USB-connected card readers. ### Signature `UsbDiscoveryConfiguration(timeout: Int = 0, isSimulated: Boolean = false)` ### Parameters - **timeout** (Int) - Optional - The timeout for discovery, in seconds. If the value is 0, discovery will not specify a timeout. - **isSimulated** (Boolean) - Optional - Whether the devices returned by discovery should be simulated. ``` -------------------------------- ### build() Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-confirm-payment-intent-configuration/-builder/index.html Constructs the ConfirmPaymentIntentConfiguration object. ```APIDOC ### Method `build(): ConfirmPaymentIntentConfiguration` Builds and returns the configured ConfirmPaymentIntentConfiguration instance. ``` -------------------------------- ### cancelSetupIntent(setupIntent, params, callback) Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/core/com.stripe.stripeterminal/-terminal/cancel-setup-intent.html Cancels an existing SetupIntent. Upon completion, the provided callback will be triggered with either the updated SetupIntent or an error. ```APIDOC ## fun cancelSetupIntent(setupIntent: SetupIntent, params: SetupIntentCancellationParameters, callback: SetupIntentCallback) ### Description Cancels an existing SetupIntent. If the request succeeds, the callback's onSuccess method is invoked with the updated SetupIntent (status CANCELED); otherwise, onFailure is invoked with an error. ### Parameters - **setupIntent** (SetupIntent) - The existing SetupIntent to be cancelled. - **params** (SetupIntentCancellationParameters) - Details of the cancellation. - **callback** (SetupIntentCallback) - The callback invoked when the operation completes. ``` -------------------------------- ### fun build(): ConfirmPaymentIntentConfiguration Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-confirm-payment-intent-configuration/-builder/build.html Constructs a new ConfirmPaymentIntentConfiguration object based on the parameters set in the Builder. ```APIDOC ## build() ### Description Constructs and returns a new `ConfirmPaymentIntentConfiguration` instance using the values configured in the `Builder`. ### Signature `fun build(): ConfirmPaymentIntentConfiguration` ### Returns - **ConfirmPaymentIntentConfiguration** - The configured instance of the payment intent configuration. ``` -------------------------------- ### Builder() Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-tap-to-pay-ux-configuration/-color-scheme/-builder/index.html Initializes a new instance of the ColorScheme.Builder. ```APIDOC ### Constructor `constructor()` Creates a new instance of the `Builder` class. ``` -------------------------------- ### setReason(reason: SetupIntentCancellationReason?) Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-setup-intent-cancellation-parameters/-builder/set-reason.html Sets an optional reason for canceling a SetupIntent. ```APIDOC ## setReason ### Description Sets an optional reason for canceling a SetupIntent. This method is part of the `SetupIntentCancellationParameters.Builder` class. ### Signature `fun setReason(reason: SetupIntentCancellationReason?): SetupIntentCancellationParameters.Builder` ### Parameters - **reason** (SetupIntentCancellationReason?) - Optional - The reason for canceling the SetupIntent. ### Returns - **SetupIntentCancellationParameters.Builder** - The builder instance for chaining. ``` -------------------------------- ### onSetupIntentForwarded Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.callable/-offline-listener/index.html Invoked when the SDK has finished forwarding all requests associated with a particular SetupIntent. ```APIDOC ### open fun onSetupIntentForwarded(setupIntent: SetupIntent, e: TerminalException?) Invoked when the SDK has finished forwarding - successfully or not - all requests associated with a particular SetupIntent. ``` -------------------------------- ### onSetupIntentForwarded Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.callable/-offline-listener/on-setup-intent-forwarded.html Invoked when the SDK has finished forwarding all requests associated with a particular SetupIntent. ```APIDOC ## open fun onSetupIntentForwarded(setupIntent: SetupIntent, e: TerminalException?) ### Description Invoked when the SDK has finished forwarding - successfully or not - all requests associated with a particular SetupIntent. ### Parameters - **setupIntent** (SetupIntent) - The SetupIntent for which the forwarding completed. - **e** (TerminalException?) - If the forwarding process failed for this specific SetupIntent, the associated error. ``` -------------------------------- ### build() Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-surcharge-configuration/-builder/build.html Constructs a new SurchargeConfiguration instance based on the parameters set in the Builder. ```APIDOC ### Method `fun build(): SurchargeConfiguration` ### Description Creates and returns a new `SurchargeConfiguration` object using the values configured in the current `Builder` instance. ``` -------------------------------- ### setDescription(description: String?) Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-setup-intent-parameters/-builder/set-description.html Sets an arbitrary string description on the SetupIntentParameters.Builder instance. ```APIDOC ## setDescription(description: String?) ### Description Sets an arbitrary string attached to the object. This is often useful for displaying information to users. ### Signature `fun setDescription(description: String?): SetupIntentParameters.Builder` ### Parameters - **description** (String?) - Optional - An arbitrary string to associate with the SetupIntent. ### Returns - **SetupIntentParameters.Builder** - The builder instance for method chaining. ``` -------------------------------- ### SetupIntentUsage.values() Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-setup-intent-usage/values.html Returns an array containing the constants of the SetupIntentUsage enum type, in the order they are declared. ```APIDOC ## SetupIntentUsage.values() ### Description Returns an array containing the constants of the SetupIntentUsage enum type, in the order they are declared. This method is typically used to iterate over all available enum constants. ### Signature `fun values(): Array` ### Returns - **Array** - An array containing the constants of this enum type, in the order they're declared. ``` -------------------------------- ### Front() Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-tap-to-pay-ux-configuration/-tap-zone/-front/index.html Constructor to create a Front tap zone with automatic bias determination. ```APIDOC ### Constructor Front() ### Description Creates a Front tap zone instance where the bias is determined automatically. ``` -------------------------------- ### SetupIntent.usage Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-setup-intent/usage.html The usage property defines the future intent for a payment method. It defaults to OFF_SESSION if not specified. ```APIDOC ## Property: usage ### Description Indicates how the payment method is intended to be used in the future. ### Signature `val usage: SetupIntentUsage?` ### Usage Details - **ON_SESSION**: Use if you intend to only reuse the payment method when the customer is in your checkout flow. - **OFF_SESSION**: Use if your customer may or may not be in your checkout flow. This is the default value if not provided. ``` -------------------------------- ### CardPresentOptions(Boolean?, Boolean?, CardPresentRoutingOptions?, String?, DynamicCurrencyConversionOptions?, CardPresentRequestPartialAuthorization?, CardPresentRequestMulticapture?, CardPresentRequestReauthorization?) Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-card-present-options/-card-present-options.html Initializes a new instance of CardPresentOptions with optional parameters for transaction configuration. ```APIDOC ## Constructor: CardPresentOptions ### Description Initializes a configuration object for card-present payment processing, allowing for the specification of authorization, routing, and currency conversion preferences. ### Parameters - **requestExtendedAuthorization** (Boolean?) - Optional - Whether to request extended authorization. - **requestIncrementalAuthorizationSupport** (Boolean?) - Optional - Whether to request support for incremental authorization. - **routing** (CardPresentRoutingOptions?) - Optional - Routing options for the transaction. - **requestDynamicCurrencyConversion** (String?) - Optional - Request for dynamic currency conversion. - **dynamicCurrencyConversion** (DynamicCurrencyConversionOptions?) - Optional - Configuration for dynamic currency conversion. - **requestPartialAuthorization** (CardPresentRequestPartialAuthorization?) - Optional - Configuration for partial authorization requests. - **requestMulticapture** (CardPresentRequestMulticapture?) - Optional - Configuration for multicapture requests. - **requestReauthorization** (CardPresentRequestReauthorization?) - Optional - Configuration for reauthorization requests. ``` -------------------------------- ### InternetDiscoveryConfiguration Constructor Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-discovery-configuration/-internet-discovery-configuration/index.html Initializes a new configuration for discovering internet-connected readers. ```APIDOC ### Constructor `InternetDiscoveryConfiguration(timeout: Int = 0, location: String? = null, isSimulated: Boolean = false, discoveryFilter: DiscoveryFilter = DiscoveryFilter.None)` ### Description Creates a configuration object to search for internet-connected readers. When used, the SDK retrieves readers from the Stripe API, including both online and offline devices. ### Parameters - **timeout** (Int) - Optional - The discovery timeout in seconds. Defaults to 0 (no timeout). - **location** (String?) - Optional - An optional location ID to scope the discovery of IP-connected readers. - **isSimulated** (Boolean) - Optional - Whether to discover simulated readers. Defaults to false. - **discoveryFilter** (DiscoveryFilter) - Optional - A filter to narrow down the list of discovered readers. Defaults to DiscoveryFilter.None. ``` -------------------------------- ### Builder() Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-confirm-payment-intent-configuration/-builder/index.html Initializes a new instance of the ConfirmPaymentIntentConfiguration.Builder. ```APIDOC ### Constructor `Builder()` Creates a new builder instance to configure payment intent confirmation parameters. ``` -------------------------------- ### val setupFutureUsage: String? Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-payment-intent-parameters/setup-future-usage.html Indicates that you intend to make future payments with this PaymentIntent’s payment method. Providing this parameter will attach the payment method to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. ```APIDOC ## setupFutureUsage ### Description Indicates that you intend to make future payments with this PaymentIntent’s payment method. Providing this parameter will attach the payment method to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be attached to a Customer after the transaction completes. ### Usage When processing card payments, Stripe also uses setup_future_usage to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA. ### Type String? ``` -------------------------------- ### TerminalException.setupIntent Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-terminal-exception/setup-intent.html Retrieves the SetupIntent associated with the exception, if applicable. This property helps determine if a retry is needed or if a different payment method should be collected. ```APIDOC ## val setupIntent: SetupIntent? ### Description Returns the SetupIntent associated with the exception. If the exception is not related to a SetupIntent, this returns null. ### Usage - If the returned SetupIntent has a status of `REQUIRES_PAYMENT_METHOD`, the failure occurred during confirmation. You should call `Terminal.collectSetupIntentPaymentMethod` or `Terminal.processSetupIntent` again with the updated object. - If the returned value is null, the request may have timed out. You should retry the original `Terminal.confirmSetupIntent` call with the original SetupIntent object. ``` -------------------------------- ### Cancel a SetupIntent in Kotlin Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/ktx/com.stripe.stripeterminal.ktx/cancel-setup-intent.html Demonstrates how to cancel a SetupIntent using the suspend extension function, including error handling for TerminalException. ```kotlin try { val cancelledIntent = terminal.cancelSetupIntent( setupIntent, SetupIntentCancellationParameters.Builder().build() ) // Handle successful cancellation} catch (e: TerminalException) { // Handle cancellation failure} ``` -------------------------------- ### fun toDeviceInfo(): DeviceInfo Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-reader/to-device-info.html Converts the current Reader instance into a DeviceInfo object. ```APIDOC ## fun toDeviceInfo() ### Description Converts the current `Reader` instance into a `DeviceInfo` object, providing details about the connected terminal device. ### Signature `fun toDeviceInfo(): DeviceInfo` ### Returns - **DeviceInfo** - An object containing information about the reader device. ``` -------------------------------- ### BluetoothDiscoveryConfiguration(timeout: Int, isSimulated: Boolean) Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-discovery-configuration/-bluetooth-discovery-configuration/-bluetooth-discovery-configuration.html Initializes a new configuration for Bluetooth reader discovery. ```APIDOC ## BluetoothDiscoveryConfiguration(timeout: Int, isSimulated: Boolean) ### Description Creates a configuration object for discovering Bluetooth readers. This configuration is used when initiating the discovery process. ### Parameters - **timeout** (Int) - Optional - The timeout for discovery, in seconds. If the value is 0, discovery will not specify a timeout. Defaults to 0. - **isSimulated** (Boolean) - Optional - Whether the devices returned by discovery should be simulated. Defaults to false. ``` -------------------------------- ### fun build(): CollectRefundConfiguration Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-collect-refund-configuration/-builder/build.html Constructs a new CollectRefundConfiguration object based on the parameters set in the builder. ```APIDOC ## build() ### Description Constructs and returns a new instance of `CollectRefundConfiguration` using the values configured in the `Builder`. ### Signature `fun build(): CollectRefundConfiguration` ### Returns - **CollectRefundConfiguration** - The configured instance of the refund collection configuration. ``` -------------------------------- ### Front() Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-tap-to-pay-ux-configuration/-tap-zone/-front/-front.html Creates a Front tap zone with automatic bias determination. ```APIDOC ### Front() Creates a new instance of a Front tap zone with automatic bias determination. ``` -------------------------------- ### TippingConfiguration.Builder.build() Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-tipping-configuration/-builder/build.html Constructs a new TippingConfiguration object based on the parameters set in the Builder. ```APIDOC ### Method Signature `fun build(): TippingConfiguration` ### Description Creates and returns a new instance of `TippingConfiguration` using the values configured in the `Builder` instance. ### Returns - **TippingConfiguration** - The configured tipping settings object. ``` -------------------------------- ### SetupIntentStatus.values() Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-setup-intent-status/values.html Returns an array containing the constants of the SetupIntentStatus enum type, in the order they are declared. ```APIDOC ## SetupIntentStatus.values() ### Description Returns an array containing the constants of this enum type, in the order they're declared. This method is typically used to iterate over all available SetupIntentStatus constants. ### Signature `fun values(): Array` ### Returns - **Array** - An array containing the constants of this enum type. ``` -------------------------------- ### fun processSetupIntent(intent: SetupIntent, allowRedisplay: AllowRedisplay, collectConfig: CollectSetupIntentConfiguration, callback: SetupIntentCallback): Cancelable Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/core/com.stripe.stripeterminal/-terminal/process-setup-intent.html Processes a SetupIntent by collecting a payment method and confirming the intent. This method returns a Cancelable object to allow operation cancellation. ```APIDOC ## processSetupIntent ### Description Processes a SetupIntent by collecting a setup intent payment method and confirming the intent. This is a convenience method that combines the two-step process of collecting a payment method and confirming the setup intent into a single call. ### Parameters - **intent** (SetupIntent) - The SetupIntent that should be processed. - **allowRedisplay** (AllowRedisplay) - Field to reflect whether this payment method can be shown again to its customer in a checkout flow. - **collectConfig** (CollectSetupIntentConfiguration) - The CollectSetupIntentConfiguration object allows optional per-transaction overrides. Defaults to a default builder configuration. - **callback** (SetupIntentCallback) - The SetupIntentCallback to be invoked when the command completes. ### Returns - **Cancelable** - A Cancelable that allows the operation to be canceled when the SDK is not waiting for a network response. ``` -------------------------------- ### TerminalApplicationDelegate.onCreate Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/core/com.stripe.stripeterminal/-terminal-application-delegate/index.html Initializes the SDK lifecycle awareness by registering it with the Android Application instance. This must be called from the Application class. ```APIDOC ## fun onCreate(application: Application) ### Description Registers the Stripe Terminal SDK with the Android Application lifecycle. This method should be called within the Application's onCreate method to ensure the SDK can react to app lifecycle stages. ### Parameters - **application** (Application) - Required - The Android Application instance. ``` -------------------------------- ### AmountDetails constructor Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-amount-details/-amount-details.html Initializes a new instance of the AmountDetails class with optional tip, surcharge, and donation information. ```APIDOC ## AmountDetails(tip: Tip?, surcharge: SurchargeDetails?, donation: Donation?) ### Description Creates an instance of AmountDetails to hold optional financial breakdown components for a transaction. ### Parameters - **tip** (Tip?) - Optional - The tip amount details. - **surcharge** (SurchargeDetails?) - Optional - The surcharge details. - **donation** (Donation?) - Optional - The donation details. ``` -------------------------------- ### TapToPayConnectionConfiguration(TapUseCase, Boolean, TapToPayReaderListener?, String?) Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-connection-configuration/-tap-to-pay-connection-configuration/-tap-to-pay-connection-configuration.html Initializes a new configuration for Tap to Pay with the specified use case and optional settings. ```APIDOC ## Constructor: TapToPayConnectionConfiguration(useCase, autoReconnectOnUnexpectedDisconnect, tapToPayReaderListener, merchantDisplayName) ### Description Creates a configuration object for Tap to Pay connections. ### Parameters - **useCase** (TapUseCase) - Required - The use case for the Tap to Pay SDK. - **autoReconnectOnUnexpectedDisconnect** (Boolean) - Optional - Whether the terminal should attempt to reconnect on unexpected disconnects (default: true). - **tapToPayReaderListener** (TapToPayReaderListener?) - Optional - Listener for reconnection and disconnect events. - **merchantDisplayName** (String?) - Optional - Cardholder-facing merchant name displayed during card presentation. ``` -------------------------------- ### Below Constructor Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/external/com.stripe.stripeterminal.external.models/-tap-to-pay-ux-configuration/-tap-zone/-below/index.html Initializes a new instance of the Below class to configure the tap zone position. ```APIDOC ## Below(bias: Float) ### Description Creates a configuration where the tap zone is below the screen. The indicator is an arrow pointing down. ### Parameters - **bias** (Float) - Optional - The horizontal bias of the tap zone indicator, as a float between 0 and 1. 0 is to the left of the screen, 1 is to the right. Defaults to 0.5f. ``` -------------------------------- ### Collect SetupIntent Payment Method with Coroutines Source: https://github.com/stripe/stripe-terminal-android/blob/master/docs/ktx/com.stripe.stripeterminal.ktx/collect-setup-intent-payment-method.html Demonstrates how to use the suspend function within a coroutine scope and handle potential TerminalException errors. ```kotlin val job = coroutineScope.launch { try { val intentWithPaymentMethod = terminal.collectSetupIntentPaymentMethod( setupIntent, AllowRedisplay.ALWAYS, config ) // Handle successful collection } catch (e: TerminalException) { // Handle collection failure }}// Cancelling the job will cancel the collect operationjob.cancel() ```