Hyperswitch Prism

repository·main·Indexed 23 days ago

https://github.com/juspay/hyperswitch-prism

A stateless, unified connector library that acts as a transformation layer mapping a unified request schema to various payment providers such as Stripe and Adyen. The repository includes a browser-automation-engine (v0.1.0), a JSON-DSL runtime on top of Playwright used for automating tasks like the Google Pay Token Generator for testing payment connectors (Cybersource, Stripe, Adyen, Checkout, Nuvei), and a tracing-kafka library for Kafka-based structured logging.

Tokens
1M
Snippets
1.9K
Records
3.4K
Agent score
79%

What's inside Hyperswitch Prism

  1. Overview of the Dispute Service (Python SDK)

    main

    The Dispute Service allows you to manage the chargeback lifecycle across various payment processors. It is used to track dispute statuses, submit evidence to contest fraudulent claims, and manage the outcomes of bank-led disputes.

    Common Use Cases:

    • E-commerce fraud defense: Submitting proof of delivery or receipts.
    • Service businesses: Providing service documentation and communication records.
    • Subscription disputes: Submitting recurring transaction agreements.
    • Revenue recovery: Defending valid transactions to minimize losses.
  2. What is Hyperswitch Prism?

    main

    Hyperswitch Prism is a stateless, open-source unified connector library designed to act as a translation layer between a single normalized schema and the APIs of various payout processors (80+ supported).

    Instead of writing bespoke integrations for every processor, Prism allows you to write your business logic once against a unified domain model. Adding a new processor only requires implementing a new 'transformer' that maps the Prism schema to the specific processor's API.

    Key Benefits:

    • Unified Schema: Eliminates 'schema chaos' by providing a single source of truth for payout operations.
    • Polyglot Support: Uses UniFFI to generate type-safe SDK bindings (Python, Node.js, Java/Kotlin, Swift) from a single Rust implementation, ensuring logic consistency across languages.
    • Stateless Architecture: Scales horizontally with no coordination overhead and keeps PCI scope narrow by not storing credentials or PII.
  3. Overview of the Merchant Authentication Service (Java SDK)

    main

    The Merchant Authentication Service generates secure, short-lived credentials for accessing payment processor APIs. Instead of storing long-term secrets client-side, you use this service to obtain temporary tokens for specific operations.

    Common Use Cases:

    • Frontend SDKs: Generating tokens for client-side payment flows.
    • Wallet Payments: Initializing sessions for Apple Pay or Google Pay.
    • Session Management: Maintaining secure state throughout a multi-step payment process.
    • Multi-party Payments: Securing delegated access for complex payment scenarios.
  4. Overview of the Recurring Payment Service

    main

    The Recurring Payment Service manages subscription billing and recurring payment mandates. It is designed for automated billing scenarios such as SaaS subscriptions, membership fees, utility billing, installment payments, and donation subscriptions.

    Core Workflow:

    1. Mandate Setup: A customer first sets up a mandate using the Payment Service's SetupRecurring operation.
    2. Automated Charging: This service uses the resulting mandate_reference to process subsequent charges without requiring further customer interaction.
    3. Lifecycle Management: The service handles the full lifecycle, including charging existing mandates and revoking them when a subscription is cancelled.
  5. Overview of Customer Service capabilities

    main

    The Customer Service allows you to create and manage customer profiles at payment processors. Storing customer details with connectors streamlines future transactions and improves authorization rates.

    Key Business Use Cases:

    • E-commerce accounts: Save profiles for faster checkout on return visits.
    • SaaS platforms: Associate customers with subscription payments and billing histories.
    • Recurring billing: Link customers to stored payment methods for automated billing.
    • Fraud prevention: Improve risk scoring accuracy through consistent customer identity.
  6. Overview of the Dispute Service (PHP SDK)

    main

    The Dispute Service PHP SDK allows you to manage the chargeback lifecycle across various payment processors. It is designed to help businesses track dispute statuses, submit evidence to contest fraudulent claims, and manage the financial impact of chargebacks.

    Key Business Use Cases:

    • E-commerce fraud defense: Submitting proof of delivery or receipts to contest illegitimate chargebacks.
    • Service businesses: Providing service documentation and communication records.
    • Subscription disputes: Submitting recurring transaction agreements and cancellation policies.
    • Revenue recovery: Defending valid transactions to minimize losses.
  7. Overview of the Recurring Payment Service (Java SDK)

    main

    The Recurring Payment Service allows you to process subscription billing and manage recurring payment mandates. After a customer has initially set up a mandate, this service enables automated subsequent charges without further customer interaction.

    Common Use Cases:

    • SaaS subscriptions: Monthly or yearly software billing.
    • Membership fees: Recurring dues for organizations.
    • Utility billing: Automated monthly service payments.
    • Installment payments: Scheduled collections for large purchases.
  8. Overview of the Adyen Connector for Medusa

    main

    The Adyen Connector is a React wrapper around Adyen Web v6 (@adyen/adyen-web). It mounts the Adyen Card/Drop-in component using the sessions flow.

    Key behavior: The card is authorized client-side, but the result reaches the Medusa backend only via webhook. Because Adyen does not provide a pollable status API for session payments, webhooks are mandatory for authorization.

  9. Overview of the Refund Service (Python SDK)

    main

    The Refund Service is a specialized component of the Hyperswitch Prism Python SDK designed to track and synchronize refund statuses across various payment processors. While the PaymentService is used to initiate refunds, the RefundService provides the operations necessary to retrieve and monitor their progress.

    Key Use Cases:

    • Refund status tracking: Monitoring pending refunds to update customers.
    • Financial reconciliation: Syncing refund states with internal accounting systems.
    • Webhook processing: Managing asynchronous notifications from processors.
    • Customer service: Providing accurate status data to support teams.