SumUp
Accept SumUp card payments
@sumup/medusa-plugin
SumUp payment provider for Medusa v2.
This plugin lets a Medusa application create and manage SumUp online checkouts from the backend. It supports:
- Hosted Checkout, where the customer is redirected to SumUp's hosted payment page.
- Payment Widget, where the storefront mounts SumUp's card widget with the checkout created by Medusa.
- Refunds through SumUp transactions.
- Medusa's built-in payment webhook route for asynchronous status updates.
The plugin never handles raw card data directly. SumUp credentials remain on the Medusa backend.
Compatibility
- Medusa v2.15.x
- SumUp online checkout flows
Install
1yarn add @sumup/medusa-plugin
Configure Medusa
Register the plugin and payment provider in Copy to clipboardmedusa-config.ts:
1234567891011121314151617181920import { defineConfig } from "@medusajs/framework/utils"export default defineConfig({plugins: [{resolve: "@sumup/medusa-plugin",options: {},},],modules: [{resolve: "@medusajs/medusa/payment",options: {providers: [{resolve: "@sumup/medusa-plugin/providers/sumup",id: "sumup",options: {apiKey: process.env.SUMUP_API_KEY,merchantCode: process.env.SUMUP_MERCHANT_CODE,
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 Copy to clipboardpp_sumup_sumup when the service identifier is Copy to clipboardsumup and the configured provider Copy to clipboardid is Copy to clipboardsumup.
Configuration Options
Option Required Description Copy to clipboardapiKey Yes SumUp API key or access token. Keep it server-side. Copy to clipboardmerchantCode Yes SumUp merchant code that receives the payment. Copy to clipboardcheckoutMode No Default checkout mode: Copy to clipboardhosted or Copy to clipboardwidget. Defaults to Copy to clipboardhosted. Copy to clipboardreturnUrl No Backend webhook URL. For provider Copy to clipboardid: "sumup", use Copy to clipboard/hooks/payment/sumup_sumup. Copy to clipboardredirectUrl No Storefront URL used after redirect or Strong Customer Authentication flows. Copy to clipboardpaymentDescription No Default SumUp checkout description. Copy to clipboardtimeout No SumUp SDK request timeout in milliseconds. Copy to clipboardmaxRetries No SumUp SDK retry count.
You can override Copy to clipboardcheckout_mode, Copy to clipboarddescription, Copy to clipboardreturn_url, Copy to clipboardredirect_url, and Copy to clipboardcheckout_reference per payment session through provider data.
Hosted Checkout
With Copy to clipboardcheckoutMode: "hosted", the plugin creates a SumUp checkout with Hosted Checkout enabled. Medusa stores the returned Copy to clipboardhosted_checkout_url 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.
Payment Widget
With Copy to clipboardcheckoutMode: "widget", the plugin creates a SumUp checkout without Hosted Checkout enabled. Medusa stores the returned Copy to clipboardcheckout_id in the payment-session data. The storefront is then responsible for:
- Loading SumUp's widget SDK.
- Mounting the widget with the checkout ID.
- Asking the backend to re-check the payment state after widget success.
Minimal storefront snippets are available in examples/nextjs/README.md.
Webhooks
Medusa provides a built-in webhook listener route for payment providers at:
1/hooks/payment/[identifier]_[provider]
For this plugin, with service identifier Copy to clipboardsumup and provider Copy to clipboardid: "sumup", the webhook URL is:
1https://your-medusa-backend.com/hooks/payment/sumup_sumup
The plugin's Copy to clipboardgetWebhookActionAndData 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.
What the Plugin Stores
The payment-session data returned by the provider includes:
- Copy to clipboard
checkout_id - Copy to clipboard
checkout_reference - Copy to clipboard
checkout_mode - Copy to clipboard
hosted_checkout_urlfor hosted flows - Copy to clipboard
transaction_idand Copy to clipboardtransaction_codewhen available - Copy to clipboard
merchant_code - Copy to clipboard
amountand Copy to clipboardcurrency
Current Behavior and Limitations
- Copy to clipboard
authorizePaymentchecks the remote SumUp checkout status rather than performing a separate authorization step. - Copy to clipboard
capturePaymentdoes not trigger a separate capture API call. It only succeeds once the SumUp checkout is already paid. - If the amount or currency changes before payment, Copy to clipboard
updatePaymentdeactivates the old checkout and creates a replacement checkout. - Refunds require a successful SumUp transaction.
- The plugin is built for SumUp online payments, not terminal or card-present flows.
Sandbox Checklist
- Verify one successful Hosted Checkout payment.
- Verify one successful Payment Widget payment.
- Verify at least one webhook-driven payment update.
- Verify one full refund and one partial refund.
- Test SumUp's deliberate failure path with amount Copy to clipboard
11. - Verify expired or canceled checkouts map cleanly back into Medusa session state.
Examples
- Consumer storefront snippets: examples/nextjs/README.md
- Local end-to-end playground: examples/docker/README.md
Contributing
Maintainer and release workflow documentation lives in CONTRIBUTING.md.
