# Test offline payments Simulate network failures to test your offline payments integration without going physically offline. The Terminal SDK includes a `simulatedOfflineModeConfiguration` property that lets you simulate network failures in test mode without physically disconnecting from the internet. Use this to verify your offline payments integration handles connectivity issues correctly. > You can only use `simulatedOfflineModeConfiguration` in test mode. Setting a non-default configuration while connected to a livemode reader throws a `TerminalException` error. ## Before you begin Make sure you: - Have a working [offline payments integration](https://docs.stripe.com/terminal/features/operate-offline/collect-card-payments.md). - Are operating in [test mode](https://docs.stripe.com/terminal/references/testing.md) with a reader. ## Configure simulated offline mode The `SimulatedOfflineModeConfiguration` object has two properties that you can configure independently: - `sdkOfflineMode`: Simulates network failures for calls made by the SDK itself. - `readerOfflineMode`: Simulates network failures for calls made by smart readers with independent connectivity (such as WisePOS E or S700). This property is ignored for Bluetooth and USB readers because all network calls flow through the SDK for those reader types. | Mode | Behavior | | ---------------------- | ------------------------------------------------------------------------------------------------------------------ | | `DISABLED` | Default. No simulation. Uses real network conditions. | | `OFFLINE_IMMEDIATE` | Requests fail instantly with a network error. | | `OFFLINE_TIMEOUT` | Requests hang for 15 seconds then fail. Useful for testing retry and timeout logic. | | `OFFLINE_INTERMITTENT` | Approximately 50% of requests fail randomly. Useful for testing retry behavior and partial connectivity scenarios. | ## Toggle simulated offline mode #### iOS ```swift // Enable simulated offline mode Terminal.shared.simulatedOfflineModeConfiguration = SimulatedOfflineModeConfiguration.fullOffline // Reset to normal network behavior after testing Terminal.shared.simulatedOfflineModeConfiguration = SimulatedOfflineModeConfiguration.default ``` ## Check reader network status The `OfflineStatus` object lets you query the current network status of the SDK and the connected reader. You can read it directly at any time: #### iOS ```swift let networkStatus = Terminal.shared.offlineStatus.sdk.networkStatus ``` Or use the `OfflineDelegate` (iOS) or `OfflineListener` (Android, Java) to receive updates whenever the network status changes: #### iOS ```swift class CustomOfflineDelegate: OfflineDelegate { func terminal(_ terminal: Terminal, didChangeOfflineStatus offlineStatus: OfflineStatus) { let networkStatus = offlineStatus.sdk.networkStatus // Update your UI based on networkStatus } } Terminal.shared.offlineDelegate = CustomOfflineDelegate() ``` ## See also - [Collect card payments while offline](https://docs.stripe.com/terminal/features/operate-offline/collect-card-payments.md) - [Test your Terminal integration](https://docs.stripe.com/terminal/references/testing.md)