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

@solteq-excom/medusa-payment-paytrail

v1.0.14

Published

Paytrail payment provider plugin for Medusa

Downloads

1,285

Readme

Paytrail Payment Provider Plugin

Paytrail payment provider plugin for Medusa.

This package is published to NPM as @solteq-excom/medusa-payment-paytrail.

Install

Add the package to your Medusa backend:

yarn add @solteq-excom/medusa-payment-paytrail

Register the plugin and payment provider in your medusa-config.ts:

plugins: [
  {
    resolve: "@solteq-excom/medusa-payment-paytrail",
    options: {},
  },
],
modules: [
  {
    resolve: "@medusajs/medusa/payment",
    options: {
      providers: [
        {
          resolve: "@solteq-excom/medusa-payment-paytrail/providers/paytrail",
          id: "paytrail",
          options: {
            merchantId: Number(process.env.PAYTRAIL_MERCHANT_ID ?? "375917"),
            secretKey: process.env.PAYTRAIL_SECRET_KEY ?? "SAIPPUAKAUPPIAS",
            platformName: process.env.PAYTRAIL_PLATFORM_NAME ?? "MedusaJS",
            callbackBaseUrl: process.env.PAYTRAIL_CALLBACK_BASE_URL,
            language: process.env.PAYTRAIL_LANGUAGE ?? "EN",
          },
        },
      ],
    },
  },
]

Configuration

Required and supported environment variables:

  • PAYTRAIL_MERCHANT_ID
  • PAYTRAIL_SECRET_KEY
  • PAYTRAIL_PLATFORM_NAME (optional)
  • PAYTRAIL_CALLBACK_BASE_URL (recommended, must use HTTPS)
  • PAYTRAIL_LANGUAGE (FI, SV, or EN)

Example:

PAYTRAIL_MERCHANT_ID=375917
PAYTRAIL_SECRET_KEY=SAIPPUAKAUPPIAS
PAYTRAIL_PLATFORM_NAME=MedusaJS
PAYTRAIL_CALLBACK_BASE_URL=https://your-backend.example.com
PAYTRAIL_LANGUAGE=EN

Paytrail requires HTTPS callback URLs for both success and cancel callbacks.

Features

  • Payment session initiation via Paytrail API
  • Payment status check for authorization flow
  • Refund support
  • Callback action parsing and HMAC signature verification
  • Custom GET callback route for Paytrail redirect and callback query params

Callback Route

The plugin exposes GET /hooks/paytrail for Paytrail redirect and callback handling.

The route forwards callback payloads into Medusa's payment webhook pipeline by emitting PaymentWebhookEvents.WebhookReceived after validating the signature.

Behavior

  • Currency support is limited to EUR by Paytrail.
  • Payment sessions are created in pending status until Paytrail authorizes them.
  • Cart completion fails before third-party authorization.
  • Standard Paytrail flow is treated as auto-captured after authorization.

Payment Flow

  1. Store creates a payment session with provider pp_paytrail_paytrail.
  2. Paytrail returns a redirect URL and transactionId.
  3. Customer authorizes the payment in Paytrail checkout.
  4. Callback updates the payment status to authorized or captured.
  5. Cart completion succeeds after authorization.

Troubleshooting

No payment providers available in store

  • Ensure the Paytrail provider is linked to the region.

Cart completion returns 400 not authorized

  • This is expected before the Paytrail authorization callback is processed.
  • Complete the payment in Paytrail before completing the cart.

Callback is not triggered

  • Verify PAYTRAIL_CALLBACK_BASE_URL is configured with an HTTPS URL.
  • Paytrail requires HTTPS callback URLs for both success and cancel callbacks.

Disclaimer

This package is provided as-is, without warranty of any kind. You are responsible for validating the integration, security, and compliance requirements before using it in production.

References

  • Official Paytrail API documentation: https://docs.paytrail.com/#/