From cff0830acfac8894c7e4f12f963ffcc5a63ffdf3 Mon Sep 17 00:00:00 2001 From: appscisumup Date: Tue, 31 Mar 2026 06:47:47 +0000 Subject: [PATCH 1/4] chore: synced local 'openapi.json' with remote 'specs/openapi.json' --- openapi.json | 58 ++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 52 insertions(+), 6 deletions(-) diff --git a/openapi.json b/openapi.json index fb9740d..e2bd9d5 100755 --- a/openapi.json +++ b/openapi.json @@ -6474,7 +6474,9 @@ "boleto", "ideal", "blik", - "bancontact" + "bancontact", + "google_pay", + "apple_pay" ] }, "installments": { @@ -6489,6 +6491,50 @@ "card": { "$ref": "#/components/schemas/Card" }, + "google_pay": { + "description": "Raw `PaymentData` object received from Google Pay. Send the Google Pay response payload as-is.", + "type": "object", + "example": { + "apiVersionMinor": 0, + "apiVersion": 2, + "paymentMethodData": { + "description": "Visa •••• 1111", + "tokenizationData": { + "type": "PAYMENT_GATEWAY", + "token": "token-data" + }, + "type": "CARD", + "info": { + "cardNetwork": "VISA", + "cardDetails": "1111" + } + } + } + }, + "apple_pay": { + "description": "Raw payment token object received from Apple Pay. Send the Apple Pay response payload as-is.", + "type": "object", + "example": { + "token": { + "paymentData": { + "data": "si2xuT2ArQo689SfE-long-token", + "signature": "MIAGCSqGSIb3DQEHA-long-signature", + "header": { + "publicKeyHash": "PWfjDi3TSwgZ20TY/A7f3V6J/1rhHyRDCspbeljM0io=", + "ephemeralPublicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEaBtz7UN2MNV0qInJVEEhXy10PU0KfO6KxFjXm93oKWL6lCsxZZGDl/EKioUHVSlKgpsKGin0xvgldfxeJVgy0g==", + "transactionId": "62e0568bc9258e9d0e059d745650fc8211d05ef7a7a1589a6411bf9b12cdfd04" + }, + "version": "EC_v1" + }, + "paymentMethod": { + "displayName": "MasterCard 8837", + "network": "MasterCard", + "type": "debit" + }, + "transactionIdentifier": "62E0568BC9258E9D0E059D745650FC8211D05EF7A7A1589A6411BF9B12CDFD04" + } + } + }, "token": { "description": "__Required when using a tokenized card to process a checkout.__ Unique token identifying the saved payment card for a customer.", "type": "string" @@ -8848,7 +8894,7 @@ "description": "The company's legal name.", "type": "string", "example": "Gin & Doughnuts Bar GmbH", - "maxLength": 512, + "maxLength": 150, "minLength": 1 }, "merchant_category_code": { @@ -8908,7 +8954,7 @@ "description": "The customer-facing business name.", "type": "string", "example": "Example Coffee", - "maxLength": 512, + "maxLength": 150, "minLength": 1 }, "dynamic_descriptor": { @@ -8924,13 +8970,13 @@ "type": "string", "format": "uri", "example": "https://example.com", - "maxLength": 512 + "maxLength": 255 }, "email": { "description": "A publicly available email address.", "type": "string", "example": "contact@example.com", - "maxLength": 256 + "maxLength": 255 }, "phone_number": { "$ref": "#/components/schemas/PhoneNumber" @@ -8954,7 +9000,7 @@ "description": "A publicly available phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format.\n", "type": "string", "example": "+420123456789", - "maxLength": 64 + "maxLength": 16 }, "Branding": { "description": "Settings used to apply the Merchant's branding to email receipts, invoices, checkouts, and other products.", From 8ed656159817ed89b6ed9dd63adc8816a6e56c1b Mon Sep 17 00:00:00 2001 From: "sumup-bot[bot]" <241716704+sumup-bot[bot]@users.noreply.github.com> Date: Tue, 31 Mar 2026 06:49:02 +0000 Subject: [PATCH 2/4] chore: generate code --- sumup/checkouts/__init__.py | 4 ++++ sumup/checkouts/resource.py | 24 ++++++++++++++++++++- sumup/types/__init__.py | 42 ++++++++++++++++++++++++++++--------- 3 files changed, 59 insertions(+), 11 deletions(-) diff --git a/sumup/checkouts/__init__.py b/sumup/checkouts/__init__.py index d001b27..b847238 100755 --- a/sumup/checkouts/__init__.py +++ b/sumup/checkouts/__init__.py @@ -5,6 +5,8 @@ CreateCheckoutBodyPurpose, CreateCheckoutBody, ProcessCheckoutBodyPaymentType, + ProcessCheckoutBodyGooglePay, + ProcessCheckoutBodyApplePay, ProcessCheckoutBody, GetPaymentMethodsParams, ListCheckoutsParams, @@ -43,6 +45,8 @@ "CreateCheckoutBodyPurpose", "CreateCheckoutBody", "ProcessCheckoutBodyPaymentType", + "ProcessCheckoutBodyGooglePay", + "ProcessCheckoutBodyApplePay", "ProcessCheckoutBody", "GetPaymentMethodsParams", "ListCheckoutsParams", diff --git a/sumup/checkouts/resource.py b/sumup/checkouts/resource.py index 92c2092..898ff6e 100755 --- a/sumup/checkouts/resource.py +++ b/sumup/checkouts/resource.py @@ -79,10 +79,22 @@ class CreateCheckoutBody(pydantic.BaseModel): ProcessCheckoutBodyPaymentType = typing.Union[ - typing.Literal["bancontact", "blik", "boleto", "card", "ideal"], str + typing.Literal["apple_pay", "bancontact", "blik", "boleto", "card", "google_pay", "ideal"], str ] +class ProcessCheckoutBodyGooglePay(pydantic.BaseModel): + """ + Raw `PaymentData` object received from Google Pay. Send the Google Pay response payload as-is. + """ + + +class ProcessCheckoutBodyApplePay(pydantic.BaseModel): + """ + Raw payment token object received from Apple Pay. Send the Apple Pay response payload as-is. + """ + + class ProcessCheckoutBody(pydantic.BaseModel): """ Details of the payment instrument for processing the checkout. @@ -93,6 +105,11 @@ class ProcessCheckoutBody(pydantic.BaseModel): Describes the payment method used to attempt processing """ + apple_pay: typing.Optional[ProcessCheckoutBodyApplePay] = None + """ + Raw payment token object received from Apple Pay. Send the Apple Pay response payload as-is. + """ + card: typing.Optional[Card] = None """ __Required when payment type is `card`.__ Details of the payment card. @@ -103,6 +120,11 @@ class ProcessCheckoutBody(pydantic.BaseModel): __Required when `token` is provided.__ Unique ID of the customer. """ + google_pay: typing.Optional[ProcessCheckoutBodyGooglePay] = None + """ + Raw `PaymentData` object received from Google Pay. Send the Google Pay response payload as-is. + """ + installments: typing.Optional[int] = None """ Number of installments for deferred payments. Available only to merchant users in Brazil. diff --git a/sumup/types/__init__.py b/sumup/types/__init__.py index 3851e02..9237d84 100755 --- a/sumup/types/__init__.py +++ b/sumup/types/__init__.py @@ -562,7 +562,7 @@ class PersonalIdentifier(pydantic.BaseModel): """ A publicly available phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format. -Max length: 64 +Max length: 16 """ Version = str @@ -655,7 +655,7 @@ class BasePerson(pydantic.BaseModel): phone_number: typing.Optional[PhoneNumber] = None """ A publicly available phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format. - Max length: 64 + Max length: 16 """ relationships: typing.Optional[list[str]] = None @@ -796,27 +796,27 @@ class BusinessProfile(pydantic.BaseModel): email: typing.Optional[str] = None """ A publicly available email address. - Max length: 256 + Max length: 255 """ name: typing.Optional[str] = None """ The customer-facing business name. Min length: 1 - Max length: 512 + Max length: 150 """ phone_number: typing.Optional[PhoneNumber] = None """ A publicly available phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format. - Max length: 64 + Max length: 16 """ website: typing.Optional[str] = None """ The business's publicly available website. Format: uri - Max length: 512 + Max length: 255 """ @@ -1677,13 +1677,13 @@ class Company(pydantic.BaseModel): """ The company's legal name. Min length: 1 - Max length: 512 + Max length: 150 """ phone_number: typing.Optional[PhoneNumber] = None """ A publicly available phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format. - Max length: 64 + Max length: 16 """ trading_address: typing.Optional[Address] = None @@ -2448,7 +2448,7 @@ class Person(pydantic.BaseModel): phone_number: typing.Optional[PhoneNumber] = None """ A publicly available phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format. - Max length: 64 + Max length: 16 """ relationships: typing.Optional[list[str]] = None @@ -3355,10 +3355,22 @@ def additional_properties(self, value: dict[str, object]) -> None: ProcessCheckoutPaymentType = typing.Union[ - typing.Literal["bancontact", "blik", "boleto", "card", "ideal"], str + typing.Literal["apple_pay", "bancontact", "blik", "boleto", "card", "google_pay", "ideal"], str ] +class ProcessCheckoutGooglePay(pydantic.BaseModel): + """ + Raw `PaymentData` object received from Google Pay. Send the Google Pay response payload as-is. + """ + + +class ProcessCheckoutApplePay(pydantic.BaseModel): + """ + Raw payment token object received from Apple Pay. Send the Apple Pay response payload as-is. + """ + + class ProcessCheckout(pydantic.BaseModel): """ Details of the payment instrument for processing the checkout. @@ -3369,6 +3381,11 @@ class ProcessCheckout(pydantic.BaseModel): Describes the payment method used to attempt processing """ + apple_pay: typing.Optional[ProcessCheckoutApplePay] = None + """ + Raw payment token object received from Apple Pay. Send the Apple Pay response payload as-is. + """ + card: typing.Optional[Card] = None """ __Required when payment type is `card`.__ Details of the payment card. @@ -3379,6 +3396,11 @@ class ProcessCheckout(pydantic.BaseModel): __Required when `token` is provided.__ Unique ID of the customer. """ + google_pay: typing.Optional[ProcessCheckoutGooglePay] = None + """ + Raw `PaymentData` object received from Google Pay. Send the Google Pay response payload as-is. + """ + installments: typing.Optional[int] = None """ Number of installments for deferred payments. Available only to merchant users in Brazil. From 92ea8a898e4667dd3bb5f6da863323e613929ecd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matou=C5=A1=20Dzivjak?= Date: Tue, 31 Mar 2026 09:08:09 +0200 Subject: [PATCH 3/4] feat: handle free-form schemas --- codegen/pkg/builder/transform.go | 8 ++++++++ sumup/checkouts/resource.py | 17 ++++++++--------- sumup/types/__init__.py | 17 ++++++++--------- 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/codegen/pkg/builder/transform.go b/codegen/pkg/builder/transform.go index b9ff6c5..20069c6 100644 --- a/codegen/pkg/builder/transform.go +++ b/codegen/pkg/builder/transform.go @@ -338,6 +338,14 @@ func (b *Builder) createObject(schema *base.Schema, name string) (Writable, []Wr } } + // Treat an object without declared properties or additionalProperties as an + // open-ended payload. Some APIs use this to signal "send the provider payload + // as-is", and generating an empty BaseModel would otherwise reject all keys. + if !hasProperties && !hasAdditionalProperties { + hasAdditionalProperties = true + additionalPropertyType = "object" + } + if !hasProperties && hasAdditionalProperties { return &TypeAlias{ Comment: schemaDoc(name, schema), diff --git a/sumup/checkouts/resource.py b/sumup/checkouts/resource.py index 898ff6e..16d4067 100755 --- a/sumup/checkouts/resource.py +++ b/sumup/checkouts/resource.py @@ -83,16 +83,15 @@ class CreateCheckoutBody(pydantic.BaseModel): ] -class ProcessCheckoutBodyGooglePay(pydantic.BaseModel): - """ - Raw `PaymentData` object received from Google Pay. Send the Google Pay response payload as-is. - """ - +ProcessCheckoutBodyGooglePay = dict[str, object] +""" +Raw `PaymentData` object received from Google Pay. Send the Google Pay response payload as-is. +""" -class ProcessCheckoutBodyApplePay(pydantic.BaseModel): - """ - Raw payment token object received from Apple Pay. Send the Apple Pay response payload as-is. - """ +ProcessCheckoutBodyApplePay = dict[str, object] +""" +Raw payment token object received from Apple Pay. Send the Apple Pay response payload as-is. +""" class ProcessCheckoutBody(pydantic.BaseModel): diff --git a/sumup/types/__init__.py b/sumup/types/__init__.py index 9237d84..4a75bf5 100755 --- a/sumup/types/__init__.py +++ b/sumup/types/__init__.py @@ -3359,16 +3359,15 @@ def additional_properties(self, value: dict[str, object]) -> None: ] -class ProcessCheckoutGooglePay(pydantic.BaseModel): - """ - Raw `PaymentData` object received from Google Pay. Send the Google Pay response payload as-is. - """ - +ProcessCheckoutGooglePay = dict[str, object] +""" +Raw `PaymentData` object received from Google Pay. Send the Google Pay response payload as-is. +""" -class ProcessCheckoutApplePay(pydantic.BaseModel): - """ - Raw payment token object received from Apple Pay. Send the Apple Pay response payload as-is. - """ +ProcessCheckoutApplePay = dict[str, object] +""" +Raw payment token object received from Apple Pay. Send the Apple Pay response payload as-is. +""" class ProcessCheckout(pydantic.BaseModel): From 2ec9ea74c65c4f0400e624ccd0d74760ca40fcfa Mon Sep 17 00:00:00 2001 From: "sumup-bot[bot]" <241716704+sumup-bot[bot]@users.noreply.github.com> Date: Tue, 31 Mar 2026 07:09:38 +0000 Subject: [PATCH 4/4] chore: generate code --- sumup/checkouts/__init__.py | 4 ---- sumup/checkouts/resource.py | 1 - sumup/types/__init__.py | 9 ++++----- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/sumup/checkouts/__init__.py b/sumup/checkouts/__init__.py index b847238..d001b27 100755 --- a/sumup/checkouts/__init__.py +++ b/sumup/checkouts/__init__.py @@ -5,8 +5,6 @@ CreateCheckoutBodyPurpose, CreateCheckoutBody, ProcessCheckoutBodyPaymentType, - ProcessCheckoutBodyGooglePay, - ProcessCheckoutBodyApplePay, ProcessCheckoutBody, GetPaymentMethodsParams, ListCheckoutsParams, @@ -45,8 +43,6 @@ "CreateCheckoutBodyPurpose", "CreateCheckoutBody", "ProcessCheckoutBodyPaymentType", - "ProcessCheckoutBodyGooglePay", - "ProcessCheckoutBodyApplePay", "ProcessCheckoutBody", "GetPaymentMethodsParams", "ListCheckoutsParams", diff --git a/sumup/checkouts/resource.py b/sumup/checkouts/resource.py index 16d4067..7426874 100755 --- a/sumup/checkouts/resource.py +++ b/sumup/checkouts/resource.py @@ -82,7 +82,6 @@ class CreateCheckoutBody(pydantic.BaseModel): typing.Literal["apple_pay", "bancontact", "blik", "boleto", "card", "google_pay", "ideal"], str ] - ProcessCheckoutBodyGooglePay = dict[str, object] """ Raw `PaymentData` object received from Google Pay. Send the Google Pay response payload as-is. diff --git a/sumup/types/__init__.py b/sumup/types/__init__.py index 4a75bf5..c238684 100755 --- a/sumup/types/__init__.py +++ b/sumup/types/__init__.py @@ -3358,7 +3358,6 @@ def additional_properties(self, value: dict[str, object]) -> None: typing.Literal["apple_pay", "bancontact", "blik", "boleto", "card", "google_pay", "ideal"], str ] - ProcessCheckoutGooglePay = dict[str, object] """ Raw `PaymentData` object received from Google Pay. Send the Google Pay response payload as-is. @@ -3988,10 +3987,10 @@ class ReceiptTransaction(pydantic.BaseModel): """ -class ReceiptEmvData(pydantic.BaseModel): - """ - EMV-specific metadata returned for card-present payments. - """ +ReceiptEmvData = dict[str, object] +""" +EMV-specific metadata returned for card-present payments. +""" class ReceiptAcquirerData(pydantic.BaseModel):