# Product Overview

### 🎯 What is Prism?

**One integration. Any payment processor. Zero lock-in.**

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                        |
| ------------------------------------------------------ | ----------------------------------- |
| 🗂️ 60+ different API schemas                          | 📋 Single unified schema            |
| ⏳ Never ending agent loops/ months of integration work | ⚡ Hours to integrate, Agent driven  |
| 🔗 Brittle, provider-specific code                     | 🔓 Portable, provider-agnostic code |
| 🚫 Hard to switch providers                            | 🔄 Change providers in 1 line       |

***

### ✨ Features

* **🔌 60+ 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│           │ 60+ more │
   └──────────┘           └──────────┘           └──────────┘           └──────────┘
```

***

### 🚀 Quick Start

#### Install the Prism Library

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

**Node.js**

```bash
npm install hyperswitch-prism
```

**Python**

```bash
pip install hyperswitch-prism
```

**Java**

Add to your `pom.xml`:

```xml
<dependency>
    <groupId>com.juspay.hyperswitch</groupId>
    <artifactId>hyperswitch-prism</artifactId>
    <version>1.0.0</version>
</dependency>
```

**PHP**

```bash
composer require juspay/hyperswitch-prism
```

For detailed installation instructions, see [Installation Guide](https://docs.hyperswitch.io/integrations/prism/prism/installation).

***

#### Authorize a Payment

**Node.js**

```javascript
const { PaymentClient } = require('hyperswitch-prism');
const types = require('hyperswitch-prism').types;

async function main() {
  // Configure Stripe client (Primary payment processor)
  const stripeConfig = {
    connectorConfig: {
      stripe: { apiKey: { value: process.env.STRIPE_API_KEY } }
    }
  };
  const stripeClient = new PaymentClient(stripeConfig);

  // Configure Adyen client (Secondary payment processor)
  const adyenConfig = {
    connectorConfig: {
      adyen: {
        apiKey: { value: process.env.ADYEN_API_KEY },
        merchantAccount: process.env.ADYEN_MERCHANT_ACCOUNT
      }
    }
  };
  const adyenClient = new PaymentClient(adyenConfig);

  // Authorize a payment
  const auth = await stripeClient.authorize({
    merchantTransactionId: 'order-123',
    amount: {
      minorAmount: 1000,
      currency: types.Currency.USD
    },
    paymentMethod: {
      card: {
        cardNumber: { value: '4242424242424242' },
        cardExpMonth: { value: '12' },
        cardExpYear: { value: '2027' },
        cardCvc: { value: '123' },
        cardHolderName: { value: 'Jane Doe' }
      }
    },
    captureMethod: types.CaptureMethod.AUTOMATIC,
    address: { billingAddress: {} },
    authType: types.AuthenticationType.NO_THREE_DS,
    returnUrl: "https://example.com/return"
  });
  console.log('Transaction ID:', auth.connectorTransactionId);
  console.log('Status:', auth.status);
}

main().catch(console.error);
```

***

### 🔄 Routing between Payment Providers

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

```javascript
const { PaymentClient } = require('hyperswitch-prism');
const types = require('hyperswitch-prism').types;

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

const auth = await client.authorize({
  merchantTransactionId: 'order-123',
  amount: {
    minorAmount: 1000,
    currency: currency
  },
  paymentMethod: {
    card: {
      cardNumber: { value: '4242424242424242' },
      cardExpMonth: { value: '12' },
      cardExpYear: { value: '2027' },
      cardCvc: { value: '123' },
      cardHolderName: { value: 'Jane Doe' }
    }
  },
  captureMethod: types.CaptureMethod.AUTOMATIC,
  address: { billingAddress: {} },
  authType: types.AuthenticationType.NO_THREE_DS,
  returnUrl: "https://example.com/return"
});

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](https://docs.hyperswitch.io/explore-hyperswitch/workflows/intelligent-routing) and [smart retries](https://docs.hyperswitch.io/explore-hyperswitch/workflows/smart-retries) to add more intelligence. It can help configure and manage diverse payment acceptance setup, as well as improve conversion rates.

***

### 🛠️ Development

#### Prerequisites

* Rust 1.70+
* Protocol Buffers (protoc)

#### Building from Source

```bash
# Clone the repository
git clone https://github.com/manojradhakrishnan/connector-service.git
cd connector-service

# Build
cargo build --release

# Run tests
cargo test
```

***

#### Reporting Vulnerabilities

Please report security issues to <security@juspay.in>.

***

Built and maintained by [Juspay hyperswitch](https://hyperswitch.io)
