Terminal

class Terminal

The Terminal is the top-level object for the Stripe Terminal SDK.

Use of this SDK is subject to the Stripe Terminal Terms: https://stripe.com/terminal/legal

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Get the currently connected Reader if there is one.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The current configuration of the simulated reader. Change this field to see different behavior.

Functions

Link copied to clipboard
Link copied to clipboard

Cancel an existing SetupIntent.

Link copied to clipboard

Clears the current connection token, saved reader sessions, and any other cached credentials. You can use this method to switch accounts in your app, e.g. to switch between live and test Stripe API keys on your backend.

Link copied to clipboard

Clears the reader display and resets it to the splash screen

Link copied to clipboard

Collects data using the hardware interfaces on the reader.

Link copied to clipboard

Display forms and collect information from customers. Available for BBPOS WisePOS E and Stripe S700.

Link copied to clipboard
fun collectPaymentMethod(intent: PaymentIntent, callback: PaymentIntentCallback, config: CollectPaymentIntentConfiguration = CollectPaymentIntentConfiguration.Builder().build()): Cancelable

Collects a payment method for the given PaymentIntent.

Link copied to clipboard
fun collectRefundPaymentMethod(refundParams: RefundParameters, config: CollectRefundConfiguration = CollectRefundConfiguration.Builder().build(), callback: Callback): Cancelable

Initiates an in-person refund with a given set of RefundParameters by collecting the payment method that is to be refunded.

Link copied to clipboard
fun collectSetupIntentPaymentMethod(intent: SetupIntent, allowRedisplay: AllowRedisplay, config: CollectSetupIntentConfiguration = CollectSetupIntentConfiguration.Builder().build(), callback: SetupIntentCallback): Cancelable

Collects a payment method for a SetupIntent.

Link copied to clipboard
fun confirmPaymentIntent(intent: PaymentIntent, callback: PaymentIntentCallback, config: ConfirmPaymentIntentConfiguration = ConfirmPaymentIntentConfiguration.Builder().build()): Cancelable

Confirm a payment after collecting a payment method succeeds.

Link copied to clipboard

Confirms an in-person refund after the refund payment method has been collected.

Link copied to clipboard

Confirm that your customer intends to set up the current or provided payment method.

Link copied to clipboard
fun connectReader(reader: Reader, config: ConnectionConfiguration, connectionCallback: ReaderCallback)

Attempts to connect to the given reader, with the connection type dependent on config.

Link copied to clipboard

Creates a new PaymentIntent with the given parameters.

Link copied to clipboard

Create a new SetupIntent with the given parameters.

Link copied to clipboard
fun disconnectReader(callback: Callback)

Attempts to disconnect from the currently connected reader.

Link copied to clipboard
@RequiresPermission(anyOf = ["android.permission.ACCESS_COARSE_LOCATION", "android.permission.ACCESS_FINE_LOCATION"])
fun discoverReaders(config: DiscoveryConfiguration, discoveryListener: DiscoveryListener, callback: Callback): Cancelable

Begins discovering readers matching the given DiscoveryConfiguration.

Link copied to clipboard

Simplifies reader discovery and connection by combining both operations into one method. Under the hood, this method first discovers readers using the provided discovery configuration, and if a single reader is found, it proceeds to connect to the reader using the provided connection configuration. Note that this method expects a single reader to be discovered based on the provided config and would fail if more than one reader is found during the discovery step. If either the discovery or connection step fails, the readerCallback will be called with an error. If both steps succeed, the readerCallback will be called with the connected reader, and the terminal's connected status will change to CONNECTED.

Link copied to clipboard

Retrieves current settings from the connected reader.

Link copied to clipboard

Installs a pending update on the reader. The update that will be installed is whatever is currently stored in Reader.availableUpdate. This field can be set either during Terminal.connectReader, or whenever a new update is detected. If the field changes, you will be notified via MobileReaderListener.onReportAvailableUpdate.

Link copied to clipboard

Returns a list of Location objects.

Link copied to clipboard
fun print(printContent: PrintContent, callback: Callback)

Prints the specified content to the connected reader's printer, if available.

Link copied to clipboard
fun processPaymentIntent(intent: PaymentIntent, collectConfig: CollectPaymentIntentConfiguration = CollectPaymentIntentConfiguration.Builder().build(), confirmConfig: ConfirmPaymentIntentConfiguration = ConfirmPaymentIntentConfiguration.Builder().build(), callback: PaymentIntentCallback): Cancelable

Processes a PaymentIntent by collecting a payment method and confirming the intent. This is a convenience method that combines the two-step process of Terminal.collectPaymentMethod collecting a payment method and Terminal.confirmPaymentIntent confirming the payment intent into a single call.

Link copied to clipboard
fun processRefund(refundParams: RefundParameters, collectConfig: CollectRefundConfiguration = CollectRefundConfiguration.Builder().build(), callback: RefundCallback): Cancelable

Processes an in-person refund with a given set of RefundParameters.

Link copied to clipboard
fun processSetupIntent(intent: SetupIntent, allowRedisplay: AllowRedisplay, collectConfig: CollectSetupIntentConfiguration = CollectSetupIntentConfiguration.Builder().build(), callback: SetupIntentCallback): Cancelable

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 Terminal.collectSetupIntentPaymentMethod collecting a payment method and Terminal.confirmSetupIntent confirming the setup intent into a single call.

Link copied to clipboard
fun rebootReader(callback: Callback)

Reboots the currently connected reader.

Link copied to clipboard
fun retrievePaymentIntent(clientSecret: String, callback: PaymentIntentCallback)

Retrieves a PaymentIntent with a client secret.

Link copied to clipboard
fun retrieveSetupIntent(clientSecret: String, callback: SetupIntentCallback)

Retrieves a SetupIntent with a client secret.

Link copied to clipboard

Sets an OfflineListener to the Terminal sdk, through which the application can be notified of the Terminal's transitions between offline and online states. This will replace any previous OfflineListeners that have been registered.

Link copied to clipboard
fun setReaderDisplay(cart: Cart, callback: Callback)

Updates the reader display with transaction information. This method is for display purposes only and has no correlation with what the customer is actually charged. Tax and total are also not automatically calculated and must be set in Cart.

Link copied to clipboard

Changes settings on the connected reader.

Link copied to clipboard

Modifies the visual appearance of the Tap to Pay screen.

Link copied to clipboard

Sets the current implementation of TerminalListener. This will replace any previous TerminalListeners that have been registered.

Link copied to clipboard

Determine whether the mobile device supports a given reader type using a particular discovery configuration.