Building a Direct Solana Payment Module for MedusaJS 2: No Middlemen, Just Blockchain
Introducing a Solana payment module for MedusaJS 2 that enables direct blockchain payments-no middlemen, real-time fiat-to-SOL conversion, and enhanced privacy with one-time wallets. Watch the demo and get involved as an early tester!

Most crypto payment solutions available today are built around third-party processors, bringing extra fees, KYC hurdles, and limited control—far from the original DeFi vision of direct, peer-to-peer payments powered by code. This project is about exploring what’s technically possible when you cut out the middleman: a truly decentralized Solana payment module for MedusaJS 2. In this post, I’ll dive into the architecture, share a live demo, and invite you to get involved as an early tester. This is about what crypto was always meant to be—no gatekeepers, just code enabling commerce between two parties.
What's MedusaJS (and why should you care)?
For those unfamiliar, MedusaJS is an open-source headless commerce platform that gives developers complete control over their e-commerce stack. If you want to get started quickly with MedusaJS 2, check out my one-click deploy template it gives you a fully operational MedusaJS webshop in less than 10 minutes.
Why build a Solana payment module?
When people talk about cryptocurrency's potential, they often mention how it enables direct peer-to-peer transactions without intermediaries. Yet ironically, most "crypto payment" solutions still route through third-party processors that:
- Charge substantial fees.
- Require KYC verification.
- Apply geoblocks.
- Offer poor exchange rates.
- Can change terms or block merchants at will.
I wanted to build something that delivers on crypto's original promise—truly direct payments. Here's why Solana made sense:
- Speed and cost: Transactions confirm in seconds and cost fractions of a cent.
- Independence: No reliance on payment processors that can suddenly change terms.
- Resilience: An alternative payment rail if traditional systems are unavailable.
- Because it's cool: Let's be honest, building this was just technically fascinating.
How it works: The payment flow
Here's the sequence diagram showing exactly how payments move through the system:

The magic happens in these key steps:
- When a customer selects "Solana Pay," the system converts the cart total from fiat (EUR) to SOL using real-time rates.
- A one-time wallet address is generated specifically for this transaction.
- The customer sends SOL to this address using their wallet (like Phantom), by scanning a QR code.
- A scheduled job continuously monitors the blockchain for incoming payments.
- When payment is detected, it's automatically authorized and captured.
- The system transfers funds from the one-time wallet to cold storage.
- The order is confirmed and the customer sees the confirmation page and receives a confirmation e-mail.
Technical innovations (and challenges)
The one-time wallet system: Security, Privacy, and Simplicity
A core innovation in this module is that every payment gets its own unique, one-time Solana wallet address. This isn’t just a fun technical trick-it solves several real problems for both merchants and customers:
- Security: By generating a fresh wallet address for each order, you eliminate exposure of your main wallet. Even if someone tries to attack or spam a payment address, it only affects that single transaction-not your entire treasury.
- Privacy: If you reused the same wallet address for all orders, anyone (customers, competitors, random crypto sleuths) could look up that address on the Solana blockchain. They’d instantly see your entire transaction history and current balance. That’s like putting your bank statement on a public billboard-not exactly ideal for any webshop. One-time wallets mean each order is isolated, so nobody can snoop on your overall business by tracking a single address.
- Order-to-Transaction Clarity: With a unique wallet per payment, it’s always clear which blockchain transaction belongs to which order. There’s no guesswork or ambiguity-when funds hit a specific one-time address, the module knows exactly which cart or payment session it corresponds to.
- No Manual Checking Needed: In traditional crypto payment setups, someone often has to log into a wallet, check incoming transactions, and then mark orders as paid. That’s tedious, error-prone, and doesn’t scale. With this system, the module automatically watches each one-time wallet address, and as soon as the payment arrives, it triggers the next steps in your order flow-all hands-off, all instant.
This approach is all about making crypto payments as seamless, private, and reliable as possible for both shop owners and customers.
Real-time currency conversion
I made a deliberate design choice to keep product pricing in fiat currency (which is also the MedusaJS default), rather than in crypto. Here’s why:
- Price stability: Crypto prices are notoriously volatile-imagine having to update all your product prices not just daily, but potentially every hour! Keeping prices in fiat means you don’t have to chase the market.
- Business reality: Most merchants pay suppliers, employees, and taxes in fiat. Pricing products in the same currency you use for expenses just makes life simpler and accounting more straightforward.
- Compatibility: This approach lets you offer crypto payments as an option, while still supporting traditional payment methods like credit cards (via Stripe) or PayPal. No need to pick one or the other-you can have both.
The module takes care of converting the fiat total to SOL in real time using external APIs, so your customers always see the current rate at checkout. This way, you get the best of both worlds: stable pricing for your business, and flexible payment options for your customers.
The payment expiration challenge
One critical piece I’m still working on is payment session expiration. Without this, there’s a risk that customers could exploit crypto price swings to get unfair discounts.
Let’s break down how this could happen with a concrete example:
Suppose your store uses EUR as the base currency and a customer fills their cart with €150 worth of products. At that moment, the conversion rate is 1 SOL = €150, so the checkout shows the customer needs to pay 1 SOL.
But here’s the catch:
If the customer waits a few days (or even weeks) and the SOL price drops, so now 1 SOL = €100, they could buy 1 SOL for just €100 and complete the payment session they started earlier. They’d get €150 worth of products for only €100-worth of SOL, just by waiting for the right moment. That’s a €50 discount simply from timing the market, not from any sale or promotion you intended.
To prevent this kind of arbitrage, I’m building a session expiration system. Payment sessions will only be valid for a configurable time window (for example, 15 or 30 minutes). After that, the session expires, and storefront (webshop frontend app) will request an updated price for the payment session.
Current status: Demo time
Today I'm releasing a video demo showing the current state of the module. In the demo, I'll walk through:
- A complete checkout flow on the Solana testnet.
- Payment via Phantom wallet on my phone (testnet).
- Real-time order confirmation after blockchain verification.
The core payment flow is working, but there's still work to be done before public release.
Roadmap: What's next?
Before releasing this module publicly, I'm focusing on:
- Payment session expiration: As mentioned above.
- Enhanced error handling: For network issues and edge cases.
- Admin dashboard integration: For better merchant visibility such as; blockchain transaction details.
- Documentation: Comprehensive setup guides.
Want early access?
If you're interested in testing this Solana payment module before its public release:
- Reach out, my e-mail can be found at the info page.
- Let me know what kind of store you're running
Early testers will get priority support and influence the direction of the module's development.
The bigger picture
This project represents more than just a payment module-it's about making cryptocurrency payments practical for everyday e-commerce. By removing intermediaries and simplifying integration, we're getting closer to the original vision of cryptocurrency as a direct payment method.
Whether you're a MedusaJS developer looking to offer more payment options, a crypto enthusiast wanting to support blockchain adoption, an e-commerce store owner seeking payment independence, or just a geek like me who finds it fascinating that you can use nothing but code, no banks, no card companies, just code, to process a trade between two parties, I'd love to hear your thoughts and questions. Please comment below 👇
Disclaimer ⚠️
This Solana payment module is (or will be) provided as free, open-source software, with no warranties, guarantees, or liability of any kind. Use it at your own risk.
I do not charge for this module, nor do I offer insurance, customer support, or any guarantees against software bugs, user mistakes, or lost funds.
Always test thoroughly on testnet before using it with real funds, and make sure you understand how blockchain payments work.
It is your responsibility to ensure that your use of this software complies with all applicable laws and regulations in your country or jurisdiction, including but not limited to anti-money laundering (AML) and cryptocurrency regulations. I am not liable for any legal issues, penalties, or consequences resulting from the use or misuse of this software.
By using this module, you accept full responsibility for any transactions, losses, errors, or legal issues that may occur.
If you have questions or need help, feel free to reach out-but please remember: you are ultimately responsible for your own funds, compliance, and security.