Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/bun/biome.jsonc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.3.11/schema.json",
"$schema": "https://biomejs.dev/schemas/2.4.14/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
Expand Down
4 changes: 2 additions & 2 deletions backend/bun/bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion backend/bun/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"lint:fix": "biome check --write"
},
"dependencies": {
"@sumup/sdk": "^0.0.11"
"@sumup/sdk": "^0.1.6"
},
"devDependencies": {
"@biomejs/biome": "^2.1.2"
Expand Down
2 changes: 1 addition & 1 deletion backend/deno/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
},
"imports": {
"@std/assert": "jsr:@std/assert@1",
"@sumup/sdk": "jsr:@sumup/sdk@^0.0.11"
"@sumup/sdk": "npm:@sumup/sdk@^0.1.6"
}
}
13 changes: 5 additions & 8 deletions backend/deno/deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions backend/go/go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
module sumup-examples-go

go 1.23.0
go 1.24.0

toolchain go1.23.2
require github.com/sumup/sumup-go v0.17.0

require github.com/sumup/sumup-go v0.12.0

require golang.org/x/oauth2 v0.27.0 // indirect
require golang.org/x/oauth2 v0.35.0 // indirect
4 changes: 4 additions & 0 deletions backend/go/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/sumup/sumup-go v0.12.0 h1:sUBYRzRNlSArvayKMV9Rplb+Vc7+PHQ0osaSqo22cDg=
github.com/sumup/sumup-go v0.12.0/go.mod h1:UgT9aaxvUBrAiRpunqyb1zi5v/+1z+6Lr6p6bgL8EYI=
github.com/sumup/sumup-go v0.17.0 h1:dNMEfzskJl9dHVFhEChAQBYsKc9FZWg2opeTlDUtfPI=
github.com/sumup/sumup-go v0.17.0/go.mod h1:D++G2u9zvobimuUrgvSbah/tS3ON2Dmi6yb6ScA2Jpg=
golang.org/x/oauth2 v0.27.0 h1:da9Vo7/tDv5RH/7nZDz1eMGS/q1Vv1N/7FCrBhI9I3M=
golang.org/x/oauth2 v0.27.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8=
golang.org/x/oauth2 v0.35.0 h1:Mv2mzuHuZuY2+bkyWXIHMfhNdJAdwW3FuWeCPYN5GVQ=
golang.org/x/oauth2 v0.35.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=
11 changes: 5 additions & 6 deletions backend/go/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (

"github.com/sumup/sumup-go"
sumupclient "github.com/sumup/sumup-go/client"
"github.com/sumup/sumup-go/readers"
)

type createReaderRequest struct {
Expand Down Expand Up @@ -59,9 +58,9 @@ func main() {
return
}

reader, err := client.Readers.Create(r.Context(), merchantCode, readers.Create{
PairingCode: readers.ReaderPairingCode(pairingCode),
Name: readers.ReaderName(name),
reader, err := client.Readers.Create(r.Context(), merchantCode, sumup.ReadersCreateParams{
PairingCode: sumup.ReaderPairingCode(pairingCode),
Name: sumup.ReaderName(name),
})
if err != nil {
log.Printf("[ERROR] create reader: %v", err)
Expand Down Expand Up @@ -105,9 +104,9 @@ func main() {
return
}

checkout, err := client.Readers.CreateCheckout(r.Context(), merchantCode, readerID, readers.CreateCheckout{
checkout, err := client.Readers.CreateCheckout(r.Context(), merchantCode, readerID, sumup.CreateCheckoutRequest{
Description: ptr("Card reader checkout"),
TotalAmount: readers.CreateCheckoutTotalAmount{
TotalAmount: sumup.CreateCheckoutRequestTotalAmount{
Currency: "EUR",
MinorUnit: 2,
Value: int(math.Round(payload.Amount * 100)),
Expand Down
4 changes: 2 additions & 2 deletions backend/java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repositories {
}

dependencies {
implementation 'com.sumup:sumup:0.0.5'
implementation 'com.sumup:sumup-sdk:0.0.6'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.21.3'
}

Expand All @@ -28,7 +28,7 @@ java {
spotless {
java {
target 'src/**/*.java'
googleJavaFormat('1.24.0')
googleJavaFormat('1.27.0')
}
format 'misc', {
target '*.gradle', '*.md'
Expand Down
3 changes: 1 addition & 2 deletions backend/java/src/main/java/com/sumup/examples/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.fasterxml.jackson.databind.ObjectMapper;
import com.sumup.sdk.SumUpClient;
import com.sumup.sdk.SumUpEnvironment;
import com.sumup.sdk.models.CheckoutCreateRequest;
import com.sumup.sdk.models.Currency;
import com.sun.net.httpserver.HttpExchange;
Expand Down Expand Up @@ -30,7 +29,7 @@ public static void main(String[] args) throws Exception {
}

SumUpClient client =
SumUpClient.builder().environment(SumUpEnvironment.PRODUCTION).accessToken(apiKey).build();
SumUpClient.builder().baseUri("https://api.sumup.com").accessToken(apiKey).build();

int port = Integer.parseInt(System.getenv().getOrDefault("PORT", "8080"));
HttpServer server = HttpServer.create(new InetSocketAddress(port), 0);
Expand Down
2 changes: 1 addition & 1 deletion backend/node/biome.jsonc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.3.11/schema.json",
"$schema": "https://biomejs.dev/schemas/2.4.14/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
Expand Down
8 changes: 4 additions & 4 deletions backend/node/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion backend/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"lint:fix": "biome check --write"
},
"dependencies": {
"@sumup/sdk": "^0.1.5",
"@sumup/sdk": "^0.1.6",
"express": "^5.2.1"
},
"devDependencies": {
Expand Down
12 changes: 5 additions & 7 deletions backend/python/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from flask import Flask, jsonify, request
from sumup import Sumup
from sumup.readers import CreateReaderBody, CreateReaderCheckoutBody, CreateReaderCheckoutBodyTotalAmount

api_key = os.environ.get("SUMUP_API_KEY")
merchant_code = os.environ.get("SUMUP_MERCHANT_CODE")
Expand All @@ -27,7 +26,7 @@ def parse_amount(value):
if amount <= 0:
return None

return CreateReaderCheckoutBodyTotalAmount(currency="EUR", minor_unit=2, value=round(amount * 100))
return {"currency": "EUR", "minor_unit": 2, "value": round(amount * 100)}


@app.post("/readers")
Expand All @@ -41,7 +40,8 @@ def create_reader():

reader = client.readers.create(
merchant_code,
body=CreateReaderBody(pairing_code=pairing_code, name=name),
pairing_code=pairing_code,
name=name,
)

if hasattr(reader, "model_dump"):
Expand Down Expand Up @@ -75,10 +75,8 @@ def create_reader_checkout(reader_id):
checkout = client.readers.create_checkout(
merchant_code,
reader_id,
body=CreateReaderCheckoutBody(
total_amount=total_amount,
description="Card reader checkout",
),
total_amount=total_amount,
description="Card reader checkout",
)

if hasattr(checkout, "model_dump"):
Expand Down
2 changes: 1 addition & 1 deletion backend/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description = "SumUp Python example"
requires-python = ">=3.10"
dependencies = [
"flask",
"sumup",
"sumup==0.2.2",
]

[tool.uv]
8 changes: 4 additions & 4 deletions backend/python/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading