Sumup
SumUp payment provider for Medusa v2
SumUp Payments for Medusa
A SumUp payment provider plugin for Medusa V2. Inspired by https://github.com/VariableVic/mollie-payments-medusa and mostly implemented by Claude.
Warning
This plugin has not been tested on a live store. Please conduct thorough testing before using it in a production environment. I am not responsible for any missed or failed payments resulting from the use of this plugin. If you encounter any issues, please report them here.
Table of Contents
Features
- SumUp Checkout: Creates a hosted SumUp checkout session that customers complete via the SumUp Card Widget or a custom card form.
- Webhook Support: Receives real-time checkout status updates via SumUp webhooks.
- Refunds: Supports full and partial refunds via the SumUp Transactions API.
- Amount verification: A PAID checkout only authorizes/captures the session it was created for — its amount and currency must match the ones stored in the session data.
- No extra dependencies: Uses the native Node.js API — no additional HTTP client needed.
Prerequisites
- Medusa server v2.3.0 or later
- Node.js v20 or later
- A SumUp merchant account with a valid API key and merchant code
Note
You can find your API key and merchant code in your SumUp Dashboard under Settings → Developer → API Keys.
Installation
Configuration
Add the provider to the module in your file:
Configuration Options
| Option | Description | Required | Default |
|---|---|---|---|
| Your SumUp API key (e.g. ) | ✅ | — | |
| Your SumUp merchant code (e.g. ) | ✅ | — | |
| The public URL of your Medusa backend | ✅ | — | |
| The default storefront URL to redirect the customer to after payment. Must be a valid / URL. | ✅ | — | |
| Extra hostnames permitted when a payment session supplies its own . The host of is always allowed. Any override on a non-allowed host is rejected (open-redirect protection). | ❌ | ||
| Enable verbose debug logging | ❌ |
Per-session redirect URL
A payment session may override the redirect target by passing (e.g. a locale-specific ). The override is accepted only when its host is the same as 's host or appears in , and its scheme is /; otherwise the checkout is rejected with . When omitted, is used.
Important
The storefront's own origin must be an allowed redirect host. A typical storefront sends ${location.origin}/${countryCode}/checkout/complete`redirectUrlredirectUrlAllowedHosts`, session creation fails and customers cannot pay.
This bites most often when the backend env and the storefront domain drift apart between environments (e.g. a or preview deploy, or a separate admin vs. storefront domain). Whenever you add a storefront origin, add it to . Example:
Environment Variables
Add the following to your file:
Usage
Once installed and configured, the SumUp payment method will be available in your Medusa Admin. To enable it:
- Log in to your Medusa Admin
- Go to Settings → Regions
- Add or edit a region and select SumUp from the payment providers dropdown
The provider ID for the SumUp checkout is:
pp_sumup_sumupClient-Side Integration
SumUp checkouts are created server-side by Medusa. After a payment session is initiated, the session data will contain a SumUp checkout that you pass to the SumUp Card Widget on your storefront to render the payment form.
Basic flow:
- Customer reaches the payment step — Medusa creates a SumUp checkout via
- Your storefront receives the checkout from the payment session data
- Render the SumUp Card Widget with the checkout ID
- SumUp processes the payment and calls the Medusa webhook ()
- Because SumUp auto-captures, a checkout is reported to Medusa as captured at authorize time — the order's payment is marked captured immediately on completion, without waiting for the webhook. The webhook (which the plugin always re-verifies against the SumUp API, since SumUp webhooks are unsigned) acts as a backstop that reconciles status if the browser flow is interrupted.
Example Card Widget integration:
For APMs (iDEAL, Bancontact, etc.), the option handles the post-payment redirect automatically.
License
MIT

