|
| 1 | +<div align="center"> |
| 2 | + |
| 3 | +# SumUp Reader Examples |
| 4 | + |
| 5 | +[![Documentation][docs-badge]](https://developer.sumup.com) |
| 6 | +[](./LICENSE) |
| 7 | + |
| 8 | +</div> |
| 9 | + |
| 10 | +Learn how to pair SumUp card readers and start in-person payments using the SumUp SDKs. This repository contains backend examples for all our SDKs and a couple of frontend starters for managing readers and initiating checkouts. |
| 11 | + |
| 12 | +All you need to get started is an API key (if you don't have one yet, create it in the [SumUp Dashboard](https://me.sumup.com/settings/api-keys)) and your merchant code (which you can find in the [settings](https://me.sumup.com/settings)). We recommend starting with a Sandbox account that you can create in [the dashboard](https://me.sumup.com/settings/developer) to be able to test as many payments as you want without processing real money. |
| 13 | + |
| 14 | +Set your environment: |
| 15 | + |
| 16 | +```sh |
| 17 | +export SUMUP_API_KEY="your_api_key" |
| 18 | +export SUMUP_MERCHANT_CODE="your_merchant_code" |
| 19 | +``` |
| 20 | + |
| 21 | +## Backend Examples |
| 22 | + |
| 23 | +Minimal servers that expose the following endpoints: |
| 24 | + |
| 25 | +- `POST /readers` – link (pair) a reader using a pairing code and name |
| 26 | +- `GET /readers` – list readers for the merchant |
| 27 | +- `POST /readers/{id}/checkout` – start a checkout on a reader for a given amount |
| 28 | + |
| 29 | +- **Node.js SDK** (https://github.com/sumup/sumup-ts) |
| 30 | + - Runtime: [Node.js](./backend/node/) |
| 31 | + ```sh |
| 32 | + cd backend/node |
| 33 | + npm install |
| 34 | + npm start |
| 35 | + ``` |
| 36 | + - Runtime: [Bun](./backend/bun/) |
| 37 | + ```sh |
| 38 | + cd backend/bun |
| 39 | + bun install |
| 40 | + bun run index.ts |
| 41 | + ``` |
| 42 | + - Runtime: [Deno](./backend/deno/) |
| 43 | + ```sh |
| 44 | + cd backend/deno |
| 45 | + deno run --allow-env --allow-net main.ts |
| 46 | + ``` |
| 47 | + |
| 48 | +- **Python SDK** (https://github.com/sumup/sumup-py) |
| 49 | + ```sh |
| 50 | + cd backend/python |
| 51 | + uv run app.py |
| 52 | + ``` |
| 53 | + |
| 54 | +- **Java SDK** (https://github.com/sumup/sumup-java) |
| 55 | + ```sh |
| 56 | + cd backend/java |
| 57 | + gradle run |
| 58 | + ``` |
| 59 | + |
| 60 | +- **Go SDK** (https://github.com/sumup/sumup-go) |
| 61 | + ```sh |
| 62 | + cd backend/go |
| 63 | + go run . |
| 64 | + ``` |
| 65 | + |
| 66 | +- **Rust SDK** (https://github.com/sumup/sumup-rs) |
| 67 | + ```sh |
| 68 | + cd backend/rust |
| 69 | + cargo run |
| 70 | + ``` |
| 71 | + |
| 72 | +- **.NET SDK** (https://github.com/sumup/sumup-dotnet) |
| 73 | + ```sh |
| 74 | + cd backend/dotnet |
| 75 | + dotnet run |
| 76 | + ``` |
| 77 | + |
| 78 | +## Frontend Examples |
| 79 | + |
| 80 | +Both front-ends talk to the backend endpoints above. They let you pair a reader, list existing readers, and start a checkout with a chosen amount. |
| 81 | + |
| 82 | +- [Static](./frontend/static/) |
| 83 | +- [React](./frontend/react/) |
| 84 | + |
| 85 | +The UI also links to https://virtual-solo.sumup.com/ which provides a web-based card reader for testing. |
| 86 | + |
| 87 | +## Environment |
| 88 | + |
| 89 | +All backend examples use: |
| 90 | + |
| 91 | +```sh |
| 92 | +export SUMUP_API_KEY="your_api_key" |
| 93 | +export SUMUP_MERCHANT_CODE="your_merchant_code" |
| 94 | +``` |
| 95 | + |
| 96 | +If the front-end is served from another origin, enable CORS on the backend or use a proxy. |
| 97 | + |
| 98 | +[docs-badge]: https://img.shields.io/badge/SumUp-documentation-white.svg?logo=data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgY29sb3I9IndoaXRlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggZD0iTTIyLjI5IDBIMS43Qy43NyAwIDAgLjc3IDAgMS43MVYyMi4zYzAgLjkzLjc3IDEuNyAxLjcxIDEuN0gyMi4zYy45NCAwIDEuNzEtLjc3IDEuNzEtMS43MVYxLjdDMjQgLjc3IDIzLjIzIDAgMjIuMjkgMFptLTcuMjIgMTguMDdhNS42MiA1LjYyIDAgMCAxLTcuNjguMjQuMzYuMzYgMCAwIDEtLjAxLS40OWw3LjQ0LTcuNDRhLjM1LjM1IDAgMCAxIC40OSAwIDUuNiA1LjYgMCAwIDEtLjI0IDcuNjlabTEuNTUtMTEuOS03LjQ0IDcuNDVhLjM1LjM1IDAgMCAxLS41IDAgNS42MSA1LjYxIDAgMCAxIDcuOS03Ljk2bC4wMy4wM2MuMTMuMTMuMTQuMzUuMDEuNDlaIiBmaWxsPSJjdXJyZW50Q29sb3IiLz4KPC9zdmc+ |
0 commit comments