# juspay/hyperswitch-prism architecture

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

- Interactive diagram: https://gitdiagram.com/juspay/hyperswitch-prism
- Repository: https://github.com/juspay/hyperswitch-prism

## Overview

The README presents Prism as a stateless payment-connector library: an application uses a unified payment interface, Prism transforms requests for a selected processor, and returns normalized results. This repository also contains broader Hyperswitch server, SDK, and FFI components. The graph emphasizes the documented Prism workflow and shows server and transport components where source-index references support their connections; unsampled connector dispatch details are left unasserted.

Main entry points: [`crates/integrations/connector-integration/src/connectors`](https://github.com/juspay/hyperswitch-prism/tree/main/crates/integrations/connector-integration/src/connectors) (Processor connectors), [`crates/grpc-server/grpc-server/src/server/payments.rs`](https://github.com/juspay/hyperswitch-prism/blob/main/crates/grpc-server/grpc-server/src/server/payments.rs) (Payment handlers), [`crates/grpc-server/grpc-server/src/app.rs`](https://github.com/juspay/hyperswitch-prism/blob/main/crates/grpc-server/grpc-server/src/app.rs) (gRPC server), [`sdk`](https://github.com/juspay/hyperswitch-prism/tree/main/sdk) (Language SDKs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["Client interfaces"]
  node_sdk["Language SDKs"]
  node_ffi["Native FFI client<br/>[index.js]"]
  node_response["Unified payment result<br/>[services.proto]"]
end

subgraph group_api["Payment API"]
  node_grpc["gRPC server<br/>[app.rs]"]
  node_payment_handlers["Payment handlers<br/>[payments.rs]"]
  node_domain_types["Payment domain types<br/>[router_data.rs]"]
end

subgraph group_connectors["Connector execution"]
  node_connectors["Processor connectors"]
  node_webhooks["Webhook transforms<br/>[webhook_utils.rs]"]
end

subgraph group_shared["Shared services"]
  node_http_services["Connector HTTP services<br/>[service.rs]"]
  node_http_client["HTTP client<br/>[http_client.rs]"]
  node_metrics["Metrics services<br/>[otel_metrics.rs]"]
end

node_application(("Merchant application"))
node_processor["Payment processor"]

node_application -->|"calls"| node_sdk
node_sdk -->|"submits payment"| node_connectors
node_connectors -->|"transforms requests"| node_processor
node_processor -->|"returns result"| node_response
node_grpc -->|"registers services"| node_payment_handlers
node_payment_handlers -.->|"uses payment types"| node_domain_types
node_payment_handlers -.->|"dispatches flows"| node_connectors
node_ffi -.->|"invokes native flows"| node_connectors
node_http_services -->|"executes requests"| node_http_client
node_connectors -.->|"handles webhook flows"| node_webhooks
node_grpc -->|"serves metrics"| node_metrics

click node_sdk "https://github.com/juspay/hyperswitch-prism/tree/main/sdk"
click node_ffi "https://github.com/juspay/hyperswitch-prism/blob/main/sdk/node-ffi-client/index.js"
click node_grpc "https://github.com/juspay/hyperswitch-prism/blob/main/crates/grpc-server/grpc-server/src/app.rs"
click node_payment_handlers "https://github.com/juspay/hyperswitch-prism/blob/main/crates/grpc-server/grpc-server/src/server/payments.rs"
click node_domain_types "https://github.com/juspay/hyperswitch-prism/blob/main/crates/types-traits/domain_types/src/router_data.rs"
click node_connectors "https://github.com/juspay/hyperswitch-prism/tree/main/crates/integrations/connector-integration/src/connectors"
click node_webhooks "https://github.com/juspay/hyperswitch-prism/blob/main/crates/integrations/connector-integration/src/webhook_utils.rs"
click node_http_services "https://github.com/juspay/hyperswitch-prism/blob/main/crates/common/external-services/src/service.rs"
click node_http_client "https://github.com/juspay/hyperswitch-prism/blob/main/crates/common/external-services/src/http_client.rs"
click node_metrics "https://github.com/juspay/hyperswitch-prism/blob/main/crates/common/external-services/src/otel_metrics.rs"
click node_response "https://github.com/juspay/hyperswitch-prism/blob/main/crates/types-traits/grpc-api-types/proto/services.proto"

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_sdk,node_ffi,node_response toneBlue
class node_grpc,node_payment_handlers,node_domain_types toneAmber
class node_connectors,node_webhooks toneMint
class node_http_services,node_http_client,node_metrics toneRose
class node_application,node_processor toneIndigo
```

## Components

### Client interfaces

- [Language SDKs](https://github.com/juspay/hyperswitch-prism/tree/main/sdk): `sdk`
- [Native FFI client](https://github.com/juspay/hyperswitch-prism/blob/main/sdk/node-ffi-client/index.js): `sdk/node-ffi-client/index.js`
- [Unified payment result](https://github.com/juspay/hyperswitch-prism/blob/main/crates/types-traits/grpc-api-types/proto/services.proto): `crates/types-traits/grpc-api-types/proto/services.proto`

### Payment API

- [gRPC server](https://github.com/juspay/hyperswitch-prism/blob/main/crates/grpc-server/grpc-server/src/app.rs): `crates/grpc-server/grpc-server/src/app.rs`
- [Payment handlers](https://github.com/juspay/hyperswitch-prism/blob/main/crates/grpc-server/grpc-server/src/server/payments.rs): `crates/grpc-server/grpc-server/src/server/payments.rs`
- [Payment domain types](https://github.com/juspay/hyperswitch-prism/blob/main/crates/types-traits/domain_types/src/router_data.rs): `crates/types-traits/domain_types/src/router_data.rs`

### Connector execution

- [Processor connectors](https://github.com/juspay/hyperswitch-prism/tree/main/crates/integrations/connector-integration/src/connectors): `crates/integrations/connector-integration/src/connectors`
- [Webhook transforms](https://github.com/juspay/hyperswitch-prism/blob/main/crates/integrations/connector-integration/src/webhook_utils.rs): `crates/integrations/connector-integration/src/webhook_utils.rs`

### Shared services

- [Connector HTTP services](https://github.com/juspay/hyperswitch-prism/blob/main/crates/common/external-services/src/service.rs): `crates/common/external-services/src/service.rs`
- [HTTP client](https://github.com/juspay/hyperswitch-prism/blob/main/crates/common/external-services/src/http_client.rs): `crates/common/external-services/src/http_client.rs`
- [Metrics services](https://github.com/juspay/hyperswitch-prism/blob/main/crates/common/external-services/src/otel_metrics.rs): `crates/common/external-services/src/otel_metrics.rs`

### Other components

- **Merchant application**
- **Payment processor**

## Connections

- Merchant application → Language SDKs: calls
- Language SDKs → Processor connectors: submits payment
- Processor connectors → Payment processor: transforms requests
- Payment processor → Unified payment result: returns result
- gRPC server → Payment handlers: registers services (evidence: `crates/grpc-server/grpc-server/src/app.rs`)
- Payment handlers → Payment domain types: uses payment types
- Payment handlers → Processor connectors: dispatches flows
- Native FFI client → Processor connectors: invokes native flows
- Connector HTTP services → HTTP client: executes requests (evidence: `crates/common/external-services/src/service.rs`)
- Processor connectors → Webhook transforms: handles webhook flows
- gRPC server → Metrics services: serves metrics (evidence: `crates/grpc-server/grpc-server/src/app.rs`)
