From 1b8e4f89b27ade225130d440911600772dc8f0fe Mon Sep 17 00:00:00 2001 From: appscisumup Date: Sat, 5 Sep 2026 11:02:42 +0000 Subject: [PATCH 1/2] chore: synced local 'openapi.json' with remote 'specs/openapi31.json' --- openapi.json | 1210 ++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 1072 insertions(+), 138 deletions(-) mode change 100755 => 100644 openapi.json diff --git a/openapi.json b/openapi.json old mode 100755 new mode 100644 index fcbcfc7..f514d26 --- a/openapi.json +++ b/openapi.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.3", + "openapi": "3.1.0", "info": { "title": "SumUp REST API", "version": "1.0.0", @@ -855,6 +855,451 @@ } } }, + "put": { + "operationId": "ProcessCheckout", + "summary": "Process a checkout", + "description": ":::caution[PCI DSS compliance required]\nWhen you submit raw card details directly to the Checkout API, your systems store, process, or transmit cardholder data and are therefore subject to applicable [PCI DSS requirements](https://www.pcisecuritystandards.org/document_library/). You should only use this integration if your environment is appropriately PCI DSS compliant.\n:::\n\nProcessing a checkout will attempt to charge the provided payment instrument for the amount of the specified checkout resource initiated in the `Create a checkout` endpoint.\n\nFollow this request with `Retrieve a checkout` to confirm its status.", + "tags": [ + "Checkouts" + ], + "security": [ + { + "apiKey": [] + }, + { + "oauth2": [ + "payments", + "checkouts.write" + ] + } + ], + "x-codegen": { + "method_name": "process" + }, + "x-scopes": [ + "payments", + "checkouts.write" + ], + "requestBody": { + "required": true, + "description": "Details of the payment instrument for processing the checkout.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProcessCheckout" + }, + "examples": { + "ProcessCard": { + "description": "Process a checkout with a card", + "value": { + "payment_type": "card", + "installments": 1, + "mandate": { + "type": "recurrent", + "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", + "user_ip": "172.217.169.174" + }, + "card": { + "type": "VISA", + "name": "John Doe", + "number": "1234567890123456", + "expiry_year": "2023", + "expiry_month": "01", + "cvv": "123", + "zip_code": "12345" + } + } + }, + "ProcessToken": { + "description": "Process a checkout with a token", + "value": { + "payment_type": "card", + "installments": 1, + "token": "ba85dfee-c3cf-48a6-84f5-d7d761fbba50", + "customer_id": "MEDKHDTI" + } + }, + "ProcessBoleto": { + "description": "Process a checkout with Boleto", + "value": { + "payment_type": "boleto", + "personal_details": { + "email": "user@example.com", + "first_name": "John", + "last_name": "Doe", + "tax_id": "423.378.593-47", + "address": { + "country": "BR", + "city": "São Paulo", + "line1": "Rua Gilberto Sabino, 215", + "state": "SP", + "postal_code": "05425-020" + } + } + } + }, + "ProcessiDeal": { + "description": "Process a checkout with iDeal", + "value": { + "payment_type": "ideal", + "personal_details": { + "email": "user@example.com", + "first_name": "John", + "last_name": "Doe", + "address": { + "country": "NL" + } + } + } + }, + "ProcessBancontact": { + "description": "Process a checkout with Bancontact", + "value": { + "payment_type": "bancontact", + "personal_details": { + "email": "user@example.com", + "first_name": "John", + "last_name": "Doe", + "address": { + "country": "BE" + } + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns the checkout resource after a processing attempt.", + "content": { + "application/json": { + "schema": { + "title": "Checkout Success", + "description": "Checkout resource returned after a synchronous processing attempt. In addition to the base checkout fields, it can include the resulting transaction identifiers and any newly created payment instrument token.", + "allOf": [ + { + "$ref": "#/components/schemas/Checkout" + }, + { + "type": "object", + "properties": { + "transaction_code": { + "type": "string", + "description": "Transaction code of the successful transaction with which the payment for the checkout is completed.", + "readOnly": true, + "example": "TEENSK4W2K" + }, + "transaction_id": { + "type": "string", + "description": "Unique identifier of the successful transaction that completed payment for the checkout.", + "readOnly": true, + "example": "410fc44a-5956-44e1-b5cc-19c6f8d727a4" + }, + "merchant_name": { + "type": "string", + "description": "Name of the merchant.", + "example": "Sample Merchant" + }, + "redirect_url": { + "type": "string", + "example": "https://mysite.com/completed_purchase", + "description": "URL where the payer is redirected after a redirect-based payment or SCA flow completes." + }, + "payment_instrument": { + "type": "object", + "description": "Details of the saved payment instrument created or reused during checkout processing.", + "properties": { + "token": { + "type": "string", + "description": "Unique token of the saved payment instrument.", + "example": "e76d7e5c-9375-4fac-a7e7-b19dc5302fbc" + } + } + } + } + } + ] + }, + "examples": { + "CheckoutSuccessCard": { + "description": "Successfully processed checkout with a card", + "value": { + "checkout_reference": "f00a8f74-b05d-4605-bd73-2a901bae5802", + "amount": 10.1, + "currency": "EUR", + "merchant_code": "MH4H92C7", + "description": "Purchase", + "return_url": "http://example.com", + "id": "4e425463-3e1b-431d-83fa-1e51c2925e99", + "status": "PENDING", + "date": "2020-02-29T10:56:56+00:00", + "valid_until": "2020-02-29T10:56:56+00:00", + "customer_id": "831ff8d4cd5958ab5670", + "mandate": { + "type": "recurrent", + "status": "active", + "merchant_code": "MH4H92C7" + }, + "transactions": [ + { + "id": "410fc44a-5956-44e1-b5cc-19c6f8d727a4", + "transaction_code": "TEENSK4W2K", + "amount": 10.1, + "currency": "EUR", + "timestamp": "2020-02-29T10:56:56.876Z", + "status": "SUCCESSFUL", + "payment_type": "ECOM", + "installments_count": 1, + "merchant_code": "MH4H92C7", + "vat_amount": 6, + "tip_amount": 3, + "entry_mode": "CUSTOMER_ENTRY", + "auth_code": "053201" + } + ], + "transaction_code": "TEENSK4W2K", + "transaction_id": "410fc44a-5956-44e1-b5cc-19c6f8d727a4" + } + }, + "CheckoutSuccessToken": { + "description": "Successfully processed checkout with a token", + "value": { + "checkout_reference": "f00a8f74-b05d-4605-bd73-2a901bae5802", + "amount": 10.1, + "currency": "EUR", + "merchant_code": "MH4H92C7", + "description": "Purchase with token", + "id": "4e425463-3e1b-431d-83fa-1e51c2925e99", + "status": "PENDING", + "date": "2020-02-29T10:56:56+00:00", + "transaction_code": "TEENSK4W2K", + "transaction_id": "410fc44a-5956-44e1-b5cc-19c6f8d727a4", + "merchant_name": "Sample Merchant", + "redirect_url": "https://mysite.com/completed_purchase", + "customer_id": "831ff8d4cd5958ab5670", + "payment_instrument": { + "token": "e76d7e5c-9375-4fac-a7e7-b19dc5302fbc" + }, + "transactions": [ + { + "id": "410fc44a-5956-44e1-b5cc-19c6f8d727a4", + "transaction_code": "TEENSK4W2K", + "amount": 10.1, + "currency": "EUR", + "timestamp": "2020-02-29T10:56:56.876Z", + "status": "SUCCESSFUL", + "payment_type": "ECOM", + "installments_count": 1, + "merchant_code": "MH4H92C7", + "vat_amount": 6, + "tip_amount": 3, + "entry_mode": "CUSTOMER_ENTRY", + "auth_code": "053201" + } + ] + } + }, + "CheckoutSuccessBoleto": { + "description": "Successfully processed checkout with Boleto", + "value": { + "checkout_reference": "f00a8f74-b05d-4605-bd73-2a901bae5802", + "amount": 10.1, + "currency": "BRL", + "merchant_code": "MH4H92C7", + "description": "Boleto checkout", + "id": "4e425463-3e1b-431d-83fa-1e51c2925e99", + "status": "PENDING", + "date": "2021-07-06T12:34:02.000+00:00", + "merchant_name": "Sample shop", + "boleto": { + "barcode": "34191090081790614310603072340007886840000000200", + "url": "https://checkouts.sample.com/v0.1/checkouts/2e7a36cc-7897-446b-a966-952ab5f049ea/boleto" + }, + "redirect_url": "https://website.com", + "purpose": "CHECKOUT", + "transactions": [ + { + "id": "debd2986-9852-4e86-8a8e-7ea9c87dd679", + "transaction_code": "TEN3E696NP", + "merchant_code": "MH4H92C9", + "amount": 10.1, + "vat_amount": 6, + "tip_amount": 3, + "currency": "BRL", + "timestamp": "2021-07-06T12:34:16.460+00:00", + "status": "PENDING", + "payment_type": "BOLETO", + "entry_mode": "BOLETO", + "installments_count": 1 + } + ] + } + }, + "CheckoutSuccessiDeal": { + "description": "Successfully processed checkout with iDeal", + "value": { + "next_step": { + "url": "https://r3.girogate.de/ti/simideal", + "method": "GET", + "payload": { + "tx": "961473700", + "rs": "ILnaUeQTKJ184fVrjGILrLjePX9E4rmz", + "cs": "c8bc0ea231f8372431ca22d6f8319f8de0263d0b1705759ed27155f245f193c5" + }, + "full": "https://r3.girogate.de/ti/simideal?tx=961473700\u0026rs=ILnaUeQTKJ184fVrjGILrLjePX9E4rmz\u0026cs=c8bc0ea231f8372431ca22d6f8319f8de0263d0b1705759ed27155f245f193c5", + "mechanism": [ + "browser" + ] + } + } + }, + "CheckoutSuccessBancontact": { + "description": "Successfully processed checkout with Bancontact", + "value": { + "next_step": { + "url": "https://r3.girogate.de/ti/simbcmc", + "method": "GET", + "payload": { + "tx": "624788471", + "rs": "5MioXoKt2Gwj9dLgqAX1bMRBuT5xTSdB", + "cs": "697edacdd9175f3f99542500fa0ff08280b66aaff3c2641a2e212e4b039473cc" + }, + "full": "https://r3.girogate.de/ti/simbcmc?tx=624788471\u0026rs=5MioXoKt2Gwj9dLgqAX1bMRBuT5xTSdB\u0026cs=697edacdd9175f3f99542500fa0ff08280b66aaff3c2641a2e212e4b039473cc", + "mechanism": [ + "browser" + ] + } + } + } + } + } + } + }, + "202": { + "description": "Returns the next required action for asynchronous checkout processing.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CheckoutAccepted" + } + } + } + }, + "400": { + "description": "The request body is invalid for processing the checkout.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ErrorExtended" + }, + { + "type": "array", + "description": "List of error messages.", + "items": { + "$ref": "#/components/schemas/ErrorExtended" + } + } + ] + }, + "examples": { + "Invalid_Parameter": { + "description": "A required parameter has an invalid value.", + "value": { + "message": "Validation error", + "error_code": "INVALID", + "param": "card.expiry_year" + } + }, + "Multiple_Invalid_Parameters": { + "description": "Multiple required parameters have invalid values.", + "value": [ + { + "error_code": "INVALID", + "message": "Validation error", + "param": "card.name" + }, + { + "error_code": "INVALID", + "message": "Validation error", + "param": "card.number" + }, + { + "error_code": "INVALID", + "message": "Validation error", + "param": "card.expiry_year" + } + ] + } + } + } + } + }, + "401": { + "description": "The request is not authorized.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Problem" + }, + "examples": { + "Problem_Details": { + "description": "Unauthorized response returned by API gateway.", + "value": { + "detail": "Unauthorized.", + "status": 401, + "title": "Unauthorized", + "trace_id": "3c77294349d3b5647ea2d990f0d8f017", + "type": "https://developer.sumup.com/problem/unauthorized" + } + } + } + } + } + }, + "404": { + "description": "The requested resource does not exist.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "examples": { + "Not_Found": { + "description": "The identified resource is not found on the server.", + "value": { + "error_code": "NOT_FOUND", + "message": "Resource not found" + } + } + } + } + } + }, + "409": { + "description": "The request conflicts with the current state of the resource.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "examples": { + "Checkout_Processed": { + "description": "The identified checkout resource is already processed.", + "value": { + "error_code": "CHECKOUT_PROCESSED", + "message": "Checkout is already processed" + } + } + } + } + } + } + } + }, "delete": { "operationId": "DeactivateCheckout", "summary": "Deactivate a checkout", @@ -2625,7 +3070,8 @@ }, { "oauth2": [ - "receipts.read" + "receipts.read", + "transactions.history" ] } ], @@ -2633,7 +3079,8 @@ "method_name": "get" }, "x-scopes": [ - "receipts.read" + "receipts.read", + "transactions.history" ], "parameters": [ { @@ -3001,8 +3448,10 @@ "in": "query", "description": "Filter memberships by the parent of the resource the membership is in.\nWhen filtering by parent both `resource.parent.id` and `resource.parent.type` must be present. Pass explicit null to filter for resources without a parent.", "schema": { - "type": "string", - "nullable": true + "type": [ + "string", + "null" + ] } }, { @@ -3010,12 +3459,12 @@ "in": "query", "description": "Filter memberships by the parent of the resource the membership is in.\nWhen filtering by parent both `resource.parent.id` and `resource.parent.type` must be present. Pass explicit null to filter for resources without a parent.", "schema": { - "nullable": true, "allOf": [ { "$ref": "#/components/schemas/ResourceType" } - ] + ], + "type": "null" } }, { @@ -3154,6 +3603,19 @@ "example": "245b2ead-85bf-45ff-856f-311a88a5d454" } }, + { + "name": "user.type", + "in": "query", + "description": "Filter the returned members by user type. Repeat this parameter to include multiple user types.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserType" + } + }, + "style": "form", + "explode": true + }, { "name": "status", "in": "query", @@ -4338,29 +4800,6 @@ "tags": [ "Merchants" ], - "parameters": [ - { - "name": "version", - "description": "The version of the resource. At the moment, the only supported value is `latest`. When provided and the requested resource's `change_status` is pending, the resource will be returned with all pending changes applied. When no changes are pending the resource is returned as is. The `change_status` in the response body will reflect the current state of the resource.\n", - "in": "query", - "schema": { - "type": "string", - "examples": [ - "latest" - ] - } - }, - { - "name": "merchant_code", - "description": "Short unique identifier for the merchant.", - "in": "path", - "required": true, - "schema": { - "type": "string", - "example": "MK10CL2A" - } - } - ], "externalDocs": { "description": "Merchant documentation", "url": "https://developer.sumup.com/tools/models/merchant" @@ -4407,29 +4846,8 @@ } } } - } - } - }, - "/v1/merchants/{merchant_code}/persons": { - "get": { - "operationId": "ListPersons", - "summary": "List Persons", - "description": "Returns the Persons related to a Merchant.", - "tags": [ - "Merchants" - ], + }, "parameters": [ - { - "name": "version", - "description": "The version of the resource. At the moment, the only supported value is `latest`. When provided and the requested resource's `change_status` is pending, the resource will be returned with all pending changes applied. When no changes are pending the resource is returned as is. The `change_status` in the response body will reflect the current state of the resource.\n", - "in": "query", - "schema": { - "type": "string", - "examples": [ - "latest" - ] - } - }, { "name": "merchant_code", "description": "Short unique identifier for the merchant.", @@ -4440,6 +4858,16 @@ "example": "MK10CL2A" } } + ] + } + }, + "/v1/merchants/{merchant_code}/persons": { + "get": { + "operationId": "ListPersons", + "summary": "List Persons", + "description": "Returns the Persons related to a Merchant.", + "tags": [ + "Merchants" ], "externalDocs": { "description": "Persons documentation", @@ -4487,29 +4915,8 @@ } } } - } - } - }, - "/v1/merchants/{merchant_code}/persons/{person_id}": { - "get": { - "operationId": "GetPerson", - "summary": "Get Person", - "description": "Returns a single Person related to a Merchant.", - "tags": [ - "Merchants" - ], + }, "parameters": [ - { - "name": "version", - "description": "The version of the resource. At the moment, the only supported value is `latest`. When provided and the requested resource's `change_status` is pending, the resource will be returned with all pending changes applied. When no changes are pending the resource is returned as is. The `change_status` in the response body will reflect the current state of the resource.\n", - "in": "query", - "schema": { - "type": "string", - "examples": [ - "latest" - ] - } - }, { "name": "merchant_code", "description": "Short unique identifier for the merchant.", @@ -4519,21 +4926,17 @@ "type": "string", "example": "MK10CL2A" } - }, - { - "name": "person_id", - "description": "Person ID", - "in": "path", - "required": true, - "schema": { - "type": "string", - "example": "pers_5AKFHN2KSK8D3TS79DJE3P3A2Z", - "x-go-type": "merchants.PersonID", - "x-go-type-import": { - "path": "github.com/sumup/merchants/internal/domain/merchants" - } - } } + ] + } + }, + "/v1/merchants/{merchant_code}/persons/{person_id}": { + "get": { + "operationId": "GetPerson", + "summary": "Get Person", + "description": "Returns a single Person related to a Merchant.", + "tags": [ + "Merchants" ], "externalDocs": { "description": "Persons documentation", @@ -4581,7 +4984,29 @@ } } } - } + }, + "parameters": [ + { + "name": "merchant_code", + "description": "Short unique identifier for the merchant.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "example": "MK10CL2A" + } + }, + { + "name": "person_id", + "description": "Person ID", + "in": "path", + "required": true, + "schema": { + "type": "string", + "example": "pers_5AKFHN2KSK8D3TS79DJE3P3A2Z" + } + } + ] } }, "/v0.1/merchants/{merchant_code}/readers": { @@ -5744,6 +6169,68 @@ } } }, + "Card": { + "title": "Card", + "type": "object", + "description": "__Required when payment type is `card`.__ Details of the payment card.", + "properties": { + "name": { + "type": "string", + "description": "Name of the cardholder as it appears on the payment card.", + "writeOnly": true, + "example": "FIRSTNAME LASTNAME" + }, + "number": { + "type": "string", + "description": "Number of the payment card (without spaces).", + "writeOnly": true, + "example": "1234567890123456" + }, + "expiry_year": { + "type": "string", + "description": "Two- or four-digit expiration year in `YY` or `YYYY` format.", + "writeOnly": true, + "pattern": "^[0-9]{2}([0-9]{2})?$", + "example": "2030" + }, + "expiry_month": { + "type": "string", + "description": "Two-digit expiration month, from `01` through `12`.", + "writeOnly": true, + "minLength": 2, + "maxLength": 2, + "pattern": "^(0[1-9]|1[0-2])$", + "example": "12" + }, + "cvv": { + "type": "string", + "description": "Three or four-digit card verification value (security code) of the payment card.", + "writeOnly": true, + "maxLength": 4, + "minLength": 3, + "example": "123" + }, + "zip_code": { + "type": "string", + "description": "Required five-digit ZIP code. Applicable only to merchant users in the USA.", + "writeOnly": true, + "maxLength": 5, + "minLength": 5, + "example": "12345" + }, + "type": { + "$ref": "#/components/schemas/CardType" + } + }, + "required": [ + "name", + "number", + "expiry_month", + "expiry_year", + "cvv", + "type" + ] + }, "CardResponse": { "title": "Card Response", "type": "object", @@ -5896,11 +6383,13 @@ "description": "The timestamp of when the checkout was created." }, "valid_until": { - "type": "string", + "type": [ + "string", + "null" + ], "example": "2020-02-29T10:56:56+00:00", "format": "date-time", - "description": "Optional expiration timestamp. The checkout must be processed before this moment, otherwise it becomes unusable. If omitted, the checkout does not have an explicit expiry time.", - "nullable": true + "description": "Optional expiration timestamp. The checkout must be processed before this moment, otherwise it becomes unusable. If omitted, the checkout does not have an explicit expiry time." }, "customer_id": { "type": "string", @@ -5958,7 +6447,7 @@ "properties": { "checkout_reference": { "type": "string", - "maxLength": 90, + "maxLength": 64, "description": "Merchant-defined reference for the new checkout. It should be unique enough for you to identify the payment attempt in your own systems.", "example": "f00a8f74-b05d-4605-bd73-2a901bae5802" }, @@ -6002,11 +6491,13 @@ ] }, "valid_until": { - "type": "string", + "type": [ + "string", + "null" + ], "example": "2020-02-29T10:56:56+00:00", "format": "date-time", - "description": "Optional expiration timestamp. The checkout must be processed before this moment, otherwise it becomes unusable. If omitted, the checkout does not have an explicit expiry time.", - "nullable": true + "description": "Optional expiration timestamp. The checkout must be processed before this moment, otherwise it becomes unusable. If omitted, the checkout does not have an explicit expiry time." }, "redirect_url": { "type": "string", @@ -6049,19 +6540,115 @@ "description": "Updated merchant-defined reference for the checkout.", "example": "f00a8f74-b05d-4605-bd73-2a901bae5802" }, - "valid_until": { + "valid_until": { + "type": [ + "string", + "null" + ], + "example": "2020-02-29T10:56:56+00:00", + "format": "date-time", + "description": "Updated expiration timestamp. The checkout must be processed before this moment, otherwise it becomes unusable." + }, + "customer_id": { + "type": "string", + "description": "Updated merchant-scoped customer identifier associated with the checkout.", + "example": "831ff8d4cd5958ab5670" + } + } + }, + "ProcessCheckout": { + "title": "Process Checkout", + "type": "object", + "description": "Request body for attempting payment on an existing checkout. The required companion fields depend on the selected `payment_type`, for example card details, saved-card data, or payer information required by a specific payment method.", + "properties": { + "payment_type": { + "type": "string", + "description": "Payment method used for this processing attempt. It determines which additional request fields are required.", + "enum": [ + "card", + "boleto", + "ideal", + "blik", + "bancontact", + "google_pay", + "apple_pay" + ], + "example": "card" + }, + "installments": { + "type": "integer", + "description": "Number of installments for deferred payments. Available only to merchant users in Brazil.", + "minimum": 1, + "maximum": 12, + "example": 1 + }, + "mandate": { + "$ref": "#/components/schemas/MandatePayload" + }, + "card": { + "$ref": "#/components/schemas/Card" + }, + "google_pay": { + "type": "object", + "description": "Raw `PaymentData` object received from Google Pay. Send the Google Pay response payload as-is.", + "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": { + "type": "object", + "description": "Raw payment token object received from Apple Pay. Send the Apple Pay response payload as-is.", + "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": { "type": "string", - "example": "2020-02-29T10:56:56+00:00", - "format": "date-time", - "description": "Updated expiration timestamp. The checkout must be processed before this moment, otherwise it becomes unusable.", - "nullable": true + "description": "Saved-card token to use instead of raw card details when processing with a previously stored payment instrument.", + "example": "ba85dfee-c3cf-48a6-84f5-d7d761fbba50" }, "customer_id": { "type": "string", - "description": "Updated merchant-scoped customer identifier associated with the checkout.", - "example": "831ff8d4cd5958ab5670" + "description": "Customer identifier associated with the saved payment instrument. Required when `token` is provided.", + "example": "MEDKHDTI" + }, + "personal_details": { + "$ref": "#/components/schemas/PersonalDetails" } - } + }, + "required": [ + "payment_type" + ] }, "CheckoutSuccess": { "title": "Checkout Success", @@ -6110,6 +6697,60 @@ } ] }, + "CheckoutAccepted": { + "title": "Checkout Accepted", + "type": "object", + "description": "Response returned when checkout processing requires an additional payer action, such as a 3DS challenge or a redirect to an external payment method page.", + "properties": { + "next_step": { + "type": "object", + "description": "Instructions for the next action the payer or client must take.", + "properties": { + "url": { + "type": "string", + "example": "https://dummy-3ds-gateway.com/cap?RID=1233\u0026VAA=A", + "description": "URL to open or submit in order to continue processing." + }, + "method": { + "type": "string", + "example": "POST", + "description": "HTTP method to use when following the next step." + }, + "redirect_url": { + "type": "string", + "example": "https://mysite.com/completed_purchase", + "description": "Merchant URL where the payer returns after the external flow finishes." + }, + "mechanism": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "iframe", + "browser" + ] + }, + "description": "Allowed presentation mechanisms for the next step. `iframe` means the flow can be embedded, while `browser` means it can be completed through a full-page redirect.", + "example": [ + "iframe" + ] + }, + "payload": { + "type": "object", + "description": "Parameters required to complete the next step. The exact keys depend on the payment provider and flow type.", + "additionalProperties": { + "type": "string" + }, + "example": { + "PaReq": "eJxVUttu2zAM/RXDr4MjyY5dO6BVuE27FZuDZHGG9VGRmMSFb/Wljff1k9KkF0APPCR1eHQouD6WhfWCbZfXVWyzCbUtrGSt8mof25vs3gltq+tFpURRVxjbI3b2NYfs0CLO1yiHFjmk2HVij1auYrsRW1+F0U4qZxfKwJlur4QTYcQcJoIdc+XO2/poc1gmv/GZw3k216MnLpAL1JytPIiq5yDk883Dgk+DwPV9IGcIJbYPc84o1Ye6lHqu5wVA3tJQiRL5eiiHxlqKscSq76xfeZn3qICciiDroerbkYeuvnYBMLQFP/R9MyOkM9cnCoGYJJAPScvBRJ0mOeaKr/6l08XT6jXN7tx0vvHSbOMtsj1dzB9jIKYDlOiRu1omYyy0WDCj0YxFQE55EKWZzj2f6ee9xdCYEcmnwucEaN9bvaeRR1ehFn9BgMdGr0l3aCvfYyAfem9/GENlrz36ufpTBPTv07r8lm3qpPiOo1y/7u+SJImNzacmw5hrX1wt/kRpABBDQ84bJOf16+jLt/gPhUvGGw==", + "MD": "b1a536c0-29b9-11eb-adc1-0242ac120002", + "TermUrl": "https://api.sumup.com/v0.1/checkouts/e552de3b-1777-4c91-bdb8-756967678572/complete_payment" + } + } + } + } + } + }, "Customer": { "type": "object", "title": "Customer", @@ -6467,6 +7108,40 @@ "href" ] }, + "MandatePayload": { + "title": "Mandate Payload", + "type": "object", + "description": "Mandate details used when a checkout should create a reusable card token for future recurring or merchant-initiated payments.", + "properties": { + "type": { + "type": "string", + "description": "Type of mandate to create for the saved payment instrument.", + "enum": [ + "recurrent" + ], + "example": "recurrent" + }, + "user_agent": { + "type": "string", + "description": "Browser or client user agent observed when consent was collected.", + "example": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.104 Safari/537.36" + }, + "user_ip": { + "type": "string", + "description": "IP address of the payer when the mandate was accepted.", + "example": "172.217.169.174" + } + }, + "required": [ + "type", + "user_agent" + ], + "example": { + "type": "recurrent", + "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", + "user_ip": "172.217.169.174" + } + }, "MandateResponse": { "title": "Mandate Response", "type": "object", @@ -8248,6 +8923,17 @@ } } }, + "UserType": { + "type": "string", + "description": "Type of the user account.", + "enum": [ + "user", + "managed_user", + "service_account", + "system_account" + ], + "example": "user" + }, "Metadata": { "description": "Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always submit whole metadata. Maximum of 64 parameters are allowed in the object.", "type": "object", @@ -8261,17 +8947,6 @@ "example": {}, "additionalProperties": true }, - "UserType": { - "type": "string", - "description": "Type of the user account.", - "enum": [ - "user", - "managed_user", - "service_account", - "system_account" - ], - "example": "user" - }, "Address": { "externalDocs": { "description": "Address documentation", @@ -8573,19 +9248,21 @@ "type": "string", "minLength": 1, "maxLength": 30, - "pattern": "^[a-zA-Z0-9 \\-+\\'_.]{0,30}$", + "pattern": "^[a-zA-Z0-9 +'_.-]+$", "description": "The descriptor is the text that your customer sees on their bank account statement.\nThe more recognisable your descriptor is, the less risk you have of receiving disputes (e.g. chargebacks).\n", "example": "Example Coffee" }, "website": { "type": "string", "description": "The business's publicly available website.", + "minLength": 1, "maxLength": 255, "example": "https://example.com" }, "email": { "type": "string", "description": "A publicly available email address.", + "minLength": 1, "maxLength": 255, "example": "contact@example.com" }, @@ -8697,6 +9374,7 @@ "description": "The unique legal type reference as defined in the country SDK. We do not rely on IDs as used by other services. Consumers of this API are expected to use the country SDK to map to any other IDs, translation keys, or descriptions.\n", "minLength": 4, "maxLength": 64, + "pattern": "^[a-z]{2}\\.[a-z_]+$", "examples": [ "de.freiberufler", "br.ltda", @@ -8724,6 +9402,7 @@ "properties": { "ref": { "type": "string", + "pattern": "^[a-z]{2}\\.[a-z_]+$", "description": "The unique reference for the company identifier type as defined in the country SDK.\n", "examples": [ "de.gmbh" @@ -8731,6 +9410,7 @@ }, "value": { "type": "string", + "minLength": 1, "maxLength": 100, "description": "The company identifier value.\n", "examples": [ @@ -8803,24 +9483,27 @@ "type": "string", "format": "date", "description": "The date of birth of the individual, represented as an ISO 8601:2004 [ISO8601‑2004] YYYY-MM-DD format.\n", - "example": "1980-01-12T00:00:00Z" + "example": "1980-01-12" }, "given_name": { "type": "string", "description": "The first name(s) of the individual.", "example": "James Herrald", + "minLength": 1, "maxLength": 60 }, "family_name": { "type": "string", "description": "The last name(s) of the individual.", "example": "Bond", + "minLength": 1, "maxLength": 60 }, "middle_name": { "type": "string", "description": "Middle name(s) of the End-User. Note that in some cultures, people can have multiple middle names; all can be present, with the names being separated by space characters. Also note that in some cultures, middle names are not used.\n", "example": "Maria Sophie", + "minLength": 1, "maxLength": 60 }, "phone_number": { @@ -8854,16 +9537,20 @@ "$ref": "#/components/schemas/CountryCode" }, "nationality": { - "type": "string", - "description": "The Person's nationality. May be an [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code, but legacy data may not conform to this standard.\n", - "nullable": true + "type": [ + "string", + "null" + ], + "pattern": "^[A-Z]{2}$", + "description": "The Person's nationality. May be an [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code, but legacy data may not conform to this standard.\n" }, "country_of_residence": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "An [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code representing the country where the Person resides.\n", - "minLength": 2, - "maxLength": 2, - "nullable": true + "pattern": "^[A-Z]{2}$" }, "version": { "$ref": "#/components/schemas/Version" @@ -8912,6 +9599,7 @@ "website": { "description": "HTTP(S) URL of the company's website.\n", "type": "string", + "minLength": 1, "maxLength": 255, "examples": [ "https://www.sumup.com" @@ -9183,8 +9871,10 @@ "credit", "debit" ], - "nullable": true, - "type": "string" + "type": [ + "string", + "null" + ] }, "checkout_id": { "description": "Unique identifier for the checkout", @@ -9202,18 +9892,24 @@ }, "installments": { "description": "Number of installments for the transaction. Required for some countries.", - "nullable": true, - "type": "integer" + "type": [ + "integer", + "null" + ] }, "payment_failure_reason": { "description": "Payment failure reason", - "nullable": true, - "type": "string" + "type": [ + "string", + "null" + ] }, "payment_status": { "description": "Payment status from payments v2 event", - "nullable": true, - "type": "string" + "type": [ + "string", + "null" + ] }, "payment_type": { "description": "Type of the payment. Required for some countries", @@ -9283,8 +9979,10 @@ "valid_until": { "description": "Checkout expiration timestamp. After this time, the checkout will be automatically cancelled.", "format": "date-time", - "nullable": true, - "type": "string" + "type": [ + "string", + "null" + ] } }, "required": [ @@ -9616,7 +10314,6 @@ }, "affiliate": { "description": "Affiliate metadata for the transaction.\nIt is a field that allow for integrators to track the source of the transaction.\n", - "nullable": true, "properties": { "app_id": { "description": "Application ID of the affiliate.\nIt is a unique identifier for the application and should be set by the integrator in the [Affiliate Keys](https://developer.sumup.com/affiliate-keys) page.\n", @@ -9649,7 +10346,10 @@ "foreign_transaction_id" ], "title": "Affiliate", - "type": "object" + "type": [ + "object", + "null" + ] }, "card_type": { "description": "The card type of the card used for the transaction.\nIs is required only for some countries (e.g: Brazil).\n", @@ -9668,8 +10368,10 @@ "description": "Number of installments for the transaction.\nIt may vary according to the merchant country.\nFor example, in Brazil, the maximum number of installments is 12.\n\nOmit if the merchant country does support installments.\nOtherwise, the checkout will be rejected.\n", "example": 1, "minimum": 1, - "nullable": true, - "type": "integer" + "type": [ + "integer", + "null" + ] }, "return_url": { "description": "Webhook URL to which the payment result will be sent.\nIt must be a HTTPS url.\n", @@ -10175,6 +10877,16 @@ } } }, + "CheckoutProcessAccepted": { + "description": "Returns the next required action for asynchronous checkout processing.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CheckoutAccepted" + } + } + } + }, "Customer": { "description": "Returns the customer resource.", "content": { @@ -10727,5 +11439,227 @@ "description": "Delete the reader." } } + }, + "webhooks": { + "readers.created": { + "post": { + "operationId": "ReaderCreatedWebhook", + "tags": [ + "Readers" + ], + "summary": "Reader created", + "description": "Sent when a reader is paired to a merchant account and becomes available through the Readers API.", + "x-object": { + "$ref": "#/components/schemas/Reader" + }, + "x-object-type": "reader", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Event" + }, + "examples": { + "created": { + "summary": "A reader created webhook event.", + "value": { + "id": "evt_reader_123", + "type": "readers.created", + "created_at": "2023-05-09T14:52:58.714Z", + "object": { + "id": "rdr_3MSAFM23CK82VSTT4BN6RWSQ65", + "type": "reader", + "url": "https://api.sumup.com/v0.1/merchants/MC0DE/readers/rdr_3MSAFM23CK82VSTT4BN6RWSQ65" + } + } + } + } + } + } + }, + "responses": { + "2XX": { + "description": "Return any 2xx response to acknowledge successful delivery." + } + } + } + }, + "readers.deleted": { + "post": { + "operationId": "ReaderDeletedWebhook", + "tags": [ + "Readers" + ], + "summary": "Reader deleted", + "description": "Sent when a reader is unpaired from a merchant account and is no longer available through the Readers API.", + "x-object": { + "$ref": "#/components/schemas/Reader" + }, + "x-object-type": "reader", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Event" + }, + "examples": { + "deleted": { + "summary": "A reader deleted webhook event.", + "value": { + "id": "evt_reader_456", + "type": "readers.deleted", + "created_at": "2023-05-10T09:21:33.004Z", + "object": { + "id": "rdr_3MSAFM23CK82VSTT4BN6RWSQ65", + "type": "reader", + "url": "https://api.sumup.com/v0.1/merchants/MC0DE/readers/rdr_3MSAFM23CK82VSTT4BN6RWSQ65" + } + } + } + } + } + } + }, + "responses": { + "2XX": { + "description": "Return any 2xx response to acknowledge successful delivery." + } + } + } + }, + "members.created": { + "post": { + "operationId": "MemberCreatedWebhook", + "tags": [ + "Members" + ], + "summary": "Member created", + "description": "Sent when a member is created, invited, or accepts an invitation for a merchant account.", + "x-object": { + "$ref": "#/components/schemas/Member" + }, + "x-object-type": "member", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Event" + }, + "examples": { + "created": { + "summary": "A member created webhook event.", + "value": { + "id": "evt_membership_123", + "type": "members.created", + "created_at": "2026-05-14T08:30:00Z", + "object": { + "id": "mem_123", + "type": "member", + "url": "https://api.sumup.com/v0.1/merchants/MC0DE/members/mem_123" + } + } + } + } + } + } + }, + "responses": { + "2XX": { + "description": "Return any 2xx response to acknowledge successful delivery." + } + } + } + }, + "members.updated": { + "post": { + "operationId": "MemberUpdatedWebhook", + "tags": [ + "Members" + ], + "summary": "Member updated", + "description": "Sent when a member is updated, disabled, rejected, or expires for a merchant account.", + "x-object": { + "$ref": "#/components/schemas/Member" + }, + "x-object-type": "member", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Event" + }, + "examples": { + "updated": { + "summary": "A member updated webhook event.", + "value": { + "id": "evt_membership_456", + "type": "members.updated", + "created_at": "2026-05-14T09:15:00Z", + "object": { + "id": "mem_123", + "type": "member", + "url": "https://api.sumup.com/v0.1/merchants/MC0DE/members/mem_123" + } + } + } + } + } + } + }, + "responses": { + "2XX": { + "description": "Return any 2xx response to acknowledge successful delivery." + } + } + } + }, + "members.deleted": { + "post": { + "operationId": "MemberDeletedWebhook", + "tags": [ + "Members" + ], + "summary": "Member deleted", + "description": "Sent when a member is deleted from a merchant account.", + "x-object": { + "$ref": "#/components/schemas/Member" + }, + "x-object-type": "member", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Event" + }, + "examples": { + "deleted": { + "summary": "A member deleted webhook event.", + "value": { + "id": "evt_membership_789", + "type": "members.deleted", + "created_at": "2026-05-14T10:45:00Z", + "object": { + "id": "mem_123", + "type": "member", + "url": "https://api.sumup.com/v0.1/merchants/MC0DE/members/mem_123" + } + } + } + } + } + } + }, + "responses": { + "2XX": { + "description": "Return any 2xx response to acknowledge successful delivery." + } + } + } + } } } \ No newline at end of file From 2763ee4201a43e74b123cb299cfb20213690c58b Mon Sep 17 00:00:00 2001 From: "sumup-release-bot[bot]" <241716704+sumup-release-bot[bot]@users.noreply.github.com> Date: Sat, 5 Sep 2026 11:04:32 +0000 Subject: [PATCH 2/2] chore: generate code --- .../sdk/clients/CheckoutsAsyncClient.java | 67 ++++ .../sumup/sdk/clients/CheckoutsClient.java | 67 ++++ .../sumup/sdk/clients/MembersAsyncClient.java | 13 + .../com/sumup/sdk/clients/MembersClient.java | 13 + .../sdk/clients/MerchantsAsyncClient.java | 193 +--------- .../sumup/sdk/clients/MerchantsClient.java | 192 +--------- src/main/java/com/sumup/sdk/models/Card.java | 142 ++++++++ .../sumup/sdk/models/CheckoutAccepted.java | 46 +++ .../sdk/models/CheckoutAcceptedNextStep.java | 112 ++++++ ...CheckoutAcceptedNextStepMechanismItem.java | 56 +++ .../sumup/sdk/models/CheckoutSuccess2.java | 337 ++++++++++++++++++ .../CheckoutSuccess2PaymentInstrument.java | 43 +++ .../com/sumup/sdk/models/MandatePayload.java | 81 +++++ .../sumup/sdk/models/MandatePayloadType.java | 53 +++ .../com/sumup/sdk/models/ProcessCheckout.java | 202 +++++++++++ .../models/ProcessCheckoutPaymentType.java | 65 ++++ 16 files changed, 1321 insertions(+), 361 deletions(-) create mode 100644 src/main/java/com/sumup/sdk/models/Card.java create mode 100644 src/main/java/com/sumup/sdk/models/CheckoutAccepted.java create mode 100644 src/main/java/com/sumup/sdk/models/CheckoutAcceptedNextStep.java create mode 100644 src/main/java/com/sumup/sdk/models/CheckoutAcceptedNextStepMechanismItem.java create mode 100644 src/main/java/com/sumup/sdk/models/CheckoutSuccess2.java create mode 100644 src/main/java/com/sumup/sdk/models/CheckoutSuccess2PaymentInstrument.java create mode 100644 src/main/java/com/sumup/sdk/models/MandatePayload.java create mode 100644 src/main/java/com/sumup/sdk/models/MandatePayloadType.java create mode 100644 src/main/java/com/sumup/sdk/models/ProcessCheckout.java create mode 100644 src/main/java/com/sumup/sdk/models/ProcessCheckoutPaymentType.java diff --git a/src/main/java/com/sumup/sdk/clients/CheckoutsAsyncClient.java b/src/main/java/com/sumup/sdk/clients/CheckoutsAsyncClient.java index 3f5894c..bef0ab9 100644 --- a/src/main/java/com/sumup/sdk/clients/CheckoutsAsyncClient.java +++ b/src/main/java/com/sumup/sdk/clients/CheckoutsAsyncClient.java @@ -407,6 +407,73 @@ public CompletableFuture> l requestOptions); } + /** + * Process a checkout + * + *

:::caution[PCI DSS compliance required] When you submit raw card details directly to the + * Checkout API, your systems store, process, or transmit cardholder data and are therefore + * subject to applicable [PCI DSS + * requirements](https://www.pcisecuritystandards.org/document_library/). You should only use this + * integration if your environment is appropriately PCI DSS compliant. ::: Processing a checkout + * will attempt to charge the provided payment instrument for the amount of the specified checkout + * resource initiated in the `Create a checkout` endpoint. Follow this request with `Retrieve a + * checkout` to confirm its status. + * + *

Operation ID: ProcessCheckout + * + * @param checkoutId Unique identifier of the checkout resource. + * @param request Details of the payment instrument for processing the checkout. + *

Call the overload that accepts RequestOptions to customize headers, authorization, or + * request timeout. + * @return CompletableFuture resolved with com.sumup.sdk.models.CheckoutSuccess2 parsed response. + * @throws ApiException if the SumUp API returns an error. + */ + public CompletableFuture process( + String checkoutId, com.sumup.sdk.models.ProcessCheckout request) throws ApiException { + return process(checkoutId, request, null); + } + + /** + * Process a checkout + * + *

:::caution[PCI DSS compliance required] When you submit raw card details directly to the + * Checkout API, your systems store, process, or transmit cardholder data and are therefore + * subject to applicable [PCI DSS + * requirements](https://www.pcisecuritystandards.org/document_library/). You should only use this + * integration if your environment is appropriately PCI DSS compliant. ::: Processing a checkout + * will attempt to charge the provided payment instrument for the amount of the specified checkout + * resource initiated in the `Create a checkout` endpoint. Follow this request with `Retrieve a + * checkout` to confirm its status. + * + *

Operation ID: ProcessCheckout + * + * @param checkoutId Unique identifier of the checkout resource. + * @param request Details of the payment instrument for processing the checkout. + * @param requestOptions Request-specific overrides (headers, authorization, or timeout). Pass + * {@code null} to use client defaults. + * @return CompletableFuture resolved with com.sumup.sdk.models.CheckoutSuccess2 parsed response. + * @throws ApiException if the SumUp API returns an error. + */ + public CompletableFuture process( + String checkoutId, + com.sumup.sdk.models.ProcessCheckout request, + RequestOptions requestOptions) + throws ApiException { + Objects.requireNonNull(checkoutId, "checkoutId"); + Objects.requireNonNull(request, "request"); + String path = "/v0.1/checkouts/{checkout_id}"; + path = path.replace("{checkout_id}", ApiClient.urlEncode(ApiClient.parameterValue(checkoutId))); + + return this.apiClient.sendAsync( + HttpMethod.PUT, + path, + null, + null, + request, + new TypeReference() {}, + requestOptions); + } + /** * Update a checkout * diff --git a/src/main/java/com/sumup/sdk/clients/CheckoutsClient.java b/src/main/java/com/sumup/sdk/clients/CheckoutsClient.java index 5dfc7cc..8f66982 100644 --- a/src/main/java/com/sumup/sdk/clients/CheckoutsClient.java +++ b/src/main/java/com/sumup/sdk/clients/CheckoutsClient.java @@ -395,6 +395,73 @@ public com.sumup.sdk.models.GetPaymentMethodsResponse listAvailablePaymentMethod requestOptions); } + /** + * Process a checkout + * + *

:::caution[PCI DSS compliance required] When you submit raw card details directly to the + * Checkout API, your systems store, process, or transmit cardholder data and are therefore + * subject to applicable [PCI DSS + * requirements](https://www.pcisecuritystandards.org/document_library/). You should only use this + * integration if your environment is appropriately PCI DSS compliant. ::: Processing a checkout + * will attempt to charge the provided payment instrument for the amount of the specified checkout + * resource initiated in the `Create a checkout` endpoint. Follow this request with `Retrieve a + * checkout` to confirm its status. + * + *

Operation ID: ProcessCheckout + * + * @param checkoutId Unique identifier of the checkout resource. + * @param request Details of the payment instrument for processing the checkout. + *

Call the overload that accepts RequestOptions to customize headers, authorization, or + * request timeout. + * @return com.sumup.sdk.models.CheckoutSuccess2 parsed response. + * @throws ApiException if the SumUp API returns an error. + */ + public com.sumup.sdk.models.CheckoutSuccess2 process( + String checkoutId, com.sumup.sdk.models.ProcessCheckout request) throws ApiException { + return process(checkoutId, request, null); + } + + /** + * Process a checkout + * + *

:::caution[PCI DSS compliance required] When you submit raw card details directly to the + * Checkout API, your systems store, process, or transmit cardholder data and are therefore + * subject to applicable [PCI DSS + * requirements](https://www.pcisecuritystandards.org/document_library/). You should only use this + * integration if your environment is appropriately PCI DSS compliant. ::: Processing a checkout + * will attempt to charge the provided payment instrument for the amount of the specified checkout + * resource initiated in the `Create a checkout` endpoint. Follow this request with `Retrieve a + * checkout` to confirm its status. + * + *

Operation ID: ProcessCheckout + * + * @param checkoutId Unique identifier of the checkout resource. + * @param request Details of the payment instrument for processing the checkout. + * @param requestOptions Request-specific overrides (headers, authorization, or timeout). Pass + * {@code null} to use client defaults. + * @return com.sumup.sdk.models.CheckoutSuccess2 parsed response. + * @throws ApiException if the SumUp API returns an error. + */ + public com.sumup.sdk.models.CheckoutSuccess2 process( + String checkoutId, + com.sumup.sdk.models.ProcessCheckout request, + RequestOptions requestOptions) + throws ApiException { + Objects.requireNonNull(checkoutId, "checkoutId"); + Objects.requireNonNull(request, "request"); + String path = "/v0.1/checkouts/{checkout_id}"; + path = path.replace("{checkout_id}", ApiClient.urlEncode(ApiClient.parameterValue(checkoutId))); + + return this.apiClient.send( + HttpMethod.PUT, + path, + null, + null, + request, + new TypeReference() {}, + requestOptions); + } + /** * Update a checkout * diff --git a/src/main/java/com/sumup/sdk/clients/MembersAsyncClient.java b/src/main/java/com/sumup/sdk/clients/MembersAsyncClient.java index fe167c2..710ef1b 100644 --- a/src/main/java/com/sumup/sdk/clients/MembersAsyncClient.java +++ b/src/main/java/com/sumup/sdk/clients/MembersAsyncClient.java @@ -407,6 +407,19 @@ public ListMerchantMembersQueryParams userId(java.util.UUID value) { return this; } + /** + * Sets the user.type query parameter. + * + * @param value Filter the returned members by user type. Repeat this parameter to include + * multiple user types. + * @return This ListMerchantMembersQueryParams instance. + */ + public ListMerchantMembersQueryParams userType( + java.util.List value) { + this.values.put("user.type", Objects.requireNonNull(value, "userType")); + return this; + } + /** * Converts query parameters to a map understood by ApiClient. * diff --git a/src/main/java/com/sumup/sdk/clients/MembersClient.java b/src/main/java/com/sumup/sdk/clients/MembersClient.java index 30d2352..45b871c 100644 --- a/src/main/java/com/sumup/sdk/clients/MembersClient.java +++ b/src/main/java/com/sumup/sdk/clients/MembersClient.java @@ -399,6 +399,19 @@ public ListMerchantMembersQueryParams userId(java.util.UUID value) { return this; } + /** + * Sets the user.type query parameter. + * + * @param value Filter the returned members by user type. Repeat this parameter to include + * multiple user types. + * @return This ListMerchantMembersQueryParams instance. + */ + public ListMerchantMembersQueryParams userType( + java.util.List value) { + this.values.put("user.type", Objects.requireNonNull(value, "userType")); + return this; + } + /** * Converts query parameters to a map understood by ApiClient. * diff --git a/src/main/java/com/sumup/sdk/clients/MerchantsAsyncClient.java b/src/main/java/com/sumup/sdk/clients/MerchantsAsyncClient.java index 404874f..2dcdc1a 100644 --- a/src/main/java/com/sumup/sdk/clients/MerchantsAsyncClient.java +++ b/src/main/java/com/sumup/sdk/clients/MerchantsAsyncClient.java @@ -6,8 +6,6 @@ import com.sumup.sdk.core.ApiException; import com.sumup.sdk.core.HttpMethod; import com.sumup.sdk.core.RequestOptions; -import java.util.LinkedHashMap; -import java.util.Map; import java.util.Objects; import java.util.concurrent.CompletableFuture; @@ -36,8 +34,8 @@ public MerchantsAsyncClient(ApiClient apiClient) { *

Operation ID: GetMerchant * * @param merchantCode Short unique identifier for the merchant. - *

Call the overload that accepts optional parameter objects or RequestOptions to customize - * headers, authorization, query values, or timeouts. + *

Call the overload that accepts RequestOptions to customize headers, authorization, or + * request timeout. * @return CompletableFuture resolved with com.sumup.sdk.models.Merchant parsed response. * @throws ApiException if the SumUp API returns an error. */ @@ -54,48 +52,23 @@ public CompletableFuture get(String merchantCode) *

Operation ID: GetMerchant * * @param merchantCode Short unique identifier for the merchant. - * @param getMerchant Optional query parameters for this request. - *

Call the overload that accepts RequestOptions to customize headers, authorization, or - * request timeout. - * @return CompletableFuture resolved with com.sumup.sdk.models.Merchant parsed response. - * @throws ApiException if the SumUp API returns an error. - */ - public CompletableFuture get( - String merchantCode, GetMerchantQueryParams getMerchant) throws ApiException { - return get(merchantCode, getMerchant, null); - } - - /** - * Get Merchant - * - *

Returns a Merchant for a valid Merchant code. - * - *

Operation ID: GetMerchant - * - * @param merchantCode Short unique identifier for the merchant. - * @param getMerchant Optional query parameters for this request. * @param requestOptions Request-specific overrides (headers, authorization, or timeout). Pass * {@code null} to use client defaults. * @return CompletableFuture resolved with com.sumup.sdk.models.Merchant parsed response. * @throws ApiException if the SumUp API returns an error. */ public CompletableFuture get( - String merchantCode, GetMerchantQueryParams getMerchant, RequestOptions requestOptions) - throws ApiException { + String merchantCode, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(merchantCode, "merchantCode"); String path = "/v1/merchants/{merchant_code}"; path = path.replace( "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); - Map queryParams = new LinkedHashMap<>(); - if (getMerchant != null) { - queryParams.putAll(getMerchant.toMap()); - } return this.apiClient.sendAsync( HttpMethod.GET, path, - queryParams, + null, null, null, new TypeReference() {}, @@ -111,34 +84,14 @@ public CompletableFuture get( * * @param merchantCode Short unique identifier for the merchant. * @param personId Person ID - *

Call the overload that accepts optional parameter objects or RequestOptions to customize - * headers, authorization, query values, or timeouts. - * @return CompletableFuture resolved with com.sumup.sdk.models.Person parsed response. - * @throws ApiException if the SumUp API returns an error. - */ - public CompletableFuture getPerson( - String merchantCode, String personId) throws ApiException { - return getPerson(merchantCode, personId, null); - } - - /** - * Get Person - * - *

Returns a single Person related to a Merchant. - * - *

Operation ID: GetPerson - * - * @param merchantCode Short unique identifier for the merchant. - * @param personId Person ID - * @param getPerson Optional query parameters for this request. *

Call the overload that accepts RequestOptions to customize headers, authorization, or * request timeout. * @return CompletableFuture resolved with com.sumup.sdk.models.Person parsed response. * @throws ApiException if the SumUp API returns an error. */ public CompletableFuture getPerson( - String merchantCode, String personId, GetPersonQueryParams getPerson) throws ApiException { - return getPerson(merchantCode, personId, getPerson, null); + String merchantCode, String personId) throws ApiException { + return getPerson(merchantCode, personId, null); } /** @@ -150,18 +103,13 @@ public CompletableFuture getPerson( * * @param merchantCode Short unique identifier for the merchant. * @param personId Person ID - * @param getPerson Optional query parameters for this request. * @param requestOptions Request-specific overrides (headers, authorization, or timeout). Pass * {@code null} to use client defaults. * @return CompletableFuture resolved with com.sumup.sdk.models.Person parsed response. * @throws ApiException if the SumUp API returns an error. */ public CompletableFuture getPerson( - String merchantCode, - String personId, - GetPersonQueryParams getPerson, - RequestOptions requestOptions) - throws ApiException { + String merchantCode, String personId, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(merchantCode, "merchantCode"); Objects.requireNonNull(personId, "personId"); String path = "/v1/merchants/{merchant_code}/persons/{person_id}"; @@ -169,15 +117,11 @@ public CompletableFuture getPerson( path.replace( "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); path = path.replace("{person_id}", ApiClient.urlEncode(ApiClient.parameterValue(personId))); - Map queryParams = new LinkedHashMap<>(); - if (getPerson != null) { - queryParams.putAll(getPerson.toMap()); - } return this.apiClient.sendAsync( HttpMethod.GET, path, - queryParams, + null, null, null, new TypeReference() {}, @@ -192,26 +136,6 @@ public CompletableFuture getPerson( *

Operation ID: ListPersons * * @param merchantCode Short unique identifier for the merchant. - *

Call the overload that accepts optional parameter objects or RequestOptions to customize - * headers, authorization, query values, or timeouts. - * @return CompletableFuture resolved with com.sumup.sdk.models.ListPersonsResponseBody parsed - * response. - * @throws ApiException if the SumUp API returns an error. - */ - public CompletableFuture listPersons( - String merchantCode) throws ApiException { - return listPersons(merchantCode, null); - } - - /** - * List Persons - * - *

Returns the Persons related to a Merchant. - * - *

Operation ID: ListPersons - * - * @param merchantCode Short unique identifier for the merchant. - * @param listPersons Optional query parameters for this request. *

Call the overload that accepts RequestOptions to customize headers, authorization, or * request timeout. * @return CompletableFuture resolved with com.sumup.sdk.models.ListPersonsResponseBody parsed @@ -219,8 +143,8 @@ public CompletableFuture listPerso * @throws ApiException if the SumUp API returns an error. */ public CompletableFuture listPersons( - String merchantCode, ListPersonsQueryParams listPersons) throws ApiException { - return listPersons(merchantCode, listPersons, null); + String merchantCode) throws ApiException { + return listPersons(merchantCode, null); } /** @@ -231,7 +155,6 @@ public CompletableFuture listPerso *

Operation ID: ListPersons * * @param merchantCode Short unique identifier for the merchant. - * @param listPersons Optional query parameters for this request. * @param requestOptions Request-specific overrides (headers, authorization, or timeout). Pass * {@code null} to use client defaults. * @return CompletableFuture resolved with com.sumup.sdk.models.ListPersonsResponseBody parsed @@ -239,112 +162,20 @@ public CompletableFuture listPerso * @throws ApiException if the SumUp API returns an error. */ public CompletableFuture listPersons( - String merchantCode, ListPersonsQueryParams listPersons, RequestOptions requestOptions) - throws ApiException { + String merchantCode, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(merchantCode, "merchantCode"); String path = "/v1/merchants/{merchant_code}/persons"; path = path.replace( "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); - Map queryParams = new LinkedHashMap<>(); - if (listPersons != null) { - queryParams.putAll(listPersons.toMap()); - } return this.apiClient.sendAsync( HttpMethod.GET, path, - queryParams, + null, null, null, new TypeReference() {}, requestOptions); } - - /** Optional query parameters for this request. */ - public static final class GetMerchantQueryParams { - private final Map values = new LinkedHashMap<>(); - - /** - * Sets the version query parameter. - * - * @param value The version of the resource. At the moment, the only supported value is - * `latest`. When provided and the requested resource's `change_status` is pending, the - * resource will be returned with all pending changes applied. When no changes are pending - * the resource is returned as is. The `change_status` in the response body will reflect the - * current state of the resource. - * @return This GetMerchantQueryParams instance. - */ - public GetMerchantQueryParams version(String value) { - this.values.put("version", Objects.requireNonNull(value, "version")); - return this; - } - - /** - * Converts query parameters to a map understood by ApiClient. - * - * @return Collected query parameters keyed by API name. - */ - Map toMap() { - return values; - } - } - - /** Optional query parameters for this request. */ - public static final class GetPersonQueryParams { - private final Map values = new LinkedHashMap<>(); - - /** - * Sets the version query parameter. - * - * @param value The version of the resource. At the moment, the only supported value is - * `latest`. When provided and the requested resource's `change_status` is pending, the - * resource will be returned with all pending changes applied. When no changes are pending - * the resource is returned as is. The `change_status` in the response body will reflect the - * current state of the resource. - * @return This GetPersonQueryParams instance. - */ - public GetPersonQueryParams version(String value) { - this.values.put("version", Objects.requireNonNull(value, "version")); - return this; - } - - /** - * Converts query parameters to a map understood by ApiClient. - * - * @return Collected query parameters keyed by API name. - */ - Map toMap() { - return values; - } - } - - /** Optional query parameters for this request. */ - public static final class ListPersonsQueryParams { - private final Map values = new LinkedHashMap<>(); - - /** - * Sets the version query parameter. - * - * @param value The version of the resource. At the moment, the only supported value is - * `latest`. When provided and the requested resource's `change_status` is pending, the - * resource will be returned with all pending changes applied. When no changes are pending - * the resource is returned as is. The `change_status` in the response body will reflect the - * current state of the resource. - * @return This ListPersonsQueryParams instance. - */ - public ListPersonsQueryParams version(String value) { - this.values.put("version", Objects.requireNonNull(value, "version")); - return this; - } - - /** - * Converts query parameters to a map understood by ApiClient. - * - * @return Collected query parameters keyed by API name. - */ - Map toMap() { - return values; - } - } } diff --git a/src/main/java/com/sumup/sdk/clients/MerchantsClient.java b/src/main/java/com/sumup/sdk/clients/MerchantsClient.java index a213e93..1dc67fa 100644 --- a/src/main/java/com/sumup/sdk/clients/MerchantsClient.java +++ b/src/main/java/com/sumup/sdk/clients/MerchantsClient.java @@ -6,8 +6,6 @@ import com.sumup.sdk.core.ApiException; import com.sumup.sdk.core.HttpMethod; import com.sumup.sdk.core.RequestOptions; -import java.util.LinkedHashMap; -import java.util.Map; import java.util.Objects; /** @@ -35,32 +33,13 @@ public MerchantsClient(ApiClient apiClient) { *

Operation ID: GetMerchant * * @param merchantCode Short unique identifier for the merchant. - *

Call the overload that accepts optional parameter objects or RequestOptions to customize - * headers, authorization, query values, or timeouts. - * @return com.sumup.sdk.models.Merchant parsed response. - * @throws ApiException if the SumUp API returns an error. - */ - public com.sumup.sdk.models.Merchant get(String merchantCode) throws ApiException { - return get(merchantCode, null); - } - - /** - * Get Merchant - * - *

Returns a Merchant for a valid Merchant code. - * - *

Operation ID: GetMerchant - * - * @param merchantCode Short unique identifier for the merchant. - * @param getMerchant Optional query parameters for this request. *

Call the overload that accepts RequestOptions to customize headers, authorization, or * request timeout. * @return com.sumup.sdk.models.Merchant parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Merchant get(String merchantCode, GetMerchantQueryParams getMerchant) - throws ApiException { - return get(merchantCode, getMerchant, null); + public com.sumup.sdk.models.Merchant get(String merchantCode) throws ApiException { + return get(merchantCode, null); } /** @@ -71,29 +50,23 @@ public com.sumup.sdk.models.Merchant get(String merchantCode, GetMerchantQueryPa *

Operation ID: GetMerchant * * @param merchantCode Short unique identifier for the merchant. - * @param getMerchant Optional query parameters for this request. * @param requestOptions Request-specific overrides (headers, authorization, or timeout). Pass * {@code null} to use client defaults. * @return com.sumup.sdk.models.Merchant parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Merchant get( - String merchantCode, GetMerchantQueryParams getMerchant, RequestOptions requestOptions) + public com.sumup.sdk.models.Merchant get(String merchantCode, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(merchantCode, "merchantCode"); String path = "/v1/merchants/{merchant_code}"; path = path.replace( "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); - Map queryParams = new LinkedHashMap<>(); - if (getMerchant != null) { - queryParams.putAll(getMerchant.toMap()); - } return this.apiClient.send( HttpMethod.GET, path, - queryParams, + null, null, null, new TypeReference() {}, @@ -109,8 +82,8 @@ public com.sumup.sdk.models.Merchant get( * * @param merchantCode Short unique identifier for the merchant. * @param personId Person ID - *

Call the overload that accepts optional parameter objects or RequestOptions to customize - * headers, authorization, query values, or timeouts. + *

Call the overload that accepts RequestOptions to customize headers, authorization, or + * request timeout. * @return com.sumup.sdk.models.Person parsed response. * @throws ApiException if the SumUp API returns an error. */ @@ -128,38 +101,13 @@ public com.sumup.sdk.models.Person getPerson(String merchantCode, String personI * * @param merchantCode Short unique identifier for the merchant. * @param personId Person ID - * @param getPerson Optional query parameters for this request. - *

Call the overload that accepts RequestOptions to customize headers, authorization, or - * request timeout. - * @return com.sumup.sdk.models.Person parsed response. - * @throws ApiException if the SumUp API returns an error. - */ - public com.sumup.sdk.models.Person getPerson( - String merchantCode, String personId, GetPersonQueryParams getPerson) throws ApiException { - return getPerson(merchantCode, personId, getPerson, null); - } - - /** - * Get Person - * - *

Returns a single Person related to a Merchant. - * - *

Operation ID: GetPerson - * - * @param merchantCode Short unique identifier for the merchant. - * @param personId Person ID - * @param getPerson Optional query parameters for this request. * @param requestOptions Request-specific overrides (headers, authorization, or timeout). Pass * {@code null} to use client defaults. * @return com.sumup.sdk.models.Person parsed response. * @throws ApiException if the SumUp API returns an error. */ public com.sumup.sdk.models.Person getPerson( - String merchantCode, - String personId, - GetPersonQueryParams getPerson, - RequestOptions requestOptions) - throws ApiException { + String merchantCode, String personId, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(merchantCode, "merchantCode"); Objects.requireNonNull(personId, "personId"); String path = "/v1/merchants/{merchant_code}/persons/{person_id}"; @@ -167,15 +115,11 @@ public com.sumup.sdk.models.Person getPerson( path.replace( "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); path = path.replace("{person_id}", ApiClient.urlEncode(ApiClient.parameterValue(personId))); - Map queryParams = new LinkedHashMap<>(); - if (getPerson != null) { - queryParams.putAll(getPerson.toMap()); - } return this.apiClient.send( HttpMethod.GET, path, - queryParams, + null, null, null, new TypeReference() {}, @@ -190,8 +134,8 @@ public com.sumup.sdk.models.Person getPerson( *

Operation ID: ListPersons * * @param merchantCode Short unique identifier for the merchant. - *

Call the overload that accepts optional parameter objects or RequestOptions to customize - * headers, authorization, query values, or timeouts. + *

Call the overload that accepts RequestOptions to customize headers, authorization, or + * request timeout. * @return com.sumup.sdk.models.ListPersonsResponseBody parsed response. * @throws ApiException if the SumUp API returns an error. */ @@ -208,138 +152,26 @@ public com.sumup.sdk.models.ListPersonsResponseBody listPersons(String merchantC *

Operation ID: ListPersons * * @param merchantCode Short unique identifier for the merchant. - * @param listPersons Optional query parameters for this request. - *

Call the overload that accepts RequestOptions to customize headers, authorization, or - * request timeout. - * @return com.sumup.sdk.models.ListPersonsResponseBody parsed response. - * @throws ApiException if the SumUp API returns an error. - */ - public com.sumup.sdk.models.ListPersonsResponseBody listPersons( - String merchantCode, ListPersonsQueryParams listPersons) throws ApiException { - return listPersons(merchantCode, listPersons, null); - } - - /** - * List Persons - * - *

Returns the Persons related to a Merchant. - * - *

Operation ID: ListPersons - * - * @param merchantCode Short unique identifier for the merchant. - * @param listPersons Optional query parameters for this request. * @param requestOptions Request-specific overrides (headers, authorization, or timeout). Pass * {@code null} to use client defaults. * @return com.sumup.sdk.models.ListPersonsResponseBody parsed response. * @throws ApiException if the SumUp API returns an error. */ public com.sumup.sdk.models.ListPersonsResponseBody listPersons( - String merchantCode, ListPersonsQueryParams listPersons, RequestOptions requestOptions) - throws ApiException { + String merchantCode, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(merchantCode, "merchantCode"); String path = "/v1/merchants/{merchant_code}/persons"; path = path.replace( "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); - Map queryParams = new LinkedHashMap<>(); - if (listPersons != null) { - queryParams.putAll(listPersons.toMap()); - } return this.apiClient.send( HttpMethod.GET, path, - queryParams, + null, null, null, new TypeReference() {}, requestOptions); } - - /** Optional query parameters for this request. */ - public static final class GetMerchantQueryParams { - private final Map values = new LinkedHashMap<>(); - - /** - * Sets the version query parameter. - * - * @param value The version of the resource. At the moment, the only supported value is - * `latest`. When provided and the requested resource's `change_status` is pending, the - * resource will be returned with all pending changes applied. When no changes are pending - * the resource is returned as is. The `change_status` in the response body will reflect the - * current state of the resource. - * @return This GetMerchantQueryParams instance. - */ - public GetMerchantQueryParams version(String value) { - this.values.put("version", Objects.requireNonNull(value, "version")); - return this; - } - - /** - * Converts query parameters to a map understood by ApiClient. - * - * @return Collected query parameters keyed by API name. - */ - Map toMap() { - return values; - } - } - - /** Optional query parameters for this request. */ - public static final class GetPersonQueryParams { - private final Map values = new LinkedHashMap<>(); - - /** - * Sets the version query parameter. - * - * @param value The version of the resource. At the moment, the only supported value is - * `latest`. When provided and the requested resource's `change_status` is pending, the - * resource will be returned with all pending changes applied. When no changes are pending - * the resource is returned as is. The `change_status` in the response body will reflect the - * current state of the resource. - * @return This GetPersonQueryParams instance. - */ - public GetPersonQueryParams version(String value) { - this.values.put("version", Objects.requireNonNull(value, "version")); - return this; - } - - /** - * Converts query parameters to a map understood by ApiClient. - * - * @return Collected query parameters keyed by API name. - */ - Map toMap() { - return values; - } - } - - /** Optional query parameters for this request. */ - public static final class ListPersonsQueryParams { - private final Map values = new LinkedHashMap<>(); - - /** - * Sets the version query parameter. - * - * @param value The version of the resource. At the moment, the only supported value is - * `latest`. When provided and the requested resource's `change_status` is pending, the - * resource will be returned with all pending changes applied. When no changes are pending - * the resource is returned as is. The `change_status` in the response body will reflect the - * current state of the resource. - * @return This ListPersonsQueryParams instance. - */ - public ListPersonsQueryParams version(String value) { - this.values.put("version", Objects.requireNonNull(value, "version")); - return this; - } - - /** - * Converts query parameters to a map understood by ApiClient. - * - * @return Collected query parameters keyed by API name. - */ - Map toMap() { - return values; - } - } } diff --git a/src/main/java/com/sumup/sdk/models/Card.java b/src/main/java/com/sumup/sdk/models/Card.java new file mode 100644 index 0000000..cc11f26 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/Card.java @@ -0,0 +1,142 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** __Required when payment type is `card`.__ Details of the payment card. */ +public record Card( + /** Three or four-digit card verification value (security code) of the payment card. */ + String cvv, + + /** Two-digit expiration month, from `01` through `12`. */ + String expiryMonth, + + /** Two- or four-digit expiration year in `YY` or `YYYY` format. */ + String expiryYear, + + /** Name of the cardholder as it appears on the payment card. */ + String name, + + /** Number of the payment card (without spaces). */ + String number, + + /** Issuing card network of the payment card used for the transaction. */ + com.sumup.sdk.models.CardType type, + + /** Required five-digit ZIP code. Applicable only to merchant users in the USA. */ + String zipCode) { + /** + * Creates a builder for Card. + * + * @return Builder that constructs immutable Card instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for Card instances. */ + public static final class Builder { + private String cvv; + private String expiryMonth; + private String expiryYear; + private String name; + private String number; + private com.sumup.sdk.models.CardType type; + private String zipCode; + + private Builder() {} + + /** + * Sets the value for {@code cvv}. + * + * @param cvv Three or four-digit card verification value (security code) of the payment card. + * @return This builder instance. + */ + public Builder cvv(String cvv) { + this.cvv = cvv; + return this; + } + + /** + * Sets the value for {@code expiryMonth}. + * + * @param expiryMonth Two-digit expiration month, from `01` through `12`. + * @return This builder instance. + */ + public Builder expiryMonth(String expiryMonth) { + this.expiryMonth = expiryMonth; + return this; + } + + /** + * Sets the value for {@code expiryYear}. + * + * @param expiryYear Two- or four-digit expiration year in `YY` or `YYYY` format. + * @return This builder instance. + */ + public Builder expiryYear(String expiryYear) { + this.expiryYear = expiryYear; + return this; + } + + /** + * Sets the value for {@code name}. + * + * @param name Name of the cardholder as it appears on the payment card. + * @return This builder instance. + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Sets the value for {@code number}. + * + * @param number Number of the payment card (without spaces). + * @return This builder instance. + */ + public Builder number(String number) { + this.number = number; + return this; + } + + /** + * Sets the value for {@code type}. + * + * @param type Issuing card network of the payment card used for the transaction. + * @return This builder instance. + */ + public Builder type(com.sumup.sdk.models.CardType type) { + this.type = type; + return this; + } + + /** + * Sets the value for {@code zipCode}. + * + * @param zipCode Required five-digit ZIP code. Applicable only to merchant users in the USA. + * @return This builder instance. + */ + public Builder zipCode(String zipCode) { + this.zipCode = zipCode; + return this; + } + + /** + * Builds an immutable Card instance. + * + * @return Immutable Card. + */ + public Card build() { + return new Card( + Objects.requireNonNull(cvv, "cvv"), + Objects.requireNonNull(expiryMonth, "expiryMonth"), + Objects.requireNonNull(expiryYear, "expiryYear"), + Objects.requireNonNull(name, "name"), + Objects.requireNonNull(number, "number"), + Objects.requireNonNull(type, "type"), + zipCode); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/CheckoutAccepted.java b/src/main/java/com/sumup/sdk/models/CheckoutAccepted.java new file mode 100644 index 0000000..8e639f6 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/CheckoutAccepted.java @@ -0,0 +1,46 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +/** + * Response returned when checkout processing requires an additional payer action, such as a 3DS + * challenge or a redirect to an external payment method page. + */ +public record CheckoutAccepted( + /** Instructions for the next action the payer or client must take. */ + com.sumup.sdk.models.CheckoutAcceptedNextStep nextStep) { + /** + * Creates a builder for CheckoutAccepted. + * + * @return Builder that constructs immutable CheckoutAccepted instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for CheckoutAccepted instances. */ + public static final class Builder { + private com.sumup.sdk.models.CheckoutAcceptedNextStep nextStep; + + private Builder() {} + + /** + * Sets the value for {@code nextStep}. + * + * @param nextStep Instructions for the next action the payer or client must take. + * @return This builder instance. + */ + public Builder nextStep(com.sumup.sdk.models.CheckoutAcceptedNextStep nextStep) { + this.nextStep = nextStep; + return this; + } + + /** + * Builds an immutable CheckoutAccepted instance. + * + * @return Immutable CheckoutAccepted. + */ + public CheckoutAccepted build() { + return new CheckoutAccepted(nextStep); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/CheckoutAcceptedNextStep.java b/src/main/java/com/sumup/sdk/models/CheckoutAcceptedNextStep.java new file mode 100644 index 0000000..433c362 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/CheckoutAcceptedNextStep.java @@ -0,0 +1,112 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +/** Instructions for the next action the payer or client must take. */ +public record CheckoutAcceptedNextStep( + /** + * Allowed presentation mechanisms for the next step. `iframe` means the flow can be embedded, + * while `browser` means it can be completed through a full-page redirect. + */ + java.util.List mechanism, + + /** HTTP method to use when following the next step. */ + String method, + + /** + * Parameters required to complete the next step. The exact keys depend on the payment provider + * and flow type. + */ + java.util.Map payload, + + /** Merchant URL where the payer returns after the external flow finishes. */ + String redirectUrl, + + /** URL to open or submit in order to continue processing. */ + String url) { + /** + * Creates a builder for CheckoutAcceptedNextStep. + * + * @return Builder that constructs immutable CheckoutAcceptedNextStep instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for CheckoutAcceptedNextStep instances. */ + public static final class Builder { + private java.util.List mechanism; + private String method; + private java.util.Map payload; + private String redirectUrl; + private String url; + + private Builder() {} + + /** + * Sets the value for {@code mechanism}. + * + * @param mechanism Allowed presentation mechanisms for the next step. `iframe` means the flow + * can be embedded, while `browser` means it can be completed through a full-page redirect. + * @return This builder instance. + */ + public Builder mechanism( + java.util.List mechanism) { + this.mechanism = mechanism; + return this; + } + + /** + * Sets the value for {@code method}. + * + * @param method HTTP method to use when following the next step. + * @return This builder instance. + */ + public Builder method(String method) { + this.method = method; + return this; + } + + /** + * Sets the value for {@code payload}. + * + * @param payload Parameters required to complete the next step. The exact keys depend on the + * payment provider and flow type. + * @return This builder instance. + */ + public Builder payload(java.util.Map payload) { + this.payload = payload; + return this; + } + + /** + * Sets the value for {@code redirectUrl}. + * + * @param redirectUrl Merchant URL where the payer returns after the external flow finishes. + * @return This builder instance. + */ + public Builder redirectUrl(String redirectUrl) { + this.redirectUrl = redirectUrl; + return this; + } + + /** + * Sets the value for {@code url}. + * + * @param url URL to open or submit in order to continue processing. + * @return This builder instance. + */ + public Builder url(String url) { + this.url = url; + return this; + } + + /** + * Builds an immutable CheckoutAcceptedNextStep instance. + * + * @return Immutable CheckoutAcceptedNextStep. + */ + public CheckoutAcceptedNextStep build() { + return new CheckoutAcceptedNextStep(mechanism, method, payload, redirectUrl, url); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/CheckoutAcceptedNextStepMechanismItem.java b/src/main/java/com/sumup/sdk/models/CheckoutAcceptedNextStepMechanismItem.java new file mode 100644 index 0000000..fe4c819 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/CheckoutAcceptedNextStepMechanismItem.java @@ -0,0 +1,56 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; + +public final class CheckoutAcceptedNextStepMechanismItem { + public static final CheckoutAcceptedNextStepMechanismItem IFRAME = + new CheckoutAcceptedNextStepMechanismItem("iframe"); + public static final CheckoutAcceptedNextStepMechanismItem BROWSER = + new CheckoutAcceptedNextStepMechanismItem("browser"); + + private final String value; + + private CheckoutAcceptedNextStepMechanismItem(String value) { + this.value = Objects.requireNonNull(value, "value"); + } + + /** + * Creates a CheckoutAcceptedNextStepMechanismItem for a value not yet known to this SDK version. + * + * @param value Wire value sent to or received from the API. + * @return Open enum value wrapping {@code value}. + */ + public static CheckoutAcceptedNextStepMechanismItem of(String value) { + return new CheckoutAcceptedNextStepMechanismItem(value); + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return value; + } + + @JsonCreator + public static CheckoutAcceptedNextStepMechanismItem fromValue(String value) { + return value == null ? null : new CheckoutAcceptedNextStepMechanismItem(value); + } + + @Override + public boolean equals(Object other) { + return this == other + || (other instanceof CheckoutAcceptedNextStepMechanismItem that + && this.value.equals(that.value)); + } + + @Override + public int hashCode() { + return value.hashCode(); + } +} diff --git a/src/main/java/com/sumup/sdk/models/CheckoutSuccess2.java b/src/main/java/com/sumup/sdk/models/CheckoutSuccess2.java new file mode 100644 index 0000000..939c2d2 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/CheckoutSuccess2.java @@ -0,0 +1,337 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +/** + * Checkout resource returned after a synchronous processing attempt. In addition to the base + * checkout fields, it can include the resulting transaction identifiers and any newly created + * payment instrument token. + */ +public record CheckoutSuccess2( + /** Amount to be charged to the payer, expressed in major units. */ + Float amount, + + /** + * Merchant-defined reference for the checkout. Use it to correlate the SumUp checkout with your + * own order, cart, subscription, or payment attempt in your systems. + */ + String checkoutReference, + + /** + * Three-letter [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the amount. + */ + com.sumup.sdk.models.Currency currency, + + /** + * Merchant-scoped identifier of the customer associated with the checkout. Use it when storing + * payment instruments or reusing saved customer context for recurring and returning-payer + * flows. + */ + String customerId, + + /** The timestamp of when the checkout was created. */ + java.time.OffsetDateTime date, + + /** + * Short merchant-defined description shown in SumUp tools and reporting. Use it to make the + * checkout easier to recognize in dashboards, support workflows, and reconciliation. + */ + String description, + + /** + * URL of the SumUp-hosted payment page that handles the payment flow. Returned when Hosted + * Checkout is enabled for the checkout. + */ + String hostedCheckoutUrl, + + /** Unique SumUp identifier of the checkout resource. */ + String id, + + /** Details of the mandate linked to the saved payment instrument. */ + com.sumup.sdk.models.MandateResponse mandate, + + /** Short unique identifier for the merchant that receives the payment. */ + String merchantCode, + + /** Name of the merchant. */ + String merchantName, + + /** Details of the saved payment instrument created or reused during checkout processing. */ + com.sumup.sdk.models.CheckoutSuccess2PaymentInstrument paymentInstrument, + + /** URL where the payer is redirected after a redirect-based payment or SCA flow completes. */ + String redirectUrl, + + /** + * Optional backend callback URL used by SumUp to notify your platform about processing updates + * for the checkout. + */ + String returnUrl, + + /** + * Current high-level state of the checkout. `PENDING` means the checkout exists but is not yet + * completed, `PAID` means a payment succeeded, `FAILED` means the latest processing attempt + * failed, and `EXPIRED` means the checkout can no longer be processed. + */ + com.sumup.sdk.models.CheckoutSuccessStatus status, + + /** + * Transaction code of the successful transaction with which the payment for the checkout is + * completed. + */ + String transactionCode, + + /** Unique identifier of the successful transaction that completed payment for the checkout. */ + String transactionId, + + /** + * Payment attempts and resulting transaction records linked to this checkout. Use the + * Transactions endpoints when you need the authoritative payment result and event history. + */ + java.util.List transactions, + + /** + * Optional expiration timestamp. The checkout must be processed before this moment, otherwise + * it becomes unusable. If omitted, the checkout does not have an explicit expiry time. + */ + java.time.OffsetDateTime validUntil) { + /** + * Creates a builder for CheckoutSuccess2. + * + * @return Builder that constructs immutable CheckoutSuccess2 instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for CheckoutSuccess2 instances. */ + public static final class Builder { + private Float amount; + private String checkoutReference; + private com.sumup.sdk.models.Currency currency; + private String customerId; + private java.time.OffsetDateTime date; + private String description; + private com.sumup.sdk.models.MandateResponse mandate; + private String merchantCode; + private String merchantName; + private com.sumup.sdk.models.CheckoutSuccess2PaymentInstrument paymentInstrument; + private String redirectUrl; + private String returnUrl; + private com.sumup.sdk.models.CheckoutSuccessStatus status; + private java.util.List transactions; + private java.time.OffsetDateTime validUntil; + + private Builder() {} + + /** + * Sets the value for {@code amount}. + * + * @param amount Amount to be charged to the payer, expressed in major units. + * @return This builder instance. + */ + public Builder amount(Float amount) { + this.amount = amount; + return this; + } + + /** + * Sets the value for {@code checkoutReference}. + * + * @param checkoutReference Merchant-defined reference for the checkout. Use it to correlate the + * SumUp checkout with your own order, cart, subscription, or payment attempt in your + * systems. + * @return This builder instance. + */ + public Builder checkoutReference(String checkoutReference) { + this.checkoutReference = checkoutReference; + return this; + } + + /** + * Sets the value for {@code currency}. + * + * @param currency Three-letter [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code + * of the amount. + * @return This builder instance. + */ + public Builder currency(com.sumup.sdk.models.Currency currency) { + this.currency = currency; + return this; + } + + /** + * Sets the value for {@code customerId}. + * + * @param customerId Merchant-scoped identifier of the customer associated with the checkout. + * Use it when storing payment instruments or reusing saved customer context for recurring + * and returning-payer flows. + * @return This builder instance. + */ + public Builder customerId(String customerId) { + this.customerId = customerId; + return this; + } + + /** + * Sets the value for {@code date}. + * + * @param date The timestamp of when the checkout was created. + * @return This builder instance. + */ + public Builder date(java.time.OffsetDateTime date) { + this.date = date; + return this; + } + + /** + * Sets the value for {@code description}. + * + * @param description Short merchant-defined description shown in SumUp tools and reporting. Use + * it to make the checkout easier to recognize in dashboards, support workflows, and + * reconciliation. + * @return This builder instance. + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Sets the value for {@code mandate}. + * + * @param mandate Details of the mandate linked to the saved payment instrument. + * @return This builder instance. + */ + public Builder mandate(com.sumup.sdk.models.MandateResponse mandate) { + this.mandate = mandate; + return this; + } + + /** + * Sets the value for {@code merchantCode}. + * + * @param merchantCode Short unique identifier for the merchant that receives the payment. + * @return This builder instance. + */ + public Builder merchantCode(String merchantCode) { + this.merchantCode = merchantCode; + return this; + } + + /** + * Sets the value for {@code merchantName}. + * + * @param merchantName Name of the merchant. + * @return This builder instance. + */ + public Builder merchantName(String merchantName) { + this.merchantName = merchantName; + return this; + } + + /** + * Sets the value for {@code paymentInstrument}. + * + * @param paymentInstrument Details of the saved payment instrument created or reused during + * checkout processing. + * @return This builder instance. + */ + public Builder paymentInstrument( + com.sumup.sdk.models.CheckoutSuccess2PaymentInstrument paymentInstrument) { + this.paymentInstrument = paymentInstrument; + return this; + } + + /** + * Sets the value for {@code redirectUrl}. + * + * @param redirectUrl URL where the payer is redirected after a redirect-based payment or SCA + * flow completes. + * @return This builder instance. + */ + public Builder redirectUrl(String redirectUrl) { + this.redirectUrl = redirectUrl; + return this; + } + + /** + * Sets the value for {@code returnUrl}. + * + * @param returnUrl Optional backend callback URL used by SumUp to notify your platform about + * processing updates for the checkout. + * @return This builder instance. + */ + public Builder returnUrl(String returnUrl) { + this.returnUrl = returnUrl; + return this; + } + + /** + * Sets the value for {@code status}. + * + * @param status Current high-level state of the checkout. `PENDING` means the checkout exists + * but is not yet completed, `PAID` means a payment succeeded, `FAILED` means the latest + * processing attempt failed, and `EXPIRED` means the checkout can no longer be processed. + * @return This builder instance. + */ + public Builder status(com.sumup.sdk.models.CheckoutSuccessStatus status) { + this.status = status; + return this; + } + + /** + * Sets the value for {@code transactions}. + * + * @param transactions Payment attempts and resulting transaction records linked to this + * checkout. Use the Transactions endpoints when you need the authoritative payment result + * and event history. + * @return This builder instance. + */ + public Builder transactions( + java.util.List transactions) { + this.transactions = transactions; + return this; + } + + /** + * Sets the value for {@code validUntil}. + * + * @param validUntil Optional expiration timestamp. The checkout must be processed before this + * moment, otherwise it becomes unusable. If omitted, the checkout does not have an explicit + * expiry time. + * @return This builder instance. + */ + public Builder validUntil(java.time.OffsetDateTime validUntil) { + this.validUntil = validUntil; + return this; + } + + /** + * Builds an immutable CheckoutSuccess2 instance. + * + * @return Immutable CheckoutSuccess2. + */ + public CheckoutSuccess2 build() { + return new CheckoutSuccess2( + amount, + checkoutReference, + currency, + customerId, + date, + description, + null, + null, + mandate, + merchantCode, + merchantName, + paymentInstrument, + redirectUrl, + returnUrl, + status, + null, + null, + transactions, + validUntil); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/CheckoutSuccess2PaymentInstrument.java b/src/main/java/com/sumup/sdk/models/CheckoutSuccess2PaymentInstrument.java new file mode 100644 index 0000000..755ce19 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/CheckoutSuccess2PaymentInstrument.java @@ -0,0 +1,43 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +/** Details of the saved payment instrument created or reused during checkout processing. */ +public record CheckoutSuccess2PaymentInstrument( + /** Unique token of the saved payment instrument. */ + String token) { + /** + * Creates a builder for CheckoutSuccess2PaymentInstrument. + * + * @return Builder that constructs immutable CheckoutSuccess2PaymentInstrument instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for CheckoutSuccess2PaymentInstrument instances. */ + public static final class Builder { + private String token; + + private Builder() {} + + /** + * Sets the value for {@code token}. + * + * @param token Unique token of the saved payment instrument. + * @return This builder instance. + */ + public Builder token(String token) { + this.token = token; + return this; + } + + /** + * Builds an immutable CheckoutSuccess2PaymentInstrument instance. + * + * @return Immutable CheckoutSuccess2PaymentInstrument. + */ + public CheckoutSuccess2PaymentInstrument build() { + return new CheckoutSuccess2PaymentInstrument(token); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/MandatePayload.java b/src/main/java/com/sumup/sdk/models/MandatePayload.java new file mode 100644 index 0000000..2c3af0e --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/MandatePayload.java @@ -0,0 +1,81 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** + * Mandate details used when a checkout should create a reusable card token for future recurring or + * merchant-initiated payments. + */ +public record MandatePayload( + /** Type of mandate to create for the saved payment instrument. */ + com.sumup.sdk.models.MandatePayloadType type, + + /** Browser or client user agent observed when consent was collected. */ + String userAgent, + + /** IP address of the payer when the mandate was accepted. */ + String userIp) { + /** + * Creates a builder for MandatePayload. + * + * @return Builder that constructs immutable MandatePayload instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for MandatePayload instances. */ + public static final class Builder { + private com.sumup.sdk.models.MandatePayloadType type; + private String userAgent; + private String userIp; + + private Builder() {} + + /** + * Sets the value for {@code type}. + * + * @param type Type of mandate to create for the saved payment instrument. + * @return This builder instance. + */ + public Builder type(com.sumup.sdk.models.MandatePayloadType type) { + this.type = type; + return this; + } + + /** + * Sets the value for {@code userAgent}. + * + * @param userAgent Browser or client user agent observed when consent was collected. + * @return This builder instance. + */ + public Builder userAgent(String userAgent) { + this.userAgent = userAgent; + return this; + } + + /** + * Sets the value for {@code userIp}. + * + * @param userIp IP address of the payer when the mandate was accepted. + * @return This builder instance. + */ + public Builder userIp(String userIp) { + this.userIp = userIp; + return this; + } + + /** + * Builds an immutable MandatePayload instance. + * + * @return Immutable MandatePayload. + */ + public MandatePayload build() { + return new MandatePayload( + Objects.requireNonNull(type, "type"), + Objects.requireNonNull(userAgent, "userAgent"), + userIp); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/MandatePayloadType.java b/src/main/java/com/sumup/sdk/models/MandatePayloadType.java new file mode 100644 index 0000000..6ea55a9 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/MandatePayloadType.java @@ -0,0 +1,53 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; + +/** Type of mandate to create for the saved payment instrument. */ +public final class MandatePayloadType { + public static final MandatePayloadType RECURRENT = new MandatePayloadType("recurrent"); + + private final String value; + + private MandatePayloadType(String value) { + this.value = Objects.requireNonNull(value, "value"); + } + + /** + * Creates a MandatePayloadType for a value not yet known to this SDK version. + * + * @param value Wire value sent to or received from the API. + * @return Open enum value wrapping {@code value}. + */ + public static MandatePayloadType of(String value) { + return new MandatePayloadType(value); + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return value; + } + + @JsonCreator + public static MandatePayloadType fromValue(String value) { + return value == null ? null : new MandatePayloadType(value); + } + + @Override + public boolean equals(Object other) { + return this == other + || (other instanceof MandatePayloadType that && this.value.equals(that.value)); + } + + @Override + public int hashCode() { + return value.hashCode(); + } +} diff --git a/src/main/java/com/sumup/sdk/models/ProcessCheckout.java b/src/main/java/com/sumup/sdk/models/ProcessCheckout.java new file mode 100644 index 0000000..93a78f5 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/ProcessCheckout.java @@ -0,0 +1,202 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** + * Request body for attempting payment on an existing checkout. The required companion fields depend + * on the selected `payment_type`, for example card details, saved-card data, or payer information + * required by a specific payment method. + */ +public record ProcessCheckout( + /** + * Raw payment token object received from Apple Pay. Send the Apple Pay response payload as-is. + */ + java.util.Map applePay, + + /** __Required when payment type is `card`.__ Details of the payment card. */ + com.sumup.sdk.models.Card card, + + /** + * Customer identifier associated with the saved payment instrument. Required when `token` is + * provided. + */ + String customerId, + + /** + * Raw `PaymentData` object received from Google Pay. Send the Google Pay response payload + * as-is. + */ + java.util.Map googlePay, + + /** Number of installments for deferred payments. Available only to merchant users in Brazil. */ + Long installments, + + /** + * Mandate details used when a checkout should create a reusable card token for future recurring + * or merchant-initiated payments. + */ + com.sumup.sdk.models.MandatePayload mandate, + + /** + * Payment method used for this processing attempt. It determines which additional request + * fields are required. + */ + com.sumup.sdk.models.ProcessCheckoutPaymentType paymentType, + + /** Personal details for the customer. */ + com.sumup.sdk.models.PersonalDetails personalDetails, + + /** + * Saved-card token to use instead of raw card details when processing with a previously stored + * payment instrument. + */ + String token) { + /** + * Creates a builder for ProcessCheckout. + * + * @return Builder that constructs immutable ProcessCheckout instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for ProcessCheckout instances. */ + public static final class Builder { + private java.util.Map applePay; + private com.sumup.sdk.models.Card card; + private String customerId; + private java.util.Map googlePay; + private Long installments; + private com.sumup.sdk.models.MandatePayload mandate; + private com.sumup.sdk.models.ProcessCheckoutPaymentType paymentType; + private com.sumup.sdk.models.PersonalDetails personalDetails; + private String token; + + private Builder() {} + + /** + * Sets the value for {@code applePay}. + * + * @param applePay Raw payment token object received from Apple Pay. Send the Apple Pay response + * payload as-is. + * @return This builder instance. + */ + public Builder applePay(java.util.Map applePay) { + this.applePay = applePay; + return this; + } + + /** + * Sets the value for {@code card}. + * + * @param card __Required when payment type is `card`.__ Details of the payment card. + * @return This builder instance. + */ + public Builder card(com.sumup.sdk.models.Card card) { + this.card = card; + return this; + } + + /** + * Sets the value for {@code customerId}. + * + * @param customerId Customer identifier associated with the saved payment instrument. Required + * when `token` is provided. + * @return This builder instance. + */ + public Builder customerId(String customerId) { + this.customerId = customerId; + return this; + } + + /** + * Sets the value for {@code googlePay}. + * + * @param googlePay Raw `PaymentData` object received from Google Pay. Send the Google Pay + * response payload as-is. + * @return This builder instance. + */ + public Builder googlePay(java.util.Map googlePay) { + this.googlePay = googlePay; + return this; + } + + /** + * Sets the value for {@code installments}. + * + * @param installments Number of installments for deferred payments. Available only to merchant + * users in Brazil. + * @return This builder instance. + */ + public Builder installments(Long installments) { + this.installments = installments; + return this; + } + + /** + * Sets the value for {@code mandate}. + * + * @param mandate Mandate details used when a checkout should create a reusable card token for + * future recurring or merchant-initiated payments. + * @return This builder instance. + */ + public Builder mandate(com.sumup.sdk.models.MandatePayload mandate) { + this.mandate = mandate; + return this; + } + + /** + * Sets the value for {@code paymentType}. + * + * @param paymentType Payment method used for this processing attempt. It determines which + * additional request fields are required. + * @return This builder instance. + */ + public Builder paymentType(com.sumup.sdk.models.ProcessCheckoutPaymentType paymentType) { + this.paymentType = paymentType; + return this; + } + + /** + * Sets the value for {@code personalDetails}. + * + * @param personalDetails Personal details for the customer. + * @return This builder instance. + */ + public Builder personalDetails(com.sumup.sdk.models.PersonalDetails personalDetails) { + this.personalDetails = personalDetails; + return this; + } + + /** + * Sets the value for {@code token}. + * + * @param token Saved-card token to use instead of raw card details when processing with a + * previously stored payment instrument. + * @return This builder instance. + */ + public Builder token(String token) { + this.token = token; + return this; + } + + /** + * Builds an immutable ProcessCheckout instance. + * + * @return Immutable ProcessCheckout. + */ + public ProcessCheckout build() { + return new ProcessCheckout( + applePay, + card, + customerId, + googlePay, + installments, + mandate, + Objects.requireNonNull(paymentType, "paymentType"), + personalDetails, + token); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/ProcessCheckoutPaymentType.java b/src/main/java/com/sumup/sdk/models/ProcessCheckoutPaymentType.java new file mode 100644 index 0000000..5d2713d --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/ProcessCheckoutPaymentType.java @@ -0,0 +1,65 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; + +/** + * Payment method used for this processing attempt. It determines which additional request fields + * are required. + */ +public final class ProcessCheckoutPaymentType { + public static final ProcessCheckoutPaymentType CARD = new ProcessCheckoutPaymentType("card"); + public static final ProcessCheckoutPaymentType BOLETO = new ProcessCheckoutPaymentType("boleto"); + public static final ProcessCheckoutPaymentType IDEAL = new ProcessCheckoutPaymentType("ideal"); + public static final ProcessCheckoutPaymentType BLIK = new ProcessCheckoutPaymentType("blik"); + public static final ProcessCheckoutPaymentType BANCONTACT = + new ProcessCheckoutPaymentType("bancontact"); + public static final ProcessCheckoutPaymentType GOOGLE_PAY = + new ProcessCheckoutPaymentType("google_pay"); + public static final ProcessCheckoutPaymentType APPLE_PAY = + new ProcessCheckoutPaymentType("apple_pay"); + + private final String value; + + private ProcessCheckoutPaymentType(String value) { + this.value = Objects.requireNonNull(value, "value"); + } + + /** + * Creates a ProcessCheckoutPaymentType for a value not yet known to this SDK version. + * + * @param value Wire value sent to or received from the API. + * @return Open enum value wrapping {@code value}. + */ + public static ProcessCheckoutPaymentType of(String value) { + return new ProcessCheckoutPaymentType(value); + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return value; + } + + @JsonCreator + public static ProcessCheckoutPaymentType fromValue(String value) { + return value == null ? null : new ProcessCheckoutPaymentType(value); + } + + @Override + public boolean equals(Object other) { + return this == other + || (other instanceof ProcessCheckoutPaymentType that && this.value.equals(that.value)); + } + + @Override + public int hashCode() { + return value.hashCode(); + } +}