Skip to main content

Clone the repository

🎯 What is Prism?​

Today, integrating multiple payment processors either makes developers running in circles with AI agents to recreate integrations from specs, or developers spending months of engineering effort.

Because every payment processor has diverse APIs, error codes, authentication methods, pdf documents to read, and above all - different behaviour in the actual environment when compared to documented specs. All this rests as tribal or undocumented knowledge making it harder AI agents which are very good at implementing clearly documented specification.

Prism is a stateless, unified connector library for AI agents and Developers to connect with any payment processor.

Prism offers hardened transformation through testing on payment processor environment & iterative bug fixing.

Prism can be embedded in your server application with its wide range of multi-language SDKs, or run as a gRPC microservice

❌ Without Prismβœ… With Prism
πŸ—‚οΈ 100+ different API schemasπŸ“‹ Single unified schema
⏳ In-deterministic agent loops / months of integration work⚑ Deterministic agent loops, hours to integrate
πŸ”— Brittle, provider-specific codeπŸ”“ Portable, provider-agnostic code
🚫 Hard to switch providersπŸ”„ Change providers in 1 line

πŸ€– For AI Assistants​

Use curl to fetch the complete SDK reference:

curl -fsSL https://raw.githubusercontent.com/juspay/hyperswitch-prism/main/llm/llm.txt

This file contains complete SDK documentation including installation, payment operations, error handling, connector configuration, field probe data, and examples for all 100+ connectors.


✨ Features​

  • πŸ”Œ 100+ Connectors β€” Stripe, Adyen, Braintree, PayPal, Worldpay, and more
  • 🌍 Global Coverage β€” Cards, wallets, bank transfers, BNPL, and regional methods
  • πŸš€ Zero Overhead β€” Rust core with native bindings, no overhead
  • πŸ”’ PCI-Compliant by Design β€” Stateless, no data storage

πŸ—οΈ Architecture​

The Prism library is compliant for payment processing by design. It is:

  • Stateless β€” Hence, no PII or PCI data stored
  • Credential free β€” The API keys are never logged nor exposed
  • Payment compliance outsourcing supported β€” You can continue to outsource your PCI compliance to third party vaults, or payment processor without having to handle credit card data.
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Your Application β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Prism Library β”‚
β”‚ (Type-safe, idiomatic interface, Multi-language SDK) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β–Ό β–Ό β–Ό β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Stripe β”‚ β”‚ Adyen β”‚ β”‚ Braintreeβ”‚ β”‚ 50+ more β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Before integrating, read the SDK guide for your language β€” it covers connector authentication configs, required fields per connector, sandbox test cards, status codes, and common runtime pitfalls.

LanguageSDK Integration Guide
Pythonsdk/python/README.md
Node.jssdk/javascript/README.md
Rustsdk/rust

πŸš€ Quick Start​

Install the Prism Library​

Start by installing the library in the language of your choice.

Node.js​

npm install hyperswitch-prism

Python​

pip install hyperswitch-prism

Java/Kotlin​

Add to your pom.xml:

<dependency>
<groupId>io.hyperswitch</groupId>
<artifactId>prism</artifactId>
<version>0.0.4</version>
</dependency>

For detailed installation instructions, see Installation Guide.


Create a Payment Order​

Node.js​

import { PaymentClient, types, IntegrationError, ConnectorError } from 'hyperswitch-prism';

let config: types.ConnectorConfig = {
connectorConfig: {
stripe: {
apiKey: { value: "sk_test_" }
}
}
}

const main = async () => {
try {
let client = new PaymentClient(config)
let request: types.PaymentServiceAuthorizeRequest = {
merchantTransactionId: "authorize_123",
amount: {
minorAmount: 1000, // $10.00
currency: types.Currency.USD,
},
captureMethod: types.CaptureMethod.AUTOMATIC,
paymentMethod: {
card: {
cardNumber: { value: "4111111111111111" },
cardExpMonth: { value: "12" },
cardExpYear: { value: "2050" },
cardCvc: { value: "123" },
cardHolderName: { value: "Test User" },
},
},
authType: types.AuthenticationType.NO_THREE_DS,
address: {},
orderDetails: [],
}
let response: types.PaymentServiceAuthorizeResponse = await client.authorize(request);
switch (response.status) {
case types.PaymentStatus.CHARGED:
console.log("success");
break;
default:
console.error("failed");
}
} catch (e: any) {
if (e instanceof IntegrationError) {
console.error("Error", e);
} else if (e instanceof ConnectorError) {
console.error("Error", e);
} else {
console.error("Error", e);
}
}
}

main()

πŸ”„ Routing between Payment Providers​

Once the basic plumbing is implemented you can leverage Prism's core benefit - switch payment providers by changing one line.

// Routing rule: EUR -> Adyen, USD -> Stripe
const currency = types.Currency.USD;

let stripeConfig: types.ConnectorConfig = {
connectorConfig: {
stripe: {
apiKey: { value: process.env.STRIPE_API_KEY! }
}
}
}

let adyenConfig: types.ConnectorConfig = {
connectorConfig: {
adyen: {
apiKey: { value: process.env.ADYEN_API_KEY! },
merchantAccount: { value: process.env.ADYEN_MERCHANT_ACCOUNT! }
}
}
}

const config = currency === types.Currency.EUR ? adyenConfig : stripeConfig;
const client = new PaymentClient(config);

const request: types.PaymentServiceAuthorizeRequest = {
merchantTransactionId: "order_123",
amount: {
minorAmount: 1000,
currency: currency
},
captureMethod: types.CaptureMethod.AUTOMATIC,
paymentMethod: {
card: {
cardNumber: { value: "4111111111111111" },
cardExpMonth: { value: "12" },
cardExpYear: { value: "2050" },
cardCvc: { value: "123" },
cardHolderName: { value: "Test User" },
},
},
authType: types.AuthenticationType.NO_THREE_DS,
address: {},
orderDetails: [],
};

const response = await client.authorize(request);
console.log(`Payment authorized with ${currency === types.Currency.EUR ? 'Adyen' : 'Stripe'}`);

One integration pattern. Any service category.

No rewriting. No re-architecting. Just swap the client with rules. Each flow uses the same unified schema regardless of the underlying processor's API differences. No custom code per provider.

You can learn more about intelligent routing and smart retries to add more intelligence. It can help configure and gitage diverse payment acceptance setup, as well as improve conversion rates.


πŸ› οΈ Development​

Prerequisites​

  • Rust 1.70+
  • Protocol Buffers (protoc)

Building from Source​

# Clone the repository
git clone https://github.com/orchestratorxplatform/hyperswitch-prism.git
cd hyperswitch-prism

# Build
cargo build --release

# Run tests
cargo test

Reporting Vulnerabilities​

Please report security issues to [email protected].


Built and maintained by OrchestratorX