• Модуль интеграций
  • Сообщество
  • Блог
Документация
Плагины и интеграцииВсе расширения для Medusa от сообществаСтартерыЗапускайте проекты быстрее с готовыми решениями
ЭкспертыПодберите специалиста для разработки и развития вашего проекта на MedusaКейсыПосмотрите примеры Medusa в продакшене и успешные внедрения
Представляем готовый к продакшену Medusa DTC Starter от Gorgo

26 августа 2026 г. · Продукт

Gorgo снижает затраты на адаптацию Medusa к локальным рынкам.

Мы разрабатываем плагины интеграции, осуществляем поддержку и развиваем сообщество разработчиков на Medusa в Telegram.

  • Ресурсы Medusa
  • Плагины и интеграции
  • Модуль интеграций
  • Стартеры
  • Эксперты
  • Кейсы
  • Medusa Чат в Telegram
  • Medusa Новости в Telegram
  • Документация Gorgo
  • Связаться с нами
  • TelegramGitHub
Плагины
P

Paytrail

Плагин платёжного провайдера Paytrail для Medusa

npm install @solteq-excom/medusa-payment-paytrail
Категория
Платежи
Создано
Solteq-excom
Версия
2.0.2
Последнее обновление
4 дня назад
Ежемесячные загрузки
Загрузка данных
Звезды на Github
0
npmNPMGitHubGithub

Paytrail Payment Provider Plugin

Paytrail payment provider plugin for Medusa v2.

This package is published to NPM as .

Install

Add the package to your Medusa backend:

Register the plugin and payment provider in your :

Configuration

Required and supported environment variables:

  • (optional)
  • (recommended, must use HTTPS)
  • (optional, seconds, 0-900, default )
  • (required, comma-separated values; wildcard supported)
  • (, , or )

Example:

If is set, the provider sends Paytrail automatically as:

  • success:
  • cancel:

maps to Paytrail (seconds). According to Paytrail, when callback URLs are provided, callback delay can be to seconds and defaults to .

Paytrail requires HTTPS callback URLs for both success and cancel callbacks. Example uses Paytrail test credentials

When creating payment sessions, and must use or , include only host/path (no query/hash/auth), and the host must match .

supports wildcard host patterns with , for example:

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 for Paytrail redirect and callback handling.

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

Behavior

  • Currency support is limited to by Paytrail.
  • Payment sessions are created in 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 .
  2. Paytrail returns a redirect URL and .
  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 is configured with an HTTPS URL.
  • Paytrail requires HTTPS callback URLs for both success and cancel callbacks.

Contributing

Bug reports and feature requests are welcome.

When submitting an issue, include:

  • A clear description of the problem or requested change
  • Steps to reproduce, if applicable
  • Relevant configuration details, logs, or screenshots

When submitting a pull request:

  • Open an issue first for larger changes so the approach can be discussed
  • Keep the PR focused on a single fix or feature
  • Include tests or updates to existing tests when behavior changes
  • Update the README or other documentation if the public behavior changes

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

Еще в этой категории

Посмотреть все
Платежи
Braintree logo

Braintree

От Lambda Curry

Поддержка платежей и 3D Secure через Braintree

Загрузка данных
GitHubnpm
Платежи
Pay. logo

Pay.

От Webbers

Принимайте кредитные карты, цифровые платежи и купи сейчас, плати потом

Загрузка данных
GitHubnpm
Платежи
Mollie logo

Mollie

От Variable Vic

Легко принимайте мультивалютные платежи через Mollie

Загрузка данных
GitHubnpm
yarn add @solteq-excom/medusa-payment-paytrail
1plugins: [
2 {
3 resolve: "@solteq-excom/medusa-payment-paytrail",
4 options: {},
5 },
6],
7modules: [
8 {
9 resolve: "@medusajs/medusa/payment",
10 options: {
11 providers: [
12 {
13 resolve: "@solteq-excom/medusa-payment-paytrail/providers/paytrail",
14 id: "paytrail",
15 options: {
16 merchantId: Number(process.env.PAYTRAIL_MERCHANT_ID),
17 secretKey: process.env.PAYTRAIL_SECRET_KEY,
18 platformName: process.env.PAYTRAIL_PLATFORM_NAME ?? "MedusaJS",
19 callbackBaseUrl: process.env.PAYTRAIL_CALLBACK_BASE_URL,
20 callbackDelay: process.env.PAYTRAIL_CALLBACK_DELAY
21 ? Number(process.env.PAYTRAIL_CALLBACK_DELAY)
22 : undefined,
23 redirectUrlHostWhitelist: (process.env.PAYTRAIL_REDIRECT_URL_HOST_WHITELIST ?? "")
24 .split(",")
25 .map((value) => value.trim())
26 .filter(Boolean),
27 language: process.env.PAYTRAIL_LANGUAGE ?? "EN",
28 },
29 },
30 ],
31 },
32 },
33]
1PAYTRAIL_MERCHANT_ID=375917
2PAYTRAIL_SECRET_KEY=SAIPPUAKAUPPIAS
3PAYTRAIL_PLATFORM_NAME=MedusaJS
4PAYTRAIL_CALLBACK_BASE_URL=https://your-backend.example.com
5PAYTRAIL_CALLBACK_DELAY=0
6PAYTRAIL_REDIRECT_URL_HOST_WHITELIST=localhost:8888,store.example.com,*.foo.bar.baz,pr-*.foo.bar.baz
7PAYTRAIL_LANGUAGE=EN