Skip to content

[FEATURE] expose payment link integration as wasm packs #10262

@kashif-m

Description

@kashif-m

Problem Statement

Merchants need the ability to quickly customize payment link UI and look-and-feel through the HyperSwitch dashboard.

To enable this, we need to simulate the payment link server-side rendering flow directly in the dashboard, allowing merchants to see real-time previews of their customizations.

This requires exposing the server-side rendering functionality as an isolated, lightweight module that can be consumed by frontend applications without server dependencies.

Feature Description

This feature introduces a WASM-compiled payment link rendering module that enables:

For Users:

  • Real-time preview of payment link customizations in the dashboard
  • Instant feedback when changing themes, layouts, and styling options
  • Ability to validate payment link configurations before deployment

For Developers:

  • Standalone, reusable rendering module that can be integrated into any client application
  • Provides a lightweight, dependency-free way to generate payment link HTML from configuration objects

The module exposes payment link rendering as a WASM function call, accepting configuration parameters and returning rendered HTML - making it ideal for building interactive configurators and preview tools.

Possible Implementation

Current State:
Payment link functionality is tightly coupled with the router crate and domain models, which depend on server-side infrastructure (actix-web, tokio) incompatible with WASM compilation.

Proposed Solution:
Extract payment link rendering into a dedicated payment_link crate containing:

  • Template rendering engine (HTML/CSS/JS generation)
  • Payment link types and configuration models
  • WASM bindings for frontend consumption

This lightweight crate will:

  • Be imported as a dependency by router (maintaining existing functionality)
  • Compile to WASM for use in the dashboard and other client applications
  • Contain only pure rendering logic with minimal dependencies

This way, dashboard can import the WASM module and call rendering functions at runtime, enabling instant payment link previews without server communication.


Have you spent some time checking if this feature request has been raised before?

  • I checked and didn't find a similar issue

Have you read the Contributing Guidelines?

Are you willing to submit a PR?

Yes, I am willing to submit a PR!

Metadata

Metadata

Assignees

Labels

C-featureCategory: Feature request or enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions