Skip to main content

Prerequisites

  • An active Payrails session (see Quick Start)
  • A session init payload with redirect-capable payment methods configured in the Payrails backend
  • Kotlin + Jetpack Compose for rendering the redirect buttons

Steps

1. Initialize a session

2. Discover available redirect methods

Ask the session for redirect payment methods configured by the backend:
Returns an empty list if no redirect methods are configured. Each PayrailsPaymentOption contains:
  • paymentMethodCode — the identifier used to create the button (e.g., "ideal", "bancontact")
  • displayName — a human-readable label from the backend (nullable)

3. Create a redirect button for each method

4. Handle the redirect flow

When the user taps the button, the SDK:
  1. Opens the payment provider’s page in a Custom Tab (or system browser as fallback)
  2. Polls the execution status in the background
  3. Returns the result through the delegate callbacks
No additional handling is needed — the SDK manages the redirect lifecycle, polling, and result delivery automatically.

Session recovery

If the redirect flow is abandoned or remains non-terminal, the SDK follows the same session recovery path as card 3DS redirects. Configure onSessionExpired in Options.redirectSessionLifecycle to enable automatic recovery:
Last modified on September 30, 2026