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

# MedusaJS

> Use any PayKit provider inside a Medusa payment module.

```bash theme={null}
npm install @paykit-sdk/medusajs @paykit-sdk/core @paykit-sdk/stripe
```

## Setup

```typescript filename="medusa-config.ts" theme={null}
import { defineConfig } from '@medusajs/framework/utils';
import { stripe } from '@paykit-sdk/stripe';

export default defineConfig({
  modules: [
    {
      resolve: '@medusajs/payment',
      options: {
        providers: [
          {
            resolve: '@paykit-sdk/medusajs',
            options: {
              provider: stripe(),
              webhookSecret: process.env.STRIPE_WEBHOOK_SECRET,
              debug: process.env.NODE_ENV === 'development',
            },
          },
        ],
      },
    },
  ],
});
```

Swap `stripe()` for any PayKit provider and everything else stays the same.

## Configuration Options

| Option                    | Type           | Required | Default | Description                                                                                     |
| ------------------------- | -------------- | -------- | ------- | ----------------------------------------------------------------------------------------------- |
| `provider`                | PayKitProvider | Yes      | —       | A PayKit provider instance (e.g. `stripe()`, `gopay()`)                                         |
| `webhookSecret`           | string \| null | No       | `null`  | Webhook secret used to verify incoming webhook payloads                                         |
| `amountToCentsMultiplier` | number (≥ 1)   | No       | `1`     | Multiplies the Medusa amount before sending to the provider. Use `100` for cent-based providers |
| `debug`                   | boolean        | No       | `false` | Logs PayKit operations to the console                                                           |

### `amountToCentsMultiplier`

Some providers (e.g. GoPay) expect amounts in the smallest currency unit — `3000` for 30 EUR. If Medusa is passing the amount in the major unit, set this option to convert automatically:

```typescript filename="medusa-config.ts" theme={null}
import { gopay } from '@paykit-sdk/gopay';

{
  resolve: '@paykit-sdk/medusajs',
  options: {
    provider: gopay(),
    webhookSecret: process.env.GOPAY_WEBHOOK_SECRET,
    amountToCentsMultiplier: 100, // 30 EUR → sends 3000 to GoPay
  },
}
```

Defaults to `1` (no conversion). Minimum value is `1`.

## Example

See a working Medusa + PayKit server: [GitHub](https://github.com/usepaykit/paykit-sdk/examples/medusa-shop)
