SumUp payment provider for Medusa v2.
SumUp payment provider for Medusa v2.
This plugin lets a Medusa application create and manage SumUp online checkouts from the backend. It supports:
The plugin never handles raw card data directly. SumUp credentials remain on the Medusa backend.
yarn add @sumup/medusa-plugin
Register the plugin and payment provider in :
1import { defineConfig } from "@medusajs/framework/utils"23export default defineConfig({4 plugins: [5 {6 resolve: "@sumup/medusa-plugin",7 options: {},8 },9 ],10 modules: [11 {12 resolve: "@medusajs/medusa/payment",13 options: {14 providers: [15 {16 resolve: "@sumup/medusa-plugin/providers/sumup",17 id: "sumup",18 options: {19 apiKey: process.env.SUMUP_API_KEY,20 merchantCode: process.env.SUMUP_MERCHANT_CODE,21 checkoutMode: "hosted",22 returnUrl: `${process.env.MEDUSA_BACKEND_URL}/hooks/payment/sumup_sumup`,23 redirectUrl: `${process.env.STOREFRONT_URL}/checkout/sumup/return`,24 },25 },26 ],27 },28 },29 ],30})
After the application starts, enable the provider for the relevant region in Medusa Admin. Per Medusa's payment-provider model, the resulting provider identifier is when the service identifier is and the configured provider is .
| Option | Required | Description |
|---|---|---|
| Yes | SumUp API key or access token. Keep it server-side. | |
| Yes | SumUp merchant code that receives the payment. | |
| No | Default checkout mode: or . Defaults to . | |
| No | Backend webhook URL. For provider , use . | |
| No | Storefront URL used after redirect or Strong Customer Authentication flows. | |
| No | Default SumUp checkout description. | |
| No | SumUp SDK request timeout in milliseconds. | |
| No | SumUp SDK retry count. |
You can override , , , , and per payment session through provider data.
With , the plugin creates a SumUp checkout with Hosted Checkout enabled. Medusa stores the returned in the payment-session data. The storefront should redirect the customer to that URL.
Use backend state as the source of truth. The storefront should not treat the redirect alone as proof of payment success.
With , the plugin creates a SumUp checkout without Hosted Checkout enabled. Medusa stores the returned in the payment-session data. The storefront is then responsible for:
Minimal storefront snippets are available in examples/nextjs/README.md.
Medusa provides a built-in webhook listener route for payment providers at:
/hooks/payment/[identifier]_[provider]
For this plugin, with service identifier and provider , the webhook URL is:
https://your-medusa-backend.com/hooks/payment/sumup_sumup
The plugin's implementation follows Medusa's payment-webhook flow: it receives the webhook payload, retrieves the checkout from SumUp, maps the result to a Medusa payment action, and returns the payment session reference back to Medusa.
The payment-session data returned by the provider includes:
Maintainer and release workflow documentation lives in CONTRIBUTING.md.