npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

medusa-payment-windcave

v1.0.0

Published

Windcave payment provider for MedusaJS v2

Readme

medusa-payment-windcave

Windcave payment provider for MedusaJS v2. Integrates Windcave's Drop-in payment solution with your Medusa e-commerce store.

Features

  • Windcave Drop-in (Hosted Payment Page) integration
  • PCI SAQ-A compliant
  • Supports credit/debit cards, Apple Pay, Google Pay
  • Full payment lifecycle: authorize, capture, cancel, refund
  • Webhook support for payment notifications
  • Sandbox and production environments

Installation

npm install medusa-payment-windcave

Configuration

Add the provider to your medusa-config.ts:

module.exports = {
  // ... other config
  modules: [
    {
      resolve: "@medusajs/medusa/payment",
      options: {
        providers: [
          {
            resolve: "medusa-payment-windcave",
            id: "windcave",
            options: {
              apiUsername: process.env.WINDCAVE_API_USERNAME,
              apiKey: process.env.WINDCAVE_API_KEY,
              sandbox: process.env.NODE_ENV !== "production",
            },
          },
        ],
      },
    },
  ],
};

Environment Variables

WINDCAVE_API_USERNAME=your_api_username
WINDCAVE_API_KEY=your_api_key

Configuration Options

| Option | Type | Required | Description | |--------|------|----------|-------------| | apiUsername | string | Yes | Windcave REST API username | | apiKey | string | Yes | Windcave REST API key | | sandbox | boolean | No | Use sandbox environment (default: false) | | defaultCurrency | string | No | Default currency code (e.g., "NZD") | | merchantName | string | No | Merchant name for mobile wallets |

Frontend Integration

1. Initiate Payment Session

When the customer proceeds to checkout, Medusa creates a payment session. The session data includes Windcave's sessionLinks needed for the Drop-in.

2. Load Windcave Drop-in

Add the Windcave JavaScript SDK to your storefront:

<script src="https://sec.windcave.com/js/windcavepayments-dropin-v1.js"></script>

3. Create the Drop-in

// Get payment session from Medusa API
const paymentSession = await medusa.carts.createPaymentSessions(cartId);
const windcaveSession = paymentSession.payment_session;

// Create Drop-in
const dropIn = WindcavePayments.DropIn.create({
  container: "payment-container",
  links: windcaveSession.data.sessionLinks,
  totalValue: windcaveSession.data.amount,
  onSuccess: function(status) {
    if (status === "Done") {
      // Complete checkout via Medusa
      completeCheckout();
    }
  },
  onError: function(stage, error) {
    console.error("Payment failed:", stage, error);
  }
});

4. Complete Checkout

After successful payment, complete the order through Medusa:

async function completeCheckout() {
  // Authorize the payment
  await medusa.carts.authorizePaymentSession(cartId, {
    provider_id: "windcave"
  });

  // Complete the order
  const order = await medusa.carts.complete(cartId);
}

Webhooks

Configure your Windcave notification URL to:

https://your-store.com/hooks/payment/windcave

The provider handles webhook notifications automatically to update payment status.

API Reference

Payment Data Structure

The payment session data contains:

{
  sessionId: string;        // Windcave session ID
  sessionLinks: Array<{     // Links for Drop-in SDK
    href: string;
    rel: string;
    method: string;
  }>;
  amount: string;           // Payment amount
  currency: string;         // Currency code
  merchantReference: string; // Unique reference
  transactionId?: string;   // Set after authorization
  status?: string;          // Payment status
}

Testing

Use Windcave's test credentials in sandbox mode:

Resources

License

MIT