From 9ae8a493a0316dd81e2396f40d4d0cc38ab7b238 Mon Sep 17 00:00:00 2001 From: "sumup-release-bot[bot]" <241716704+sumup-release-bot[bot]@users.noreply.github.com> Date: Fri, 11 Sep 2026 13:01:06 +0000 Subject: [PATCH] chore: update Python code samples for v0.3.4 --- src/codesamples/python.json | 58 ++++++++++++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 4 deletions(-) diff --git a/src/codesamples/python.json b/src/codesamples/python.json index a4505df4..6fc4ee0b 100644 --- a/src/codesamples/python.json +++ b/src/codesamples/python.json @@ -3,7 +3,7 @@ "language": "python", "sdk": { "module": "sumup", - "version": "0.3.3" + "version": "0.3.4" }, "openAPIVersion": "1.0.0", "samples": [ @@ -189,7 +189,7 @@ "description": "Returns a Merchant for a valid Merchant code.", "httpMethod": "GET", "path": "/v1/merchants/{merchant_code}", - "sample": "import os\n\nimport sumup\n\nclient = sumup.Sumup(api_key=os.environ[\"SUMUP_API_KEY\"])\nresult = client.merchants.get(\n \"MK10CL2A\",\n version=\"latest\",\n)\nprint(result)\n" + "sample": "import os\n\nimport sumup\n\nclient = sumup.Sumup(api_key=os.environ[\"SUMUP_API_KEY\"])\nresult = client.merchants.get(\n \"MK10CL2A\",\n)\nprint(result)\n" }, { "id": "GetMerchantMember", @@ -225,7 +225,7 @@ "description": "Returns a single Person related to a Merchant.", "httpMethod": "GET", "path": "/v1/merchants/{merchant_code}/persons/{person_id}", - "sample": "import os\n\nimport sumup\n\nclient = sumup.Sumup(api_key=os.environ[\"SUMUP_API_KEY\"])\nresult = client.merchants.get_person(\n \"MK10CL2A\",\n \"pers_5AKFHN2KSK8D3TS79DJE3P3A2Z\",\n version=\"latest\",\n)\nprint(result)\n" + "sample": "import os\n\nimport sumup\n\nclient = sumup.Sumup(api_key=os.environ[\"SUMUP_API_KEY\"])\nresult = client.merchants.get_person(\n \"MK10CL2A\",\n \"pers_5AKFHN2KSK8D3TS79DJE3P3A2Z\",\n)\nprint(result)\n" }, { "id": "GetReader", @@ -333,7 +333,7 @@ "description": "Returns the Persons related to a Merchant.", "httpMethod": "GET", "path": "/v1/merchants/{merchant_code}/persons", - "sample": "import os\n\nimport sumup\n\nclient = sumup.Sumup(api_key=os.environ[\"SUMUP_API_KEY\"])\nresult = client.merchants.list_persons(\n \"MK10CL2A\",\n version=\"latest\",\n)\nprint(result)\n" + "sample": "import os\n\nimport sumup\n\nclient = sumup.Sumup(api_key=os.environ[\"SUMUP_API_KEY\"])\nresult = client.merchants.list_persons(\n \"MK10CL2A\",\n)\nprint(result)\n" }, { "id": "ListReaders", @@ -353,6 +353,56 @@ "path": "/v2.1/merchants/{merchant_code}/transactions/history", "sample": "import os\n\nimport sumup\n\nclient = sumup.Sumup(api_key=os.environ[\"SUMUP_API_KEY\"])\nresult = client.transactions.list(\n \"MH4H92C7\",\n transaction_code=\"TEENSK4W2K\",\n order=\"ascending\",\n limit=10,\n users=[\n \"merchant@example.com\",\n ],\n statuses=[\n \"SUCCESSFUL\",\n \"REFUNDED\",\n ],\n payment_types=[\n \"ECOM\",\n \"POS\",\n ],\n entry_modes=[\n \"CUSTOMER_ENTRY\",\n \"CHIP\",\n ],\n types=[\n \"PAYMENT\",\n \"REFUND\",\n ],\n changes_since=\"2019-08-28T09:00:00Z\",\n newest_time=\"2019-08-29T09:00:00Z\",\n newest_ref=\"090df9bf-93b7-40f1-8181-fbdb236568a1\",\n oldest_time=\"2019-08-28T09:00:00Z\",\n oldest_ref=\"090df9bf-93b7-40f1-8181-fbdb236568a1\",\n)\nprint(result)\n" }, + { + "id": "ProcessCheckout.ProcessBancontact", + "operationId": "ProcessCheckout", + "example": "ProcessBancontact", + "summary": "Process a checkout", + "description": "Process a checkout with Bancontact", + "httpMethod": "PUT", + "path": "/v0.1/checkouts/{checkout_id}", + "sample": "import os\n\nimport sumup\n\nclient = sumup.Sumup(api_key=os.environ[\"SUMUP_API_KEY\"])\nresult = client.checkouts.process(\n \"4e425463-3e1b-431d-83fa-1e51c2925e99\",\n payment_type=\"bancontact\",\n personal_details={\n \"address\": {\n \"country\": \"BE\",\n },\n \"email\": \"user@example.com\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n },\n)\nprint(result)\n" + }, + { + "id": "ProcessCheckout.ProcessBoleto", + "operationId": "ProcessCheckout", + "example": "ProcessBoleto", + "summary": "Process a checkout", + "description": "Process a checkout with Boleto", + "httpMethod": "PUT", + "path": "/v0.1/checkouts/{checkout_id}", + "sample": "import os\n\nimport sumup\n\nclient = sumup.Sumup(api_key=os.environ[\"SUMUP_API_KEY\"])\nresult = client.checkouts.process(\n \"4e425463-3e1b-431d-83fa-1e51c2925e99\",\n payment_type=\"boleto\",\n personal_details={\n \"address\": {\n \"city\": \"São Paulo\",\n \"country\": \"BR\",\n \"line1\": \"Rua Gilberto Sabino, 215\",\n \"postal_code\": \"05425-020\",\n \"state\": \"SP\",\n },\n \"email\": \"user@example.com\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"tax_id\": \"423.378.593-47\",\n },\n)\nprint(result)\n" + }, + { + "id": "ProcessCheckout.ProcessCard", + "operationId": "ProcessCheckout", + "example": "ProcessCard", + "summary": "Process a checkout", + "description": "Process a checkout with a card", + "httpMethod": "PUT", + "path": "/v0.1/checkouts/{checkout_id}", + "sample": "import os\n\nimport sumup\n\nclient = sumup.Sumup(api_key=os.environ[\"SUMUP_API_KEY\"])\nresult = client.checkouts.process(\n \"4e425463-3e1b-431d-83fa-1e51c2925e99\",\n payment_type=\"card\",\n installments=1,\n mandate={\n \"type\": \"recurrent\",\n \"user_agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.104 Safari/537.36\",\n \"user_ip\": \"172.217.169.174\",\n },\n card={\n \"cvv\": \"123\",\n \"expiry_month\": \"01\",\n \"expiry_year\": \"2023\",\n \"name\": \"John Doe\",\n \"number\": \"1234567890123456\",\n \"type\": \"VISA\",\n \"zip_code\": \"12345\",\n },\n)\nprint(result)\n" + }, + { + "id": "ProcessCheckout.ProcessToken", + "operationId": "ProcessCheckout", + "example": "ProcessToken", + "summary": "Process a checkout", + "description": "Process a checkout with a token", + "httpMethod": "PUT", + "path": "/v0.1/checkouts/{checkout_id}", + "sample": "import os\n\nimport sumup\n\nclient = sumup.Sumup(api_key=os.environ[\"SUMUP_API_KEY\"])\nresult = client.checkouts.process(\n \"4e425463-3e1b-431d-83fa-1e51c2925e99\",\n payment_type=\"card\",\n installments=1,\n token=\"ba85dfee-c3cf-48a6-84f5-d7d761fbba50\",\n customer_id=\"MEDKHDTI\",\n)\nprint(result)\n" + }, + { + "id": "ProcessCheckout.ProcessiDeal", + "operationId": "ProcessCheckout", + "example": "ProcessiDeal", + "summary": "Process a checkout", + "description": "Process a checkout with iDeal", + "httpMethod": "PUT", + "path": "/v0.1/checkouts/{checkout_id}", + "sample": "import os\n\nimport sumup\n\nclient = sumup.Sumup(api_key=os.environ[\"SUMUP_API_KEY\"])\nresult = client.checkouts.process(\n \"4e425463-3e1b-431d-83fa-1e51c2925e99\",\n payment_type=\"ideal\",\n personal_details={\n \"address\": {\n \"country\": \"NL\",\n },\n \"email\": \"user@example.com\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n },\n)\nprint(result)\n" + }, { "id": "RefundTransaction", "operationId": "RefundTransaction",