JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 10
  • Score
    100M100P100Q59422F
  • License MIT

A plugin for managing payments in Casys

Package Exports

  • medusa-casys-plugin/admin/index
  • medusa-casys-plugin/api/admin/plugin/route
  • medusa-casys-plugin/api/casys/fail/route
  • medusa-casys-plugin/api/casys/success/route
  • medusa-casys-plugin/api/store/plugin/route
  • medusa-casys-plugin/package.json
  • medusa-casys-plugin/providers/casys-payment

Readme

Medusa logo

Medusa Casys Payment Plugin

Documentation | Website

A Medusa payment plugin for integrating with the Casys payment gateway

PRs welcome! Product Hunt Discord Chat Follow @medusajs

Overview

This plugin integrates the Casys payment gateway with your Medusa e-commerce store. It provides a seamless payment experience for your customers, handling payment authorization, processing, and webhooks for successful and failed payments.

Features

  • Seamless integration with Casys payment gateway
  • Automatic currency conversion to MKD (Macedonian Denar)
  • Handling of payment callbacks and redirects
  • Support for payment success and failure workflows

Compatibility

This plugin is compatible with versions >= 2.4.0 of @medusajs/medusa.

Prerequisites

  • Medusa server (v2.4.0 or later)
  • Casys merchant account credentials

Installation

npm install medusa-casys-plugin
# or
yarn add medusa-casys-plugin

Configuration

Add the plugin to your medusa-config.js file:

module.exports = defineConfig({
  plugins: [
    {
      resolve: `medusa-casys-plugin`,
      options: {},
    },
  ],
  modules: [
    {
      resolve: "@medusajs/medusa/payment",
      options: {
        providers: [
          {
            resolve: "medusa-casys-plugin/providers/casys-payment",
            id: "casys_payment_provider",
            options: {
              merchantName: "Your Merchant Name",
              merchantId: "your-merchant-id",
              checkSumKey: "your-checksum-key",
              paymentOkUrl: "https://your-store.com/payment-success",
              paymentFailUrl: "https://your-store.com/payment-failure",
              backendUrl: "https://your-backend.com",
            },
          },
        ],
      },
    },
  ],
});

Required Options

Option Description
merchantName Your registered merchant name with Casys
merchantId Your merchant ID provided by Casys
checkSumKey Your checksum key for transaction verification
paymentOkUrl URL to redirect customers after successful payment
paymentFailUrl URL to redirect customers after failed payment
backendUrl Your backend URL where Casys will send webhooks

How It Works

  1. Payment Initiation: When a customer proceeds to checkout, the plugin initializes a payment session with Casys.

  2. Currency Conversion: The plugin automatically converts various currencies (EUR, USD, GBP, AED) to MKD using predefined conversion rates:

    • EUR: 61.5 MKD
    • USD: 56 MKD
    • GBP: 72 MKD
    • AED: 15.5 MKD
  3. Payment Authorization: The plugin securely prepares the payment request with proper checksums and customer information.

  4. Payment Processing: Customers are redirected to the Casys payment page to complete their payment.

  5. Payment Completion: After payment, customers are redirected back to your store, and the plugin handles the payment status.

API Endpoints

The plugin creates the following API endpoints:

  • POST /api/casys/success - Handles successful payment callbacks
  • POST /api/casys/fail - Handles failed payment callbacks

About Casys

Casys is a payment processing service allowing businesses to accept payments online.

What is Medusa

Medusa is a set of commerce modules and tools that allow you to build rich, reliable, and performant commerce applications without reinventing core commerce logic. The modules can be customized and used to build advanced ecommerce stores, marketplaces, or any product that needs foundational commerce primitives. All modules are open-source and freely available on npm.

Learn more about Medusa's architecture and commerce modules in the Docs.

Community & Contributions

The community and core team are available in GitHub Discussions, where you can ask for support, discuss roadmap, and share ideas.

Join our Discord server to meet other community members.

Other channels