# stripe/stripe-android architecture

> Architecture diagram of the GitHub repository stripe/stripe-android, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/stripe/stripe-android
- Repository: https://github.com/stripe/stripe-android

## Overview

Stripe Android is a client SDK for building payment experiences, from native payment collection through confirmation and, when required, 3DS authentication. The README also documents low-level Stripe API access and Google Pay support. The graph combines those documented capabilities with source-indexed model, networking, and card-entry components; unsampled module internals are represented at their enclosing paths, and connections without explicit evidence are omitted.

Main entry points: [`paymentsheet/src/main/java/com/stripe/android`](https://github.com/stripe/stripe-android/tree/master/paymentsheet/src/main/java/com/stripe/android) (PaymentSheet), [`payments-model/src/main/java/com/stripe/android/cards/CardNumber.kt`](https://github.com/stripe/stripe-android/blob/master/payments-model/src/main/java/com/stripe/android/cards/CardNumber.kt) (Card Number), [`payments-core/src/main/java/com/stripe/android/Stripe.kt`](https://github.com/stripe/stripe-android/blob/master/payments-core/src/main/java/com/stripe/android/Stripe.kt) (Stripe Client), [`stripe-ui-core/src/main/java/com/stripe/android/uicore/elements/TextFieldController.kt`](https://github.com/stripe/stripe-android/blob/master/stripe-ui-core/src/main/java/com/stripe/android/uicore/elements/TextFieldController.kt) (Payment Fields)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_payment_ui["Payment UI"]
  node_payment_sheet["PaymentSheet"]
  node_field_controller["Payment Fields"]
end

subgraph group_payment_core["Payment Core"]
  node_card_number["Card Number<br/>[CardNumber.kt]"]
  node_card_brand["Card Brands<br/>[CardBrand.kt]"]
  node_account_range["Card Ranges"]
  node_payment_models["Payment Models<br/>[PaymentMethod.kt]"]
  node_stripe_client["Stripe Client<br/>[Stripe.kt]"]
  node_api_repository["API Repository"]
  node_google_pay["Google Pay"]
end

subgraph group_authentication["Authentication"]
  node_three_ds_service["3DS Service"]
  node_three_ds_transaction["3DS Transaction<br/>[Transaction.kt]"]
  node_challenge_ui["Challenge UI"]
end

subgraph group_shared["Shared SDK"]
  node_api_request["API Requests<br/>[ApiRequest.kt]"]
end

node_app(("Merchant App"))
node_customer(("Customer"))
node_stripe_api{{"Stripe API"}}

node_customer -->|"enters payment details"| node_payment_sheet
node_app -->|"presents"| node_payment_sheet
node_payment_sheet -.->|"collects details"| node_field_controller
node_field_controller -.->|"accepts card input"| node_card_number
node_card_number -->|"identifies brand"| node_card_brand
node_card_number -.->|"queries ranges"| node_account_range
node_payment_sheet -->|"confirms payment"| node_stripe_client
node_stripe_client -.->|"uses repository"| node_api_repository
node_api_repository -.->|"creates requests"| node_api_request
node_api_request -->|"sends API request"| node_stripe_api
node_payment_sheet -->|"supports payment"| node_google_pay
node_stripe_client -->|"starts authentication"| node_three_ds_service
node_three_ds_service -->|"creates transaction"| node_three_ds_transaction
node_three_ds_transaction -.->|"presents challenge"| node_challenge_ui

click node_payment_sheet "https://github.com/stripe/stripe-android/tree/master/paymentsheet/src/main/java/com/stripe/android"
click node_field_controller "https://github.com/stripe/stripe-android/blob/master/stripe-ui-core/src/main/java/com/stripe/android/uicore/elements/TextFieldController.kt"
click node_card_number "https://github.com/stripe/stripe-android/blob/master/payments-model/src/main/java/com/stripe/android/cards/CardNumber.kt"
click node_card_brand "https://github.com/stripe/stripe-android/blob/master/payments-model/src/main/java/com/stripe/android/model/CardBrand.kt"
click node_account_range "https://github.com/stripe/stripe-android/blob/master/payments-core/src/main/java/com/stripe/android/cards/CardAccountRangeService.kt"
click node_payment_models "https://github.com/stripe/stripe-android/blob/master/payments-core/src/main/java/com/stripe/android/model/PaymentMethod.kt"
click node_stripe_client "https://github.com/stripe/stripe-android/blob/master/payments-core/src/main/java/com/stripe/android/Stripe.kt"
click node_api_repository "https://github.com/stripe/stripe-android/blob/master/payments-core/src/main/java/com/stripe/android/networking/StripeApiRepository.kt"
click node_api_request "https://github.com/stripe/stripe-android/blob/master/stripe-core/src/main/java/com/stripe/android/core/networking/ApiRequest.kt"
click node_google_pay "https://github.com/stripe/stripe-android/tree/master/payments-core/src/main/java/com/stripe/android/googlepaylauncher"
click node_three_ds_service "https://github.com/stripe/stripe-android/blob/master/3ds2sdk/src/main/kotlin/com/stripe/android/stripe3ds2/service/StripeThreeDs2ServiceImpl.kt"
click node_three_ds_transaction "https://github.com/stripe/stripe-android/blob/master/3ds2sdk/src/main/kotlin/com/stripe/android/stripe3ds2/transaction/Transaction.kt"
click node_challenge_ui "https://github.com/stripe/stripe-android/blob/master/3ds2sdk/src/main/kotlin/com/stripe/android/stripe3ds2/views/ChallengeActivity.kt"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_payment_sheet,node_field_controller toneBlue
class node_card_number,node_card_brand,node_account_range,node_payment_models,node_stripe_client,node_api_repository,node_google_pay toneAmber
class node_three_ds_service,node_three_ds_transaction,node_challenge_ui,node_stripe_api toneMint
class node_api_request toneRose
class node_app,node_customer toneIndigo
```

## Components

### Payment UI

- [PaymentSheet](https://github.com/stripe/stripe-android/tree/master/paymentsheet/src/main/java/com/stripe/android): `paymentsheet/src/main/java/com/stripe/android`
- [Payment Fields](https://github.com/stripe/stripe-android/blob/master/stripe-ui-core/src/main/java/com/stripe/android/uicore/elements/TextFieldController.kt): `stripe-ui-core/src/main/java/com/stripe/android/uicore/elements/TextFieldController.kt`

### Payment Core

- [Card Number](https://github.com/stripe/stripe-android/blob/master/payments-model/src/main/java/com/stripe/android/cards/CardNumber.kt): `payments-model/src/main/java/com/stripe/android/cards/CardNumber.kt`
- [Card Brands](https://github.com/stripe/stripe-android/blob/master/payments-model/src/main/java/com/stripe/android/model/CardBrand.kt): `payments-model/src/main/java/com/stripe/android/model/CardBrand.kt`
- [Card Ranges](https://github.com/stripe/stripe-android/blob/master/payments-core/src/main/java/com/stripe/android/cards/CardAccountRangeService.kt): `payments-core/src/main/java/com/stripe/android/cards/CardAccountRangeService.kt`
- [Payment Models](https://github.com/stripe/stripe-android/blob/master/payments-core/src/main/java/com/stripe/android/model/PaymentMethod.kt): `payments-core/src/main/java/com/stripe/android/model/PaymentMethod.kt`
- [Stripe Client](https://github.com/stripe/stripe-android/blob/master/payments-core/src/main/java/com/stripe/android/Stripe.kt): `payments-core/src/main/java/com/stripe/android/Stripe.kt`
- [API Repository](https://github.com/stripe/stripe-android/blob/master/payments-core/src/main/java/com/stripe/android/networking/StripeApiRepository.kt): `payments-core/src/main/java/com/stripe/android/networking/StripeApiRepository.kt`
- [Google Pay](https://github.com/stripe/stripe-android/tree/master/payments-core/src/main/java/com/stripe/android/googlepaylauncher): `payments-core/src/main/java/com/stripe/android/googlepaylauncher`

### Authentication

- [3DS Service](https://github.com/stripe/stripe-android/blob/master/3ds2sdk/src/main/kotlin/com/stripe/android/stripe3ds2/service/StripeThreeDs2ServiceImpl.kt): `3ds2sdk/src/main/kotlin/com/stripe/android/stripe3ds2/service/StripeThreeDs2ServiceImpl.kt`
- [3DS Transaction](https://github.com/stripe/stripe-android/blob/master/3ds2sdk/src/main/kotlin/com/stripe/android/stripe3ds2/transaction/Transaction.kt): `3ds2sdk/src/main/kotlin/com/stripe/android/stripe3ds2/transaction/Transaction.kt`
- [Challenge UI](https://github.com/stripe/stripe-android/blob/master/3ds2sdk/src/main/kotlin/com/stripe/android/stripe3ds2/views/ChallengeActivity.kt): `3ds2sdk/src/main/kotlin/com/stripe/android/stripe3ds2/views/ChallengeActivity.kt`

### Shared SDK

- [API Requests](https://github.com/stripe/stripe-android/blob/master/stripe-core/src/main/java/com/stripe/android/core/networking/ApiRequest.kt): `stripe-core/src/main/java/com/stripe/android/core/networking/ApiRequest.kt`

### Other components

- **Merchant App**
- **Customer**
- **Stripe API**

## Connections

- Customer → PaymentSheet: enters payment details (evidence: `README.md`)
- Merchant App → PaymentSheet: presents (evidence: `README.md`)
- PaymentSheet → Payment Fields: collects details
- Payment Fields → Card Number: accepts card input
- Card Number → Card Brands: identifies brand (evidence: `payments-model/src/main/java/com/stripe/android/cards/CardNumber.kt`)
- Card Number → Card Ranges: queries ranges (evidence: `payments-core/src/main/java/com/stripe/android/cards/CardAccountRangeService.kt`)
- PaymentSheet → Stripe Client: confirms payment (evidence: `README.md`)
- Stripe Client → API Repository: uses repository (evidence: `payments-core/src/main/java/com/stripe/android/Stripe.kt`)
- API Repository → API Requests: creates requests
- API Requests → Stripe API: sends API request (evidence: `README.md`)
- PaymentSheet → Google Pay: supports payment (evidence: `README.md`)
- Stripe Client → 3DS Service: starts authentication (evidence: `README.md`)
- 3DS Service → 3DS Transaction: creates transaction
- 3DS Transaction → Challenge UI: presents challenge
