> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stellartools.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# MedusaJS Adapter

> Stellar as a payment provider in Medusa v2

## Install

```bash theme={null}
npm install @stellartools/medusajs-adapter
```

## Configure

Add the adapter as a payment provider in your Medusa config:

```ts theme={null}
import { defineConfig, loadEnv } from "@medusajs/framework/utils";
import { StellarTools } from "@stellartools/medusajs-adapter";

loadEnv(process.env.NODE_ENV || "development", process.cwd());

module.exports = defineConfig({
  projectConfig: {
    databaseUrl: process.env.DATABASE_URL,
  },
  modules: [
    {
      resolve: "@medusajs/payment",
      options: {
        providers: [
          {
            resolve: "@stellartools/medusajs-adapter",
            id: "stellar",
            options: {
              api_key: process.env.STELLAR_TOOLS_API_KEY,
              webhook_secret: process.env.STELLAR_TOOLS_WEBHOOK_SECRET,
            },
          },
        ],
      },
    },
  ],
});
```

## Options

<ParamField body="api_key" type="string" required>
  Your StellarTools API key.
</ParamField>

<ParamField body="webhook_secret" type="string" required>
  Webhook signing secret for verifying incoming events.
</ParamField>

<ParamField body="debug" type="boolean">
  Enable debug logging. Defaults to `true`.
</ParamField>

Point your StellarTools webhook at Medusa's provider webhook URL to receive payment events.
