Открыта бета 1С:ПредприятияОставить заявку
Paystack plugin logo

Paystack plugin

Плагин Paystack для Medusa v2: настройка publishable-ключа для каждого магазина, вспомогательные функции для витрины и опциональный проверенный платёжный провайдер.

npm install medusa-paystack-plugin
Категория
Создано
Регионы
Сервис
Версия
0.1.1
Последнее обновление
8 месяцев назад
Ежемесячные загрузки
Загрузка данных

Medusa Paystack Browser Plugin

Medusa v2 plugin for Paystack with:

  • a per-store admin widget for the Paystack publishable key
  • a public config route for storefronts and mobile apps
  • a hosted webview checkout route that loads Paystack InlineJS v2
  • a frontend helper export for browser checkout
  • an optional verified Medusa payment provider for installs that also configure a Paystack secret key

Modes

Helper mode

Helper mode only needs the Paystack publishable key.

It gives you:

  • helper functions

In helper mode, the browser callback is only a UX signal. The plugin does not mark a Medusa order as paid from the client callback alone.

Verified mode

Verified mode uses the same browser checkout flow, but also registers the optional payment provider with a Paystack .

In verified mode:

  • the browser success callback triggers
  • the provider verifies the Paystack transaction reference server-side
  • Medusa only completes the cart when verification succeeds
  • refunds use the stored Paystack transaction id

Installation

Register the plugin in your Medusa app:

If you want verified Medusa payment completion, also register the provider:

Admin setup

After the plugin is installed, open the store details page in Medusa Admin. A widget is injected into .

Save the store-specific publishable key there. The widget stores it in:

Store routes

Returns:

If your Medusa installation has more than one store, pass .

Returns a minimal HTML page that loads Paystack InlineJS and starts checkout inside a mobile webview or popup-style browser window.

Supported query params:

On success, cancel, or error the page:

  • posts a message with source
  • redirects to when provided

Frontend helper

Import the helper:

Storefront checkout example

Mobile webview example

Load that URL in your mobile webview and listen for the message payload or the redirect to your callback URL.

Development

Notes

  • This package uses the Medusa v2 plugin scaffold and exports plus .
  • If fails because your local Medusa CLI install is incomplete, reinstall dependencies cleanly and rerun the build.