Integrations
Medusa × Mastercard

Mastercard for Medusa

Mastercard is one of the world’s leading card networks. Combined with Medusa, the open-source commerce framework for headless shops, you offer your customers exactly the payment option they expect at checkout. With zahls.ch you connect the two without any coding: create an account, set up the integration, activate Mastercard. It then appears directly in the checkout of your Medusa store, and all transactions are gathered clearly in your dashboard.

Medusa is an open-source commerce framework for headless shops: products, cart, checkout, and admin run as a Node.js backend that connects storefronts and custom apps via APIs.

The connection to zahls.ch uses the official npm package @zahls/medusa-plugin. You install it in the Medusa backend, register the payment provider in medusa-config.ts, and enter your API key plus instance name.

Customers pay via the hosted zahls.ch checkout (redirect). Captures, refunds, and status updates run through Medusa payment webhooks – optionally with HMAC signature verification.

Medusa suits teams running a developer-driven headless store that need Swiss payment methods such as TWINT, cards, and PostFinance.

Features

  • Official npm plugin for Medusa v2
  • Hosted checkout with redirect
  • Captures and refunds via the API
  • Webhooks with optional HMAC verification
  • TWINT, cards and PostFinance at checkout

Benefits

  • Broad acceptance among domestic and international customers
  • Fast activation without coding skills
  • Stable API connection with automatic status updates
  • Official Medusa v2 integration with webhooks

Use cases

Mastercard for Medusa pays off in many scenarios:

  • Customers at home and abroad who pay with credit or debit cards
  • Stores that want to reduce checkout abandonment with familiar payment methods
  • Merchants who want to manage transactions, refunds, and payouts in one place

Setup

How to set up Mastercard in Medusa

  1. Create a zahls.ch account and complete verification.
  2. Install the @zahls/medusa-plugin npm package, register the payment provider in medusa-config.ts, and enter your API key plus instance name.
  3. Enter the API keys from your zahls.ch dashboard in the integration settings.
  4. Activate Mastercard as a payment method and save the configuration.
  5. Run a test payment in test mode, then switch your store live.

FAQ

Do I need a separate contract for Mastercard?

No. Card acceptance runs through your zahls.ch account; you do not need your own acquiring contract.

How long does the setup in Medusa take?

Usually less than an hour: install the integration, enter the API keys, activate the payment method, and test.

What does using Mastercard cost?

Transaction fees depend on your chosen zahls.ch plan. There are no setup fees for the integration itself.