From 427421bcd4bdbe77e1ffac41f18e47e324c281d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matou=C5=A1=20Dzivjak?= Date: Thu, 23 Apr 2026 14:13:25 +0200 Subject: [PATCH] feat(sdk): improve method names Generate Java client method names from `x-codegen.method_name` when present, falling back to `operationId` only when the extension is missing. Because methods are already scoped by tag client, this produces cleaner APIs such as `readers().terminateCheckout(...)`, `readers().list(...)`, and c`heckouts().create(...)`. --- README.md | 12 +- .../internal/generator/method_name_test.go | 80 ++++ codegen/internal/generator/model.go | 29 +- .../sumup/examples/basic/BasicExample.java | 2 +- .../cardreader/CardReaderCheckoutExample.java | 4 +- .../sdk/clients/CheckoutsAsyncClient.java | 318 +++++++------- .../sumup/sdk/clients/CheckoutsClient.java | 302 ++++++------- .../sdk/clients/CustomersAsyncClient.java | 18 +- .../sumup/sdk/clients/CustomersClient.java | 18 +- .../sumup/sdk/clients/MembersAsyncClient.java | 37 +- .../com/sumup/sdk/clients/MembersClient.java | 37 +- .../sdk/clients/MembershipsAsyncClient.java | 10 +- .../sumup/sdk/clients/MembershipsClient.java | 10 +- .../sdk/clients/MerchantsAsyncClient.java | 10 +- .../sumup/sdk/clients/MerchantsClient.java | 12 +- .../sumup/sdk/clients/PayoutsAsyncClient.java | 112 ++--- .../com/sumup/sdk/clients/PayoutsClient.java | 112 ++--- .../sumup/sdk/clients/ReadersAsyncClient.java | 184 ++++---- .../com/sumup/sdk/clients/ReadersClient.java | 180 ++++---- .../sdk/clients/ReceiptsAsyncClient.java | 10 +- .../com/sumup/sdk/clients/ReceiptsClient.java | 12 +- .../sumup/sdk/clients/RolesAsyncClient.java | 35 +- .../com/sumup/sdk/clients/RolesClient.java | 31 +- .../sdk/clients/TransactionsAsyncClient.java | 406 +++++++++--------- .../sumup/sdk/clients/TransactionsClient.java | 403 +++++++++-------- .../com/sumup/sdk/core/ApiClientTest.java | 2 +- 26 files changed, 1244 insertions(+), 1142 deletions(-) create mode 100644 codegen/internal/generator/method_name_test.go diff --git a/README.md b/README.md index cc003b2..6ccbdca 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ CheckoutCreateRequest request = .returnUrl("https://example.com/webhook") .build(); -var checkout = client.checkouts().createCheckout(request); +var checkout = client.checkouts().create(request); System.out.printf("Checkout %s created with id %s%n", checkout.checkoutReference(), checkout.id()); ``` @@ -143,7 +143,7 @@ CompletableFuture checkoutFuture = .returnUrl("https://example.com/webhook") .build(); - return client.checkouts().createCheckout(request); + return client.checkouts().create(request); }) .thenAccept( checkout -> @@ -175,7 +175,7 @@ String readerId = Optional.ofNullable(System.getenv("SUMUP_READER_ID")) .orElseGet( () -> - client.readers().listReaders(merchantCode).items().stream() + client.readers().list(merchantCode).items().stream() .findFirst() .map(reader -> reader.id().value()) .orElseThrow(() -> new IllegalStateException("No paired readers found."))); @@ -192,7 +192,7 @@ CreateReaderCheckoutRequest request = .returnUrl("https://example.com/webhook") .build(); -client.readers().createReaderCheckout(merchantCode, readerId, request); +client.readers().createCheckout(merchantCode, readerId, request); System.out.println("Reader checkout created."); ``` @@ -219,7 +219,7 @@ CompletableFuture readerIdFuture = () -> client .readers() - .listReaders(merchantCode) + .list(merchantCode) .thenApply( response -> response.items().stream() @@ -244,7 +244,7 @@ readerIdFuture .returnUrl("https://example.com/webhook") .build(); - return client.readers().createReaderCheckout(merchantCode, readerId, request); + return client.readers().createCheckout(merchantCode, readerId, request); }) .thenAccept( response -> diff --git a/codegen/internal/generator/method_name_test.go b/codegen/internal/generator/method_name_test.go new file mode 100644 index 0000000..c0f330e --- /dev/null +++ b/codegen/internal/generator/method_name_test.go @@ -0,0 +1,80 @@ +package generator + +import ( + "context" + "os" + "path/filepath" + "testing" +) + +func TestGenerateClientUsesCodegenMethodName(t *testing.T) { + t.Parallel() + + tmp := t.TempDir() + specPath := filepath.Join(tmp, "openapi.json") + outputDir := filepath.Join(tmp, "src", "main", "java") + resourceDir := filepath.Join(tmp, "src", "main", "resources") + + spec := `{ + "openapi": "3.0.3", + "info": { + "title": "test", + "version": "1.0.0" + }, + "paths": { + "/v0.1/merchants/{merchant_code}/readers/{reader_id}/terminate": { + "post": { + "operationId": "CreateReaderTerminate", + "summary": "Terminate a Reader Checkout", + "parameters": [ + { + "name": "merchant_code", + "in": "path", + "required": true, + "schema": { "type": "string" } + }, + { + "name": "reader_id", + "in": "path", + "required": true, + "schema": { "type": "string" } + } + ], + "responses": { + "204": { + "description": "Terminated" + } + }, + "tags": ["Readers"], + "x-codegen": { + "method_name": "terminate_checkout" + } + } + } + } +}` + if err := os.WriteFile(specPath, []byte(spec), 0o644); err != nil { + t.Fatalf("write spec: %v", err) + } + + params := Params{ + SpecPath: specPath, + OutputDir: outputDir, + ResourceDir: resourceDir, + BasePackage: "com.test.sdk", + } + if err := Run(context.Background(), params); err != nil { + t.Fatalf("run generator: %v", err) + } + + clientPath := filepath.Join(outputDir, "com", "test", "sdk", "clients", "ReadersClient.java") + content, err := os.ReadFile(clientPath) + if err != nil { + t.Fatalf("read generated client: %v", err) + } + generated := string(content) + + assertContains(t, generated, "void terminateCheckout(String merchantCode, String readerId)") + assertContains(t, generated, "Operation ID: CreateReaderTerminate") + assertNotContains(t, generated, "createReaderTerminate") +} diff --git a/codegen/internal/generator/model.go b/codegen/internal/generator/model.go index ae72adb..385c198 100644 --- a/codegen/internal/generator/model.go +++ b/codegen/internal/generator/model.go @@ -233,7 +233,7 @@ func convertOperation(method, path string, item *v3.PathItem, op *v3.Operation, sanitizedID := sanitizeOperationID(op.OperationId) model := operationModel{ OperationID: sanitizedID, - MethodName: camelCase(sanitizedID, "operation"), + MethodName: operationMethodName(op, sanitizedID), SummaryLines: splitComment(strings.TrimSpace(op.Summary)), DescriptionLines: splitComment(strings.TrimSpace(op.Description)), HttpMethod: strings.ToUpper(method), @@ -306,6 +306,33 @@ func sanitizeOperationID(operationID string) string { return operationID } +// operationMethodName returns the Java method name for an OpenAPI operation. +// When present, x-codegen.method_name is preferred because generated methods +// are already scoped to their tag client. +func operationMethodName(op *v3.Operation, fallbackID string) string { + if methodName := codegenMethodName(op); methodName != "" { + return camelCase(methodName, "operation") + } + return camelCase(fallbackID, "operation") +} + +func codegenMethodName(op *v3.Operation) string { + if op == nil || op.Extensions == nil { + return "" + } + node := op.Extensions.GetOrZero("x-codegen") + if node == nil { + return "" + } + var extension struct { + MethodName string `yaml:"method_name"` + } + if err := node.Decode(&extension); err != nil { + return "" + } + return strings.TrimSpace(extension.MethodName) +} + // collectParameters merges operation and path-level parameters, filtering out // nil references along the way. func collectParameters(item *v3.PathItem, op *v3.Operation) []*v3.Parameter { diff --git a/examples/basic/src/main/java/com/sumup/examples/basic/BasicExample.java b/examples/basic/src/main/java/com/sumup/examples/basic/BasicExample.java index 9c86842..a2ce24c 100644 --- a/examples/basic/src/main/java/com/sumup/examples/basic/BasicExample.java +++ b/examples/basic/src/main/java/com/sumup/examples/basic/BasicExample.java @@ -18,7 +18,7 @@ public static void main(String[] args) { SumUpClient client = new SumUpClient(); try { - List checkouts = client.checkouts().listCheckouts(); + List checkouts = client.checkouts().list(); System.out.printf("Fetched %d checkouts.%n", checkouts.size()); } catch (ApiException ex) { System.err.printf( diff --git a/examples/card-reader-checkout/src/main/java/com/sumup/examples/cardreader/CardReaderCheckoutExample.java b/examples/card-reader-checkout/src/main/java/com/sumup/examples/cardreader/CardReaderCheckoutExample.java index bc7acff..d155b61 100644 --- a/examples/card-reader-checkout/src/main/java/com/sumup/examples/cardreader/CardReaderCheckoutExample.java +++ b/examples/card-reader-checkout/src/main/java/com/sumup/examples/cardreader/CardReaderCheckoutExample.java @@ -18,7 +18,7 @@ public static void main(String[] args) { SumUpClient client = new SumUpClient(); Optional readerId = - client.readers().listReaders(merchantCode).items().stream() + client.readers().list(merchantCode).items().stream() .findFirst() .map(reader -> reader.id().value()); if (readerId.isEmpty()) { @@ -46,7 +46,7 @@ private static boolean createReaderCheckout( .build(); try { - client.readers().createReaderCheckout(merchantCode, readerId, request); + client.readers().createCheckout(merchantCode, readerId, request); return true; } catch (ApiException ex) { System.err.printf( diff --git a/src/main/java/com/sumup/sdk/clients/CheckoutsAsyncClient.java b/src/main/java/com/sumup/sdk/clients/CheckoutsAsyncClient.java index 1938ce2..416d6e2 100644 --- a/src/main/java/com/sumup/sdk/clients/CheckoutsAsyncClient.java +++ b/src/main/java/com/sumup/sdk/clients/CheckoutsAsyncClient.java @@ -40,6 +40,59 @@ public CheckoutsAsyncClient(ApiClient apiClient) { this.apiClient = Objects.requireNonNull(apiClient, "apiClient"); } + /** + * Create a checkout + * + *

Creates a new payment checkout resource. The unique `checkout_reference` created by this + * request, is used for further manipulation of the checkout. For 3DS checkouts, add the + * `redirect_url` parameter to your request body schema. Follow by processing a checkout to charge + * the provided payment instrument. + * + *

Operation ID: CreateCheckout + * + * @param request Details for creating a checkout resource. + *

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

Creates a new payment checkout resource. The unique `checkout_reference` created by this + * request, is used for further manipulation of the checkout. For 3DS checkouts, add the + * `redirect_url` parameter to your request body schema. Follow by processing a checkout to charge + * the provided payment instrument. + * + *

Operation ID: CreateCheckout + * + * @param request Details for creating a checkout resource. + * @param requestOptions Request-specific overrides (headers, authorization, or timeout). Pass + * {@code null} to use client defaults. + * @return CompletableFuture resolved with com.sumup.sdk.models.Checkout parsed response. + * @throws ApiException if the SumUp API returns an error. + */ + public CompletableFuture create( + com.sumup.sdk.models.CheckoutCreateRequest request, RequestOptions requestOptions) + throws ApiException { + Objects.requireNonNull(request, "request"); + String path = "/v0.1/checkouts"; + + return this.apiClient.sendAsync( + HttpMethod.POST, + path, + null, + null, + request, + new TypeReference() {}, + requestOptions); + } + /** * Create an Apple Pay session * @@ -100,59 +153,6 @@ public CompletableFuture> createApplePaySession( requestOptions); } - /** - * Create a checkout - * - *

Creates a new payment checkout resource. The unique `checkout_reference` created by this - * request, is used for further manipulation of the checkout. For 3DS checkouts, add the - * `redirect_url` parameter to your request body schema. Follow by processing a checkout to charge - * the provided payment instrument. - * - *

Operation ID: CreateCheckout - * - * @param request Details for creating a checkout resource. - *

Call the overload that accepts RequestOptions to customize headers, authorization, or - * request timeout. - * @return CompletableFuture resolved with com.sumup.sdk.models.Checkout parsed response. - * @throws ApiException if the SumUp API returns an error. - */ - public CompletableFuture createCheckout( - com.sumup.sdk.models.CheckoutCreateRequest request) throws ApiException { - return createCheckout(request, null); - } - - /** - * Create a checkout - * - *

Creates a new payment checkout resource. The unique `checkout_reference` created by this - * request, is used for further manipulation of the checkout. For 3DS checkouts, add the - * `redirect_url` parameter to your request body schema. Follow by processing a checkout to charge - * the provided payment instrument. - * - *

Operation ID: CreateCheckout - * - * @param request Details for creating a checkout resource. - * @param requestOptions Request-specific overrides (headers, authorization, or timeout). Pass - * {@code null} to use client defaults. - * @return CompletableFuture resolved with com.sumup.sdk.models.Checkout parsed response. - * @throws ApiException if the SumUp API returns an error. - */ - public CompletableFuture createCheckout( - com.sumup.sdk.models.CheckoutCreateRequest request, RequestOptions requestOptions) - throws ApiException { - Objects.requireNonNull(request, "request"); - String path = "/v0.1/checkouts"; - - return this.apiClient.sendAsync( - HttpMethod.POST, - path, - null, - null, - request, - new TypeReference() {}, - requestOptions); - } - /** * Deactivate a checkout * @@ -167,9 +167,9 @@ public CompletableFuture createCheckout( * @return CompletableFuture resolved with com.sumup.sdk.models.Checkout parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture deactivateCheckout(String id) + public CompletableFuture deactivate(String id) throws ApiException { - return deactivateCheckout(id, null); + return deactivate(id, null); } /** @@ -186,7 +186,7 @@ public CompletableFuture deactivateCheckout(Strin * @return CompletableFuture resolved with com.sumup.sdk.models.Checkout parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture deactivateCheckout( + public CompletableFuture deactivate( String id, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(id, "id"); String path = "/v0.1/checkouts/{id}"; @@ -216,9 +216,9 @@ public CompletableFuture deactivateCheckout( * @return CompletableFuture resolved with com.sumup.sdk.models.CheckoutSuccess parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture getCheckout(String id) + public CompletableFuture get(String id) throws ApiException { - return getCheckout(id, null); + return get(id, null); } /** @@ -235,7 +235,7 @@ public CompletableFuture getCheckout(Strin * @return CompletableFuture resolved with com.sumup.sdk.models.CheckoutSuccess parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture getCheckout( + public CompletableFuture get( String id, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(id, "id"); String path = "/v0.1/checkouts/{id}"; @@ -252,72 +252,63 @@ public CompletableFuture getCheckout( } /** - * Get available payment methods + * List checkouts * - *

Get payment methods available for the given merchant to use with a checkout. + *

Lists created checkout resources according to the applied `checkout_reference`. * - *

Operation ID: GetPaymentMethods + *

Operation ID: ListCheckouts * - * @param merchantCode The SumUp merchant code. - *

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.GetPaymentMethodsResponse parsed - * response. + *

Call the overload that accepts optional parameter objects or RequestOptions to customize + * headers, authorization, query values, or timeouts. + * + * @return CompletableFuture resolved with {@code + * java.util.List} parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture getPaymentMethods( - String merchantCode) throws ApiException { - return getPaymentMethods(merchantCode, null); + public CompletableFuture> list() + throws ApiException { + return list(null); } /** - * Get available payment methods + * List checkouts * - *

Get payment methods available for the given merchant to use with a checkout. + *

Lists created checkout resources according to the applied `checkout_reference`. * - *

Operation ID: GetPaymentMethods + *

Operation ID: ListCheckouts * - * @param merchantCode The SumUp merchant code. - * @param getPaymentMethods Optional query parameters for this request. + * @param listCheckouts 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.GetPaymentMethodsResponse parsed - * response. + * @return CompletableFuture resolved with {@code + * java.util.List} parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture getPaymentMethods( - String merchantCode, GetPaymentMethodsQueryParams getPaymentMethods) throws ApiException { - return getPaymentMethods(merchantCode, getPaymentMethods, null); + public CompletableFuture> list( + ListCheckoutsQueryParams listCheckouts) throws ApiException { + return list(listCheckouts, null); } /** - * Get available payment methods + * List checkouts * - *

Get payment methods available for the given merchant to use with a checkout. + *

Lists created checkout resources according to the applied `checkout_reference`. * - *

Operation ID: GetPaymentMethods + *

Operation ID: ListCheckouts * - * @param merchantCode The SumUp merchant code. - * @param getPaymentMethods Optional query parameters for this request. + * @param listCheckouts 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.GetPaymentMethodsResponse parsed - * response. + * @return CompletableFuture resolved with {@code + * java.util.List} parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture getPaymentMethods( - String merchantCode, - GetPaymentMethodsQueryParams getPaymentMethods, - RequestOptions requestOptions) - throws ApiException { - Objects.requireNonNull(merchantCode, "merchantCode"); - String path = "/v0.1/merchants/{merchant_code}/payment-methods"; - path = - path.replace( - "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); + public CompletableFuture> list( + ListCheckoutsQueryParams listCheckouts, RequestOptions requestOptions) throws ApiException { + String path = "/v0.1/checkouts"; Map queryParams = new LinkedHashMap<>(); - if (getPaymentMethods != null) { - queryParams.putAll(getPaymentMethods.toMap()); + if (listCheckouts != null) { + queryParams.putAll(listCheckouts.toMap()); } return this.apiClient.sendAsync( @@ -326,68 +317,79 @@ public CompletableFuture getPaym queryParams, null, null, - new TypeReference() {}, + new TypeReference>() {}, requestOptions); } /** - * List checkouts - * - *

Lists created checkout resources according to the applied `checkout_reference`. + * Get available payment methods * - *

Operation ID: ListCheckouts + *

Get payment methods available for the given merchant to use with a checkout. * - *

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

Operation ID: GetPaymentMethods * - * @return CompletableFuture resolved with {@code - * java.util.List} parsed response. + * @param merchantCode The SumUp merchant code. + *

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.GetPaymentMethodsResponse parsed + * response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture> listCheckouts() - throws ApiException { - return listCheckouts(null); + public CompletableFuture + listAvailablePaymentMethods(String merchantCode) throws ApiException { + return listAvailablePaymentMethods(merchantCode, null); } /** - * List checkouts + * Get available payment methods * - *

Lists created checkout resources according to the applied `checkout_reference`. + *

Get payment methods available for the given merchant to use with a checkout. * - *

Operation ID: ListCheckouts + *

Operation ID: GetPaymentMethods * - * @param listCheckouts Optional query parameters for this request. + * @param merchantCode The SumUp merchant code. + * @param getPaymentMethods Optional query parameters for this request. *

Call the overload that accepts RequestOptions to customize headers, authorization, or * request timeout. - * @return CompletableFuture resolved with {@code - * java.util.List} parsed response. + * @return CompletableFuture resolved with com.sumup.sdk.models.GetPaymentMethodsResponse parsed + * response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture> listCheckouts( - ListCheckoutsQueryParams listCheckouts) throws ApiException { - return listCheckouts(listCheckouts, null); + public CompletableFuture + listAvailablePaymentMethods( + String merchantCode, GetPaymentMethodsQueryParams getPaymentMethods) throws ApiException { + return listAvailablePaymentMethods(merchantCode, getPaymentMethods, null); } /** - * List checkouts + * Get available payment methods * - *

Lists created checkout resources according to the applied `checkout_reference`. + *

Get payment methods available for the given merchant to use with a checkout. * - *

Operation ID: ListCheckouts + *

Operation ID: GetPaymentMethods * - * @param listCheckouts Optional query parameters for this request. + * @param merchantCode The SumUp merchant code. + * @param getPaymentMethods 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 {@code - * java.util.List} parsed response. + * @return CompletableFuture resolved with com.sumup.sdk.models.GetPaymentMethodsResponse parsed + * response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture> listCheckouts( - ListCheckoutsQueryParams listCheckouts, RequestOptions requestOptions) throws ApiException { - String path = "/v0.1/checkouts"; + public CompletableFuture + listAvailablePaymentMethods( + String merchantCode, + GetPaymentMethodsQueryParams getPaymentMethods, + RequestOptions requestOptions) + throws ApiException { + Objects.requireNonNull(merchantCode, "merchantCode"); + String path = "/v0.1/merchants/{merchant_code}/payment-methods"; + path = + path.replace( + "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); Map queryParams = new LinkedHashMap<>(); - if (listCheckouts != null) { - queryParams.putAll(listCheckouts.toMap()); + if (getPaymentMethods != null) { + queryParams.putAll(getPaymentMethods.toMap()); } return this.apiClient.sendAsync( @@ -396,7 +398,7 @@ public CompletableFuture> l queryParams, null, null, - new TypeReference>() {}, + new TypeReference() {}, requestOptions); } @@ -416,9 +418,9 @@ public CompletableFuture> l * @return CompletableFuture resolved with com.sumup.sdk.models.CheckoutSuccess parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture processCheckout( + public CompletableFuture process( String id, com.sumup.sdk.models.ProcessCheckout request) throws ApiException { - return processCheckout(id, request, null); + return process(id, request, null); } /** @@ -437,7 +439,7 @@ public CompletableFuture processCheckout( * @return CompletableFuture resolved with com.sumup.sdk.models.CheckoutSuccess parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture processCheckout( + public CompletableFuture process( String id, com.sumup.sdk.models.ProcessCheckout request, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(id, "id"); @@ -456,28 +458,17 @@ public CompletableFuture processCheckout( } /** Optional query parameters for this request. */ - public static final class GetPaymentMethodsQueryParams { + public static final class ListCheckoutsQueryParams { private final Map values = new LinkedHashMap<>(); /** - * Sets the amount query parameter. - * - * @param value The amount for which the payment methods should be eligible, in major units. - * @return This GetPaymentMethodsQueryParams instance. - */ - public GetPaymentMethodsQueryParams amount(Double value) { - this.values.put("amount", Objects.requireNonNull(value, "amount")); - return this; - } - - /** - * Sets the currency query parameter. + * Sets the checkout_reference query parameter. * - * @param value The currency for which the payment methods should be eligible. - * @return This GetPaymentMethodsQueryParams instance. + * @param value Filters the list of checkout resources by the unique ID of the checkout. + * @return This ListCheckoutsQueryParams instance. */ - public GetPaymentMethodsQueryParams currency(String value) { - this.values.put("currency", Objects.requireNonNull(value, "currency")); + public ListCheckoutsQueryParams checkoutReference(String value) { + this.values.put("checkout_reference", Objects.requireNonNull(value, "checkoutReference")); return this; } @@ -492,17 +483,28 @@ Map toMap() { } /** Optional query parameters for this request. */ - public static final class ListCheckoutsQueryParams { + public static final class GetPaymentMethodsQueryParams { private final Map values = new LinkedHashMap<>(); /** - * Sets the checkout_reference query parameter. + * Sets the amount query parameter. * - * @param value Filters the list of checkout resources by the unique ID of the checkout. - * @return This ListCheckoutsQueryParams instance. + * @param value The amount for which the payment methods should be eligible, in major units. + * @return This GetPaymentMethodsQueryParams instance. */ - public ListCheckoutsQueryParams checkoutReference(String value) { - this.values.put("checkout_reference", Objects.requireNonNull(value, "checkoutReference")); + public GetPaymentMethodsQueryParams amount(Double value) { + this.values.put("amount", Objects.requireNonNull(value, "amount")); + return this; + } + + /** + * Sets the currency query parameter. + * + * @param value The currency for which the payment methods should be eligible. + * @return This GetPaymentMethodsQueryParams instance. + */ + public GetPaymentMethodsQueryParams currency(String value) { + this.values.put("currency", Objects.requireNonNull(value, "currency")); return this; } diff --git a/src/main/java/com/sumup/sdk/clients/CheckoutsClient.java b/src/main/java/com/sumup/sdk/clients/CheckoutsClient.java index 3a703bc..b1ea934 100644 --- a/src/main/java/com/sumup/sdk/clients/CheckoutsClient.java +++ b/src/main/java/com/sumup/sdk/clients/CheckoutsClient.java @@ -39,6 +39,59 @@ public CheckoutsClient(ApiClient apiClient) { this.apiClient = Objects.requireNonNull(apiClient, "apiClient"); } + /** + * Create a checkout + * + *

Creates a new payment checkout resource. The unique `checkout_reference` created by this + * request, is used for further manipulation of the checkout. For 3DS checkouts, add the + * `redirect_url` parameter to your request body schema. Follow by processing a checkout to charge + * the provided payment instrument. + * + *

Operation ID: CreateCheckout + * + * @param request Details for creating a checkout resource. + *

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

Creates a new payment checkout resource. The unique `checkout_reference` created by this + * request, is used for further manipulation of the checkout. For 3DS checkouts, add the + * `redirect_url` parameter to your request body schema. Follow by processing a checkout to charge + * the provided payment instrument. + * + *

Operation ID: CreateCheckout + * + * @param request Details for creating a checkout resource. + * @param requestOptions Request-specific overrides (headers, authorization, or timeout). Pass + * {@code null} to use client defaults. + * @return com.sumup.sdk.models.Checkout parsed response. + * @throws ApiException if the SumUp API returns an error. + */ + public com.sumup.sdk.models.Checkout create( + com.sumup.sdk.models.CheckoutCreateRequest request, RequestOptions requestOptions) + throws ApiException { + Objects.requireNonNull(request, "request"); + String path = "/v0.1/checkouts"; + + return this.apiClient.send( + HttpMethod.POST, + path, + null, + null, + request, + new TypeReference() {}, + requestOptions); + } + /** * Create an Apple Pay session * @@ -99,59 +152,6 @@ public java.util.Map createApplePaySession( requestOptions); } - /** - * Create a checkout - * - *

Creates a new payment checkout resource. The unique `checkout_reference` created by this - * request, is used for further manipulation of the checkout. For 3DS checkouts, add the - * `redirect_url` parameter to your request body schema. Follow by processing a checkout to charge - * the provided payment instrument. - * - *

Operation ID: CreateCheckout - * - * @param request Details for creating a checkout resource. - *

Call the overload that accepts RequestOptions to customize headers, authorization, or - * request timeout. - * @return com.sumup.sdk.models.Checkout parsed response. - * @throws ApiException if the SumUp API returns an error. - */ - public com.sumup.sdk.models.Checkout createCheckout( - com.sumup.sdk.models.CheckoutCreateRequest request) throws ApiException { - return createCheckout(request, null); - } - - /** - * Create a checkout - * - *

Creates a new payment checkout resource. The unique `checkout_reference` created by this - * request, is used for further manipulation of the checkout. For 3DS checkouts, add the - * `redirect_url` parameter to your request body schema. Follow by processing a checkout to charge - * the provided payment instrument. - * - *

Operation ID: CreateCheckout - * - * @param request Details for creating a checkout resource. - * @param requestOptions Request-specific overrides (headers, authorization, or timeout). Pass - * {@code null} to use client defaults. - * @return com.sumup.sdk.models.Checkout parsed response. - * @throws ApiException if the SumUp API returns an error. - */ - public com.sumup.sdk.models.Checkout createCheckout( - com.sumup.sdk.models.CheckoutCreateRequest request, RequestOptions requestOptions) - throws ApiException { - Objects.requireNonNull(request, "request"); - String path = "/v0.1/checkouts"; - - return this.apiClient.send( - HttpMethod.POST, - path, - null, - null, - request, - new TypeReference() {}, - requestOptions); - } - /** * Deactivate a checkout * @@ -166,8 +166,8 @@ public com.sumup.sdk.models.Checkout createCheckout( * @return com.sumup.sdk.models.Checkout parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Checkout deactivateCheckout(String id) throws ApiException { - return deactivateCheckout(id, null); + public com.sumup.sdk.models.Checkout deactivate(String id) throws ApiException { + return deactivate(id, null); } /** @@ -184,7 +184,7 @@ public com.sumup.sdk.models.Checkout deactivateCheckout(String id) throws ApiExc * @return com.sumup.sdk.models.Checkout parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Checkout deactivateCheckout(String id, RequestOptions requestOptions) + public com.sumup.sdk.models.Checkout deactivate(String id, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(id, "id"); String path = "/v0.1/checkouts/{id}"; @@ -214,8 +214,8 @@ public com.sumup.sdk.models.Checkout deactivateCheckout(String id, RequestOption * @return com.sumup.sdk.models.CheckoutSuccess parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.CheckoutSuccess getCheckout(String id) throws ApiException { - return getCheckout(id, null); + public com.sumup.sdk.models.CheckoutSuccess get(String id) throws ApiException { + return get(id, null); } /** @@ -232,7 +232,7 @@ public com.sumup.sdk.models.CheckoutSuccess getCheckout(String id) throws ApiExc * @return com.sumup.sdk.models.CheckoutSuccess parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.CheckoutSuccess getCheckout(String id, RequestOptions requestOptions) + public com.sumup.sdk.models.CheckoutSuccess get(String id, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(id, "id"); String path = "/v0.1/checkouts/{id}"; @@ -249,69 +249,59 @@ public com.sumup.sdk.models.CheckoutSuccess getCheckout(String id, RequestOption } /** - * Get available payment methods + * List checkouts * - *

Get payment methods available for the given merchant to use with a checkout. + *

Lists created checkout resources according to the applied `checkout_reference`. * - *

Operation ID: GetPaymentMethods + *

Operation ID: ListCheckouts * - * @param merchantCode The SumUp merchant code. - *

Call the overload that accepts optional parameter objects or RequestOptions to customize - * headers, authorization, query values, or timeouts. - * @return com.sumup.sdk.models.GetPaymentMethodsResponse parsed response. + *

Call the overload that accepts optional parameter objects or RequestOptions to customize + * headers, authorization, query values, or timeouts. + * + * @return {@code java.util.List} parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.GetPaymentMethodsResponse getPaymentMethods(String merchantCode) - throws ApiException { - return getPaymentMethods(merchantCode, null); + public java.util.List list() throws ApiException { + return list(null); } /** - * Get available payment methods + * List checkouts * - *

Get payment methods available for the given merchant to use with a checkout. + *

Lists created checkout resources according to the applied `checkout_reference`. * - *

Operation ID: GetPaymentMethods + *

Operation ID: ListCheckouts * - * @param merchantCode The SumUp merchant code. - * @param getPaymentMethods Optional query parameters for this request. + * @param listCheckouts Optional query parameters for this request. *

Call the overload that accepts RequestOptions to customize headers, authorization, or * request timeout. - * @return com.sumup.sdk.models.GetPaymentMethodsResponse parsed response. + * @return {@code java.util.List} parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.GetPaymentMethodsResponse getPaymentMethods( - String merchantCode, GetPaymentMethodsQueryParams getPaymentMethods) throws ApiException { - return getPaymentMethods(merchantCode, getPaymentMethods, null); + public java.util.List list( + ListCheckoutsQueryParams listCheckouts) throws ApiException { + return list(listCheckouts, null); } /** - * Get available payment methods + * List checkouts * - *

Get payment methods available for the given merchant to use with a checkout. + *

Lists created checkout resources according to the applied `checkout_reference`. * - *

Operation ID: GetPaymentMethods + *

Operation ID: ListCheckouts * - * @param merchantCode The SumUp merchant code. - * @param getPaymentMethods Optional query parameters for this request. + * @param listCheckouts 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.GetPaymentMethodsResponse parsed response. + * @return {@code java.util.List} parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.GetPaymentMethodsResponse getPaymentMethods( - String merchantCode, - GetPaymentMethodsQueryParams getPaymentMethods, - RequestOptions requestOptions) - throws ApiException { - Objects.requireNonNull(merchantCode, "merchantCode"); - String path = "/v0.1/merchants/{merchant_code}/payment-methods"; - path = - path.replace( - "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); + public java.util.List list( + ListCheckoutsQueryParams listCheckouts, RequestOptions requestOptions) throws ApiException { + String path = "/v0.1/checkouts"; Map queryParams = new LinkedHashMap<>(); - if (getPaymentMethods != null) { - queryParams.putAll(getPaymentMethods.toMap()); + if (listCheckouts != null) { + queryParams.putAll(listCheckouts.toMap()); } return this.apiClient.send( @@ -320,64 +310,74 @@ public com.sumup.sdk.models.GetPaymentMethodsResponse getPaymentMethods( queryParams, null, null, - new TypeReference() {}, + new TypeReference>() {}, requestOptions); } /** - * List checkouts - * - *

Lists created checkout resources according to the applied `checkout_reference`. + * Get available payment methods * - *

Operation ID: ListCheckouts + *

Get payment methods available for the given merchant to use with a checkout. * - *

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

Operation ID: GetPaymentMethods * - * @return {@code java.util.List} parsed response. + * @param merchantCode The SumUp merchant code. + *

Call the overload that accepts optional parameter objects or RequestOptions to customize + * headers, authorization, query values, or timeouts. + * @return com.sumup.sdk.models.GetPaymentMethodsResponse parsed response. * @throws ApiException if the SumUp API returns an error. */ - public java.util.List listCheckouts() throws ApiException { - return listCheckouts(null); + public com.sumup.sdk.models.GetPaymentMethodsResponse listAvailablePaymentMethods( + String merchantCode) throws ApiException { + return listAvailablePaymentMethods(merchantCode, null); } /** - * List checkouts + * Get available payment methods * - *

Lists created checkout resources according to the applied `checkout_reference`. + *

Get payment methods available for the given merchant to use with a checkout. * - *

Operation ID: ListCheckouts + *

Operation ID: GetPaymentMethods * - * @param listCheckouts Optional query parameters for this request. + * @param merchantCode The SumUp merchant code. + * @param getPaymentMethods Optional query parameters for this request. *

Call the overload that accepts RequestOptions to customize headers, authorization, or * request timeout. - * @return {@code java.util.List} parsed response. + * @return com.sumup.sdk.models.GetPaymentMethodsResponse parsed response. * @throws ApiException if the SumUp API returns an error. */ - public java.util.List listCheckouts( - ListCheckoutsQueryParams listCheckouts) throws ApiException { - return listCheckouts(listCheckouts, null); + public com.sumup.sdk.models.GetPaymentMethodsResponse listAvailablePaymentMethods( + String merchantCode, GetPaymentMethodsQueryParams getPaymentMethods) throws ApiException { + return listAvailablePaymentMethods(merchantCode, getPaymentMethods, null); } /** - * List checkouts + * Get available payment methods * - *

Lists created checkout resources according to the applied `checkout_reference`. + *

Get payment methods available for the given merchant to use with a checkout. * - *

Operation ID: ListCheckouts + *

Operation ID: GetPaymentMethods * - * @param listCheckouts Optional query parameters for this request. + * @param merchantCode The SumUp merchant code. + * @param getPaymentMethods Optional query parameters for this request. * @param requestOptions Request-specific overrides (headers, authorization, or timeout). Pass * {@code null} to use client defaults. - * @return {@code java.util.List} parsed response. + * @return com.sumup.sdk.models.GetPaymentMethodsResponse parsed response. * @throws ApiException if the SumUp API returns an error. */ - public java.util.List listCheckouts( - ListCheckoutsQueryParams listCheckouts, RequestOptions requestOptions) throws ApiException { - String path = "/v0.1/checkouts"; + public com.sumup.sdk.models.GetPaymentMethodsResponse listAvailablePaymentMethods( + String merchantCode, + GetPaymentMethodsQueryParams getPaymentMethods, + RequestOptions requestOptions) + throws ApiException { + Objects.requireNonNull(merchantCode, "merchantCode"); + String path = "/v0.1/merchants/{merchant_code}/payment-methods"; + path = + path.replace( + "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); Map queryParams = new LinkedHashMap<>(); - if (listCheckouts != null) { - queryParams.putAll(listCheckouts.toMap()); + if (getPaymentMethods != null) { + queryParams.putAll(getPaymentMethods.toMap()); } return this.apiClient.send( @@ -386,7 +386,7 @@ public java.util.List listCheckouts( queryParams, null, null, - new TypeReference>() {}, + new TypeReference() {}, requestOptions); } @@ -406,9 +406,9 @@ public java.util.List listCheckouts( * @return com.sumup.sdk.models.CheckoutSuccess parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.CheckoutSuccess processCheckout( + public com.sumup.sdk.models.CheckoutSuccess process( String id, com.sumup.sdk.models.ProcessCheckout request) throws ApiException { - return processCheckout(id, request, null); + return process(id, request, null); } /** @@ -427,7 +427,7 @@ public com.sumup.sdk.models.CheckoutSuccess processCheckout( * @return com.sumup.sdk.models.CheckoutSuccess parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.CheckoutSuccess processCheckout( + public com.sumup.sdk.models.CheckoutSuccess process( String id, com.sumup.sdk.models.ProcessCheckout request, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(id, "id"); @@ -446,28 +446,17 @@ public com.sumup.sdk.models.CheckoutSuccess processCheckout( } /** Optional query parameters for this request. */ - public static final class GetPaymentMethodsQueryParams { + public static final class ListCheckoutsQueryParams { private final Map values = new LinkedHashMap<>(); /** - * Sets the amount query parameter. - * - * @param value The amount for which the payment methods should be eligible, in major units. - * @return This GetPaymentMethodsQueryParams instance. - */ - public GetPaymentMethodsQueryParams amount(Double value) { - this.values.put("amount", Objects.requireNonNull(value, "amount")); - return this; - } - - /** - * Sets the currency query parameter. + * Sets the checkout_reference query parameter. * - * @param value The currency for which the payment methods should be eligible. - * @return This GetPaymentMethodsQueryParams instance. + * @param value Filters the list of checkout resources by the unique ID of the checkout. + * @return This ListCheckoutsQueryParams instance. */ - public GetPaymentMethodsQueryParams currency(String value) { - this.values.put("currency", Objects.requireNonNull(value, "currency")); + public ListCheckoutsQueryParams checkoutReference(String value) { + this.values.put("checkout_reference", Objects.requireNonNull(value, "checkoutReference")); return this; } @@ -482,17 +471,28 @@ Map toMap() { } /** Optional query parameters for this request. */ - public static final class ListCheckoutsQueryParams { + public static final class GetPaymentMethodsQueryParams { private final Map values = new LinkedHashMap<>(); /** - * Sets the checkout_reference query parameter. + * Sets the amount query parameter. * - * @param value Filters the list of checkout resources by the unique ID of the checkout. - * @return This ListCheckoutsQueryParams instance. + * @param value The amount for which the payment methods should be eligible, in major units. + * @return This GetPaymentMethodsQueryParams instance. */ - public ListCheckoutsQueryParams checkoutReference(String value) { - this.values.put("checkout_reference", Objects.requireNonNull(value, "checkoutReference")); + public GetPaymentMethodsQueryParams amount(Double value) { + this.values.put("amount", Objects.requireNonNull(value, "amount")); + return this; + } + + /** + * Sets the currency query parameter. + * + * @param value The currency for which the payment methods should be eligible. + * @return This GetPaymentMethodsQueryParams instance. + */ + public GetPaymentMethodsQueryParams currency(String value) { + this.values.put("currency", Objects.requireNonNull(value, "currency")); return this; } diff --git a/src/main/java/com/sumup/sdk/clients/CustomersAsyncClient.java b/src/main/java/com/sumup/sdk/clients/CustomersAsyncClient.java index 95bb02e..3215b54 100644 --- a/src/main/java/com/sumup/sdk/clients/CustomersAsyncClient.java +++ b/src/main/java/com/sumup/sdk/clients/CustomersAsyncClient.java @@ -43,9 +43,9 @@ public CustomersAsyncClient(ApiClient apiClient) { * @return CompletableFuture resolved with com.sumup.sdk.models.Customer parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture createCustomer( + public CompletableFuture create( com.sumup.sdk.models.Customer request) throws ApiException { - return createCustomer(request, null); + return create(request, null); } /** @@ -62,7 +62,7 @@ public CompletableFuture createCustomer( * @return CompletableFuture resolved with com.sumup.sdk.models.Customer parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture createCustomer( + public CompletableFuture create( com.sumup.sdk.models.Customer request, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(request, "request"); String path = "/v0.1/customers"; @@ -136,9 +136,9 @@ public CompletableFuture deactivatePaymentInstrument( * @return CompletableFuture resolved with com.sumup.sdk.models.Customer parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture getCustomer(String customerId) + public CompletableFuture get(String customerId) throws ApiException { - return getCustomer(customerId, null); + return get(customerId, null); } /** @@ -155,7 +155,7 @@ public CompletableFuture getCustomer(String custo * @return CompletableFuture resolved with com.sumup.sdk.models.Customer parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture getCustomer( + public CompletableFuture get( String customerId, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(customerId, "customerId"); String path = "/v0.1/customers/{customer_id}"; @@ -236,9 +236,9 @@ public CompletableFuture getCustomer( * @return CompletableFuture resolved with com.sumup.sdk.models.Customer parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture updateCustomer( + public CompletableFuture update( String customerId, com.sumup.sdk.models.UpdateCustomerRequest request) throws ApiException { - return updateCustomer(customerId, request, null); + return update(customerId, request, null); } /** @@ -257,7 +257,7 @@ public CompletableFuture updateCustomer( * @return CompletableFuture resolved with com.sumup.sdk.models.Customer parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture updateCustomer( + public CompletableFuture update( String customerId, com.sumup.sdk.models.UpdateCustomerRequest request, RequestOptions requestOptions) diff --git a/src/main/java/com/sumup/sdk/clients/CustomersClient.java b/src/main/java/com/sumup/sdk/clients/CustomersClient.java index 477c993..5ca54ed 100644 --- a/src/main/java/com/sumup/sdk/clients/CustomersClient.java +++ b/src/main/java/com/sumup/sdk/clients/CustomersClient.java @@ -42,9 +42,9 @@ public CustomersClient(ApiClient apiClient) { * @return com.sumup.sdk.models.Customer parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Customer createCustomer(com.sumup.sdk.models.Customer request) + public com.sumup.sdk.models.Customer create(com.sumup.sdk.models.Customer request) throws ApiException { - return createCustomer(request, null); + return create(request, null); } /** @@ -61,7 +61,7 @@ public com.sumup.sdk.models.Customer createCustomer(com.sumup.sdk.models.Custome * @return com.sumup.sdk.models.Customer parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Customer createCustomer( + public com.sumup.sdk.models.Customer create( com.sumup.sdk.models.Customer request, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(request, "request"); String path = "/v0.1/customers"; @@ -131,8 +131,8 @@ public void deactivatePaymentInstrument( * @return com.sumup.sdk.models.Customer parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Customer getCustomer(String customerId) throws ApiException { - return getCustomer(customerId, null); + public com.sumup.sdk.models.Customer get(String customerId) throws ApiException { + return get(customerId, null); } /** @@ -149,7 +149,7 @@ public com.sumup.sdk.models.Customer getCustomer(String customerId) throws ApiEx * @return com.sumup.sdk.models.Customer parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Customer getCustomer(String customerId, RequestOptions requestOptions) + public com.sumup.sdk.models.Customer get(String customerId, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(customerId, "customerId"); String path = "/v0.1/customers/{customer_id}"; @@ -228,9 +228,9 @@ public java.util.List listPaymen * @return com.sumup.sdk.models.Customer parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Customer updateCustomer( + public com.sumup.sdk.models.Customer update( String customerId, com.sumup.sdk.models.UpdateCustomerRequest request) throws ApiException { - return updateCustomer(customerId, request, null); + return update(customerId, request, null); } /** @@ -249,7 +249,7 @@ public com.sumup.sdk.models.Customer updateCustomer( * @return com.sumup.sdk.models.Customer parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Customer updateCustomer( + public com.sumup.sdk.models.Customer update( String customerId, com.sumup.sdk.models.UpdateCustomerRequest request, RequestOptions requestOptions) diff --git a/src/main/java/com/sumup/sdk/clients/MembersAsyncClient.java b/src/main/java/com/sumup/sdk/clients/MembersAsyncClient.java index 1662a82..fe167c2 100644 --- a/src/main/java/com/sumup/sdk/clients/MembersAsyncClient.java +++ b/src/main/java/com/sumup/sdk/clients/MembersAsyncClient.java @@ -43,10 +43,10 @@ public MembersAsyncClient(ApiClient apiClient) { * @return CompletableFuture resolved with com.sumup.sdk.models.Member parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture createMerchantMember( + public CompletableFuture create( String merchantCode, com.sumup.sdk.models.CreateMerchantMemberRequest request) throws ApiException { - return createMerchantMember(merchantCode, request, null); + return create(merchantCode, request, null); } /** @@ -63,7 +63,7 @@ public CompletableFuture createMerchantMember( * @return CompletableFuture resolved with com.sumup.sdk.models.Member parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture createMerchantMember( + public CompletableFuture create( String merchantCode, com.sumup.sdk.models.CreateMerchantMemberRequest request, RequestOptions requestOptions) @@ -99,9 +99,8 @@ public CompletableFuture createMerchantMember( * @return CompletableFuture completed when the request finishes. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture deleteMerchantMember(String memberId, String merchantCode) - throws ApiException { - return deleteMerchantMember(memberId, merchantCode, null); + public CompletableFuture delete(String memberId, String merchantCode) throws ApiException { + return delete(memberId, merchantCode, null); } /** @@ -118,7 +117,7 @@ public CompletableFuture deleteMerchantMember(String memberId, String merc * @return CompletableFuture completed when the request finishes. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture deleteMerchantMember( + public CompletableFuture delete( String memberId, String merchantCode, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(memberId, "memberId"); Objects.requireNonNull(merchantCode, "merchantCode"); @@ -146,9 +145,9 @@ public CompletableFuture deleteMerchantMember( * @return CompletableFuture resolved with com.sumup.sdk.models.Member parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture getMerchantMember( - String memberId, String merchantCode) throws ApiException { - return getMerchantMember(memberId, merchantCode, null); + public CompletableFuture get(String memberId, String merchantCode) + throws ApiException { + return get(memberId, merchantCode, null); } /** @@ -165,7 +164,7 @@ public CompletableFuture getMerchantMember( * @return CompletableFuture resolved with com.sumup.sdk.models.Member parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture getMerchantMember( + public CompletableFuture get( String memberId, String merchantCode, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(memberId, "memberId"); Objects.requireNonNull(merchantCode, "merchantCode"); @@ -199,9 +198,9 @@ public CompletableFuture getMerchantMember( * response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture listMerchantMembers( + public CompletableFuture list( String merchantCode) throws ApiException { - return listMerchantMembers(merchantCode, null); + return list(merchantCode, null); } /** @@ -219,9 +218,9 @@ public CompletableFuture listM * response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture listMerchantMembers( + public CompletableFuture list( String merchantCode, ListMerchantMembersQueryParams listMerchantMembers) throws ApiException { - return listMerchantMembers(merchantCode, listMerchantMembers, null); + return list(merchantCode, listMerchantMembers, null); } /** @@ -239,7 +238,7 @@ public CompletableFuture listM * response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture listMerchantMembers( + public CompletableFuture list( String merchantCode, ListMerchantMembersQueryParams listMerchantMembers, RequestOptions requestOptions) @@ -279,12 +278,12 @@ public CompletableFuture listM * @return CompletableFuture resolved with com.sumup.sdk.models.Member parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture updateMerchantMember( + public CompletableFuture update( String memberId, String merchantCode, com.sumup.sdk.models.UpdateMerchantMemberRequest request) throws ApiException { - return updateMerchantMember(memberId, merchantCode, request, null); + return update(memberId, merchantCode, request, null); } /** @@ -302,7 +301,7 @@ public CompletableFuture updateMerchantMember( * @return CompletableFuture resolved with com.sumup.sdk.models.Member parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture updateMerchantMember( + public CompletableFuture update( String memberId, String merchantCode, com.sumup.sdk.models.UpdateMerchantMemberRequest request, diff --git a/src/main/java/com/sumup/sdk/clients/MembersClient.java b/src/main/java/com/sumup/sdk/clients/MembersClient.java index a0c5ff6..30d2352 100644 --- a/src/main/java/com/sumup/sdk/clients/MembersClient.java +++ b/src/main/java/com/sumup/sdk/clients/MembersClient.java @@ -42,10 +42,10 @@ public MembersClient(ApiClient apiClient) { * @return com.sumup.sdk.models.Member parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Member createMerchantMember( + public com.sumup.sdk.models.Member create( String merchantCode, com.sumup.sdk.models.CreateMerchantMemberRequest request) throws ApiException { - return createMerchantMember(merchantCode, request, null); + return create(merchantCode, request, null); } /** @@ -62,7 +62,7 @@ public com.sumup.sdk.models.Member createMerchantMember( * @return com.sumup.sdk.models.Member parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Member createMerchantMember( + public com.sumup.sdk.models.Member create( String merchantCode, com.sumup.sdk.models.CreateMerchantMemberRequest request, RequestOptions requestOptions) @@ -97,8 +97,8 @@ public com.sumup.sdk.models.Member createMerchantMember( * request timeout. * @throws ApiException if the SumUp API returns an error. */ - public void deleteMerchantMember(String memberId, String merchantCode) throws ApiException { - deleteMerchantMember(memberId, merchantCode, null); + public void delete(String memberId, String merchantCode) throws ApiException { + delete(memberId, merchantCode, null); } /** @@ -114,8 +114,8 @@ public void deleteMerchantMember(String memberId, String merchantCode) throws Ap * {@code null} to use client defaults. * @throws ApiException if the SumUp API returns an error. */ - public void deleteMerchantMember( - String memberId, String merchantCode, RequestOptions requestOptions) throws ApiException { + public void delete(String memberId, String merchantCode, RequestOptions requestOptions) + throws ApiException { Objects.requireNonNull(memberId, "memberId"); Objects.requireNonNull(merchantCode, "merchantCode"); String path = "/v0.1/merchants/{merchant_code}/members/{member_id}"; @@ -141,9 +141,8 @@ public void deleteMerchantMember( * @return com.sumup.sdk.models.Member parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Member getMerchantMember(String memberId, String merchantCode) - throws ApiException { - return getMerchantMember(memberId, merchantCode, null); + public com.sumup.sdk.models.Member get(String memberId, String merchantCode) throws ApiException { + return get(memberId, merchantCode, null); } /** @@ -160,7 +159,7 @@ public com.sumup.sdk.models.Member getMerchantMember(String memberId, String mer * @return com.sumup.sdk.models.Member parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Member getMerchantMember( + public com.sumup.sdk.models.Member get( String memberId, String merchantCode, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(memberId, "memberId"); Objects.requireNonNull(merchantCode, "merchantCode"); @@ -193,9 +192,9 @@ public com.sumup.sdk.models.Member getMerchantMember( * @return com.sumup.sdk.models.ListMerchantMembersResponse parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.ListMerchantMembersResponse listMerchantMembers(String merchantCode) + public com.sumup.sdk.models.ListMerchantMembersResponse list(String merchantCode) throws ApiException { - return listMerchantMembers(merchantCode, null); + return list(merchantCode, null); } /** @@ -212,9 +211,9 @@ public com.sumup.sdk.models.ListMerchantMembersResponse listMerchantMembers(Stri * @return com.sumup.sdk.models.ListMerchantMembersResponse parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.ListMerchantMembersResponse listMerchantMembers( + public com.sumup.sdk.models.ListMerchantMembersResponse list( String merchantCode, ListMerchantMembersQueryParams listMerchantMembers) throws ApiException { - return listMerchantMembers(merchantCode, listMerchantMembers, null); + return list(merchantCode, listMerchantMembers, null); } /** @@ -231,7 +230,7 @@ public com.sumup.sdk.models.ListMerchantMembersResponse listMerchantMembers( * @return com.sumup.sdk.models.ListMerchantMembersResponse parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.ListMerchantMembersResponse listMerchantMembers( + public com.sumup.sdk.models.ListMerchantMembersResponse list( String merchantCode, ListMerchantMembersQueryParams listMerchantMembers, RequestOptions requestOptions) @@ -271,12 +270,12 @@ public com.sumup.sdk.models.ListMerchantMembersResponse listMerchantMembers( * @return com.sumup.sdk.models.Member parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Member updateMerchantMember( + public com.sumup.sdk.models.Member update( String memberId, String merchantCode, com.sumup.sdk.models.UpdateMerchantMemberRequest request) throws ApiException { - return updateMerchantMember(memberId, merchantCode, request, null); + return update(memberId, merchantCode, request, null); } /** @@ -294,7 +293,7 @@ public com.sumup.sdk.models.Member updateMerchantMember( * @return com.sumup.sdk.models.Member parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Member updateMerchantMember( + public com.sumup.sdk.models.Member update( String memberId, String merchantCode, com.sumup.sdk.models.UpdateMerchantMemberRequest request, diff --git a/src/main/java/com/sumup/sdk/clients/MembershipsAsyncClient.java b/src/main/java/com/sumup/sdk/clients/MembershipsAsyncClient.java index 22b6511..ff27079 100644 --- a/src/main/java/com/sumup/sdk/clients/MembershipsAsyncClient.java +++ b/src/main/java/com/sumup/sdk/clients/MembershipsAsyncClient.java @@ -43,9 +43,9 @@ public MembershipsAsyncClient(ApiClient apiClient) { * response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture listMemberships() + public CompletableFuture list() throws ApiException { - return listMemberships(null); + return list(null); } /** @@ -62,9 +62,9 @@ public CompletableFuture listMembe * response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture listMemberships( + public CompletableFuture list( ListMembershipsQueryParams listMemberships) throws ApiException { - return listMemberships(listMemberships, null); + return list(listMemberships, null); } /** @@ -81,7 +81,7 @@ public CompletableFuture listMembe * response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture listMemberships( + public CompletableFuture list( ListMembershipsQueryParams listMemberships, RequestOptions requestOptions) throws ApiException { String path = "/v0.1/memberships"; diff --git a/src/main/java/com/sumup/sdk/clients/MembershipsClient.java b/src/main/java/com/sumup/sdk/clients/MembershipsClient.java index 9d12eb6..6260d96 100644 --- a/src/main/java/com/sumup/sdk/clients/MembershipsClient.java +++ b/src/main/java/com/sumup/sdk/clients/MembershipsClient.java @@ -41,8 +41,8 @@ public MembershipsClient(ApiClient apiClient) { * @return com.sumup.sdk.models.ListMembershipsResponse parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.ListMembershipsResponse listMemberships() throws ApiException { - return listMemberships(null); + public com.sumup.sdk.models.ListMembershipsResponse list() throws ApiException { + return list(null); } /** @@ -58,9 +58,9 @@ public com.sumup.sdk.models.ListMembershipsResponse listMemberships() throws Api * @return com.sumup.sdk.models.ListMembershipsResponse parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.ListMembershipsResponse listMemberships( + public com.sumup.sdk.models.ListMembershipsResponse list( ListMembershipsQueryParams listMemberships) throws ApiException { - return listMemberships(listMemberships, null); + return list(listMemberships, null); } /** @@ -76,7 +76,7 @@ public com.sumup.sdk.models.ListMembershipsResponse listMemberships( * @return com.sumup.sdk.models.ListMembershipsResponse parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.ListMembershipsResponse listMemberships( + public com.sumup.sdk.models.ListMembershipsResponse list( ListMembershipsQueryParams listMemberships, RequestOptions requestOptions) throws ApiException { String path = "/v0.1/memberships"; diff --git a/src/main/java/com/sumup/sdk/clients/MerchantsAsyncClient.java b/src/main/java/com/sumup/sdk/clients/MerchantsAsyncClient.java index 7d6cf19..8481106 100644 --- a/src/main/java/com/sumup/sdk/clients/MerchantsAsyncClient.java +++ b/src/main/java/com/sumup/sdk/clients/MerchantsAsyncClient.java @@ -41,9 +41,9 @@ public MerchantsAsyncClient(ApiClient apiClient) { * @return CompletableFuture resolved with com.sumup.sdk.models.Merchant parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture getMerchant(String merchantCode) + public CompletableFuture get(String merchantCode) throws ApiException { - return getMerchant(merchantCode, null); + return get(merchantCode, null); } /** @@ -60,9 +60,9 @@ public CompletableFuture getMerchant(String merch * @return CompletableFuture resolved with com.sumup.sdk.models.Merchant parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture getMerchant( + public CompletableFuture get( String merchantCode, GetMerchantQueryParams getMerchant) throws ApiException { - return getMerchant(merchantCode, getMerchant, null); + return get(merchantCode, getMerchant, null); } /** @@ -79,7 +79,7 @@ public CompletableFuture getMerchant( * @return CompletableFuture resolved with com.sumup.sdk.models.Merchant parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture getMerchant( + public CompletableFuture get( String merchantCode, GetMerchantQueryParams getMerchant, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(merchantCode, "merchantCode"); diff --git a/src/main/java/com/sumup/sdk/clients/MerchantsClient.java b/src/main/java/com/sumup/sdk/clients/MerchantsClient.java index 3d5cc53..aef56c0 100644 --- a/src/main/java/com/sumup/sdk/clients/MerchantsClient.java +++ b/src/main/java/com/sumup/sdk/clients/MerchantsClient.java @@ -40,8 +40,8 @@ public MerchantsClient(ApiClient apiClient) { * @return com.sumup.sdk.models.Merchant parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Merchant getMerchant(String merchantCode) throws ApiException { - return getMerchant(merchantCode, null); + public com.sumup.sdk.models.Merchant get(String merchantCode) throws ApiException { + return get(merchantCode, null); } /** @@ -58,9 +58,9 @@ public com.sumup.sdk.models.Merchant getMerchant(String merchantCode) throws Api * @return com.sumup.sdk.models.Merchant parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Merchant getMerchant( - String merchantCode, GetMerchantQueryParams getMerchant) throws ApiException { - return getMerchant(merchantCode, getMerchant, null); + public com.sumup.sdk.models.Merchant get(String merchantCode, GetMerchantQueryParams getMerchant) + throws ApiException { + return get(merchantCode, getMerchant, null); } /** @@ -77,7 +77,7 @@ public com.sumup.sdk.models.Merchant getMerchant( * @return com.sumup.sdk.models.Merchant parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Merchant getMerchant( + public com.sumup.sdk.models.Merchant get( String merchantCode, GetMerchantQueryParams getMerchant, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(merchantCode, "merchantCode"); diff --git a/src/main/java/com/sumup/sdk/clients/PayoutsAsyncClient.java b/src/main/java/com/sumup/sdk/clients/PayoutsAsyncClient.java index 2b45270..153a88d 100644 --- a/src/main/java/com/sumup/sdk/clients/PayoutsAsyncClient.java +++ b/src/main/java/com/sumup/sdk/clients/PayoutsAsyncClient.java @@ -35,8 +35,9 @@ public PayoutsAsyncClient(ApiClient apiClient) { * *

Lists ordered payouts for the merchant account. * - *

Operation ID: ListPayouts + *

Operation ID: ListPayoutsV1 * + * @param merchantCode Merchant code of the account whose payouts should be listed. * @param endDate End date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). * @param startDate Start date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). *

Call the overload that accepts optional parameter objects or RequestOptions to customize @@ -44,9 +45,10 @@ public PayoutsAsyncClient(ApiClient apiClient) { * @return CompletableFuture resolved with com.sumup.sdk.models.FinancialPayouts parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture listPayouts( - java.time.LocalDate endDate, java.time.LocalDate startDate) throws ApiException { - return listPayouts(endDate, startDate, null); + public CompletableFuture list( + String merchantCode, java.time.LocalDate endDate, java.time.LocalDate startDate) + throws ApiException { + return list(merchantCode, endDate, startDate, null); } /** @@ -54,22 +56,24 @@ public CompletableFuture listPayouts( * *

Lists ordered payouts for the merchant account. * - *

Operation ID: ListPayouts + *

Operation ID: ListPayoutsV1 * + * @param merchantCode Merchant code of the account whose payouts should be listed. * @param endDate End date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). * @param startDate Start date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). - * @param listPayouts Optional query parameters for this request. + * @param listPayoutsV1 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.FinancialPayouts parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture listPayouts( + public CompletableFuture list( + String merchantCode, java.time.LocalDate endDate, java.time.LocalDate startDate, - ListPayoutsQueryParams listPayouts) + ListPayoutsV1QueryParams listPayoutsV1) throws ApiException { - return listPayouts(endDate, startDate, listPayouts, null); + return list(merchantCode, endDate, startDate, listPayoutsV1, null); } /** @@ -77,30 +81,36 @@ public CompletableFuture listPayouts( * *

Lists ordered payouts for the merchant account. * - *

Operation ID: ListPayouts + *

Operation ID: ListPayoutsV1 * + * @param merchantCode Merchant code of the account whose payouts should be listed. * @param endDate End date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). * @param startDate Start date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). - * @param listPayouts Optional query parameters for this request. + * @param listPayoutsV1 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.FinancialPayouts parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture listPayouts( + public CompletableFuture list( + String merchantCode, java.time.LocalDate endDate, java.time.LocalDate startDate, - ListPayoutsQueryParams listPayouts, + ListPayoutsV1QueryParams listPayoutsV1, RequestOptions requestOptions) throws ApiException { + Objects.requireNonNull(merchantCode, "merchantCode"); Objects.requireNonNull(endDate, "endDate"); Objects.requireNonNull(startDate, "startDate"); - String path = "/v0.1/me/financials/payouts"; + String path = "/v1.0/merchants/{merchant_code}/payouts"; + path = + path.replace( + "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); Map queryParams = new LinkedHashMap<>(); queryParams.put("end_date", endDate); queryParams.put("start_date", startDate); - if (listPayouts != null) { - queryParams.putAll(listPayouts.toMap()); + if (listPayoutsV1 != null) { + queryParams.putAll(listPayoutsV1.toMap()); } return this.apiClient.sendAsync( @@ -118,9 +128,8 @@ public CompletableFuture listPayouts( * *

Lists ordered payouts for the merchant account. * - *

Operation ID: ListPayoutsV1 + *

Operation ID: ListPayouts * - * @param merchantCode Merchant code of the account whose payouts should be listed. * @param endDate End date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). * @param startDate Start date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). *

Call the overload that accepts optional parameter objects or RequestOptions to customize @@ -128,10 +137,9 @@ public CompletableFuture listPayouts( * @return CompletableFuture resolved with com.sumup.sdk.models.FinancialPayouts parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture listPayoutsV1( - String merchantCode, java.time.LocalDate endDate, java.time.LocalDate startDate) - throws ApiException { - return listPayoutsV1(merchantCode, endDate, startDate, null); + public CompletableFuture listDeprecated( + java.time.LocalDate endDate, java.time.LocalDate startDate) throws ApiException { + return listDeprecated(endDate, startDate, null); } /** @@ -139,24 +147,22 @@ public CompletableFuture listPayoutsV1( * *

Lists ordered payouts for the merchant account. * - *

Operation ID: ListPayoutsV1 + *

Operation ID: ListPayouts * - * @param merchantCode Merchant code of the account whose payouts should be listed. * @param endDate End date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). * @param startDate Start date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). - * @param listPayoutsV1 Optional query parameters for this request. + * @param listPayouts 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.FinancialPayouts parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture listPayoutsV1( - String merchantCode, + public CompletableFuture listDeprecated( java.time.LocalDate endDate, java.time.LocalDate startDate, - ListPayoutsV1QueryParams listPayoutsV1) + ListPayoutsQueryParams listPayouts) throws ApiException { - return listPayoutsV1(merchantCode, endDate, startDate, listPayoutsV1, null); + return listDeprecated(endDate, startDate, listPayouts, null); } /** @@ -164,36 +170,30 @@ public CompletableFuture listPayoutsV1( * *

Lists ordered payouts for the merchant account. * - *

Operation ID: ListPayoutsV1 + *

Operation ID: ListPayouts * - * @param merchantCode Merchant code of the account whose payouts should be listed. * @param endDate End date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). * @param startDate Start date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). - * @param listPayoutsV1 Optional query parameters for this request. + * @param listPayouts 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.FinancialPayouts parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture listPayoutsV1( - String merchantCode, + public CompletableFuture listDeprecated( java.time.LocalDate endDate, java.time.LocalDate startDate, - ListPayoutsV1QueryParams listPayoutsV1, + ListPayoutsQueryParams listPayouts, RequestOptions requestOptions) throws ApiException { - Objects.requireNonNull(merchantCode, "merchantCode"); Objects.requireNonNull(endDate, "endDate"); Objects.requireNonNull(startDate, "startDate"); - String path = "/v1.0/merchants/{merchant_code}/payouts"; - path = - path.replace( - "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); + String path = "/v0.1/me/financials/payouts"; Map queryParams = new LinkedHashMap<>(); queryParams.put("end_date", endDate); queryParams.put("start_date", startDate); - if (listPayoutsV1 != null) { - queryParams.putAll(listPayoutsV1.toMap()); + if (listPayouts != null) { + queryParams.putAll(listPayouts.toMap()); } return this.apiClient.sendAsync( @@ -207,16 +207,16 @@ public CompletableFuture listPayoutsV1( } /** Optional query parameters for this request. */ - public static final class ListPayoutsQueryParams { + public static final class ListPayoutsV1QueryParams { private final Map values = new LinkedHashMap<>(); /** * Sets the format query parameter. * * @param value Response format for the payout list. - * @return This ListPayoutsQueryParams instance. + * @return This ListPayoutsV1QueryParams instance. */ - public ListPayoutsQueryParams format(com.sumup.sdk.models.Format2 value) { + public ListPayoutsV1QueryParams format(com.sumup.sdk.models.Format value) { this.values.put("format", Objects.requireNonNull(value, "format")); return this; } @@ -225,9 +225,9 @@ public ListPayoutsQueryParams format(com.sumup.sdk.models.Format2 value) { * Sets the limit query parameter. * * @param value Maximum number of payout records to return. - * @return This ListPayoutsQueryParams instance. + * @return This ListPayoutsV1QueryParams instance. */ - public ListPayoutsQueryParams limit(Long value) { + public ListPayoutsV1QueryParams limit(Long value) { this.values.put("limit", Objects.requireNonNull(value, "limit")); return this; } @@ -236,9 +236,9 @@ public ListPayoutsQueryParams limit(Long value) { * Sets the order query parameter. * * @param value Sort direction for the returned payouts. - * @return This ListPayoutsQueryParams instance. + * @return This ListPayoutsV1QueryParams instance. */ - public ListPayoutsQueryParams order(com.sumup.sdk.models.Order2 value) { + public ListPayoutsV1QueryParams order(com.sumup.sdk.models.Order2 value) { this.values.put("order", Objects.requireNonNull(value, "order")); return this; } @@ -254,16 +254,16 @@ Map toMap() { } /** Optional query parameters for this request. */ - public static final class ListPayoutsV1QueryParams { + public static final class ListPayoutsQueryParams { private final Map values = new LinkedHashMap<>(); /** * Sets the format query parameter. * * @param value Response format for the payout list. - * @return This ListPayoutsV1QueryParams instance. + * @return This ListPayoutsQueryParams instance. */ - public ListPayoutsV1QueryParams format(com.sumup.sdk.models.Format value) { + public ListPayoutsQueryParams format(com.sumup.sdk.models.Format2 value) { this.values.put("format", Objects.requireNonNull(value, "format")); return this; } @@ -272,9 +272,9 @@ public ListPayoutsV1QueryParams format(com.sumup.sdk.models.Format value) { * Sets the limit query parameter. * * @param value Maximum number of payout records to return. - * @return This ListPayoutsV1QueryParams instance. + * @return This ListPayoutsQueryParams instance. */ - public ListPayoutsV1QueryParams limit(Long value) { + public ListPayoutsQueryParams limit(Long value) { this.values.put("limit", Objects.requireNonNull(value, "limit")); return this; } @@ -283,9 +283,9 @@ public ListPayoutsV1QueryParams limit(Long value) { * Sets the order query parameter. * * @param value Sort direction for the returned payouts. - * @return This ListPayoutsV1QueryParams instance. + * @return This ListPayoutsQueryParams instance. */ - public ListPayoutsV1QueryParams order(com.sumup.sdk.models.Order2 value) { + public ListPayoutsQueryParams order(com.sumup.sdk.models.Order2 value) { this.values.put("order", Objects.requireNonNull(value, "order")); return this; } diff --git a/src/main/java/com/sumup/sdk/clients/PayoutsClient.java b/src/main/java/com/sumup/sdk/clients/PayoutsClient.java index 9963286..33c94ad 100644 --- a/src/main/java/com/sumup/sdk/clients/PayoutsClient.java +++ b/src/main/java/com/sumup/sdk/clients/PayoutsClient.java @@ -34,8 +34,9 @@ public PayoutsClient(ApiClient apiClient) { * *

Lists ordered payouts for the merchant account. * - *

Operation ID: ListPayouts + *

Operation ID: ListPayoutsV1 * + * @param merchantCode Merchant code of the account whose payouts should be listed. * @param endDate End date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). * @param startDate Start date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). *

Call the overload that accepts optional parameter objects or RequestOptions to customize @@ -43,9 +44,10 @@ public PayoutsClient(ApiClient apiClient) { * @return com.sumup.sdk.models.FinancialPayouts parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.FinancialPayouts listPayouts( - java.time.LocalDate endDate, java.time.LocalDate startDate) throws ApiException { - return listPayouts(endDate, startDate, null); + public com.sumup.sdk.models.FinancialPayouts list( + String merchantCode, java.time.LocalDate endDate, java.time.LocalDate startDate) + throws ApiException { + return list(merchantCode, endDate, startDate, null); } /** @@ -53,22 +55,24 @@ public com.sumup.sdk.models.FinancialPayouts listPayouts( * *

Lists ordered payouts for the merchant account. * - *

Operation ID: ListPayouts + *

Operation ID: ListPayoutsV1 * + * @param merchantCode Merchant code of the account whose payouts should be listed. * @param endDate End date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). * @param startDate Start date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). - * @param listPayouts Optional query parameters for this request. + * @param listPayoutsV1 Optional query parameters for this request. *

Call the overload that accepts RequestOptions to customize headers, authorization, or * request timeout. * @return com.sumup.sdk.models.FinancialPayouts parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.FinancialPayouts listPayouts( + public com.sumup.sdk.models.FinancialPayouts list( + String merchantCode, java.time.LocalDate endDate, java.time.LocalDate startDate, - ListPayoutsQueryParams listPayouts) + ListPayoutsV1QueryParams listPayoutsV1) throws ApiException { - return listPayouts(endDate, startDate, listPayouts, null); + return list(merchantCode, endDate, startDate, listPayoutsV1, null); } /** @@ -76,30 +80,36 @@ public com.sumup.sdk.models.FinancialPayouts listPayouts( * *

Lists ordered payouts for the merchant account. * - *

Operation ID: ListPayouts + *

Operation ID: ListPayoutsV1 * + * @param merchantCode Merchant code of the account whose payouts should be listed. * @param endDate End date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). * @param startDate Start date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). - * @param listPayouts Optional query parameters for this request. + * @param listPayoutsV1 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.FinancialPayouts parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.FinancialPayouts listPayouts( + public com.sumup.sdk.models.FinancialPayouts list( + String merchantCode, java.time.LocalDate endDate, java.time.LocalDate startDate, - ListPayoutsQueryParams listPayouts, + ListPayoutsV1QueryParams listPayoutsV1, RequestOptions requestOptions) throws ApiException { + Objects.requireNonNull(merchantCode, "merchantCode"); Objects.requireNonNull(endDate, "endDate"); Objects.requireNonNull(startDate, "startDate"); - String path = "/v0.1/me/financials/payouts"; + String path = "/v1.0/merchants/{merchant_code}/payouts"; + path = + path.replace( + "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); Map queryParams = new LinkedHashMap<>(); queryParams.put("end_date", endDate); queryParams.put("start_date", startDate); - if (listPayouts != null) { - queryParams.putAll(listPayouts.toMap()); + if (listPayoutsV1 != null) { + queryParams.putAll(listPayoutsV1.toMap()); } return this.apiClient.send( @@ -117,9 +127,8 @@ public com.sumup.sdk.models.FinancialPayouts listPayouts( * *

Lists ordered payouts for the merchant account. * - *

Operation ID: ListPayoutsV1 + *

Operation ID: ListPayouts * - * @param merchantCode Merchant code of the account whose payouts should be listed. * @param endDate End date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). * @param startDate Start date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). *

Call the overload that accepts optional parameter objects or RequestOptions to customize @@ -127,10 +136,9 @@ public com.sumup.sdk.models.FinancialPayouts listPayouts( * @return com.sumup.sdk.models.FinancialPayouts parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.FinancialPayouts listPayoutsV1( - String merchantCode, java.time.LocalDate endDate, java.time.LocalDate startDate) - throws ApiException { - return listPayoutsV1(merchantCode, endDate, startDate, null); + public com.sumup.sdk.models.FinancialPayouts listDeprecated( + java.time.LocalDate endDate, java.time.LocalDate startDate) throws ApiException { + return listDeprecated(endDate, startDate, null); } /** @@ -138,24 +146,22 @@ public com.sumup.sdk.models.FinancialPayouts listPayoutsV1( * *

Lists ordered payouts for the merchant account. * - *

Operation ID: ListPayoutsV1 + *

Operation ID: ListPayouts * - * @param merchantCode Merchant code of the account whose payouts should be listed. * @param endDate End date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). * @param startDate Start date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). - * @param listPayoutsV1 Optional query parameters for this request. + * @param listPayouts Optional query parameters for this request. *

Call the overload that accepts RequestOptions to customize headers, authorization, or * request timeout. * @return com.sumup.sdk.models.FinancialPayouts parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.FinancialPayouts listPayoutsV1( - String merchantCode, + public com.sumup.sdk.models.FinancialPayouts listDeprecated( java.time.LocalDate endDate, java.time.LocalDate startDate, - ListPayoutsV1QueryParams listPayoutsV1) + ListPayoutsQueryParams listPayouts) throws ApiException { - return listPayoutsV1(merchantCode, endDate, startDate, listPayoutsV1, null); + return listDeprecated(endDate, startDate, listPayouts, null); } /** @@ -163,36 +169,30 @@ public com.sumup.sdk.models.FinancialPayouts listPayoutsV1( * *

Lists ordered payouts for the merchant account. * - *

Operation ID: ListPayoutsV1 + *

Operation ID: ListPayouts * - * @param merchantCode Merchant code of the account whose payouts should be listed. * @param endDate End date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). * @param startDate Start date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). - * @param listPayoutsV1 Optional query parameters for this request. + * @param listPayouts 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.FinancialPayouts parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.FinancialPayouts listPayoutsV1( - String merchantCode, + public com.sumup.sdk.models.FinancialPayouts listDeprecated( java.time.LocalDate endDate, java.time.LocalDate startDate, - ListPayoutsV1QueryParams listPayoutsV1, + ListPayoutsQueryParams listPayouts, RequestOptions requestOptions) throws ApiException { - Objects.requireNonNull(merchantCode, "merchantCode"); Objects.requireNonNull(endDate, "endDate"); Objects.requireNonNull(startDate, "startDate"); - String path = "/v1.0/merchants/{merchant_code}/payouts"; - path = - path.replace( - "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); + String path = "/v0.1/me/financials/payouts"; Map queryParams = new LinkedHashMap<>(); queryParams.put("end_date", endDate); queryParams.put("start_date", startDate); - if (listPayoutsV1 != null) { - queryParams.putAll(listPayoutsV1.toMap()); + if (listPayouts != null) { + queryParams.putAll(listPayouts.toMap()); } return this.apiClient.send( @@ -206,16 +206,16 @@ public com.sumup.sdk.models.FinancialPayouts listPayoutsV1( } /** Optional query parameters for this request. */ - public static final class ListPayoutsQueryParams { + public static final class ListPayoutsV1QueryParams { private final Map values = new LinkedHashMap<>(); /** * Sets the format query parameter. * * @param value Response format for the payout list. - * @return This ListPayoutsQueryParams instance. + * @return This ListPayoutsV1QueryParams instance. */ - public ListPayoutsQueryParams format(com.sumup.sdk.models.Format2 value) { + public ListPayoutsV1QueryParams format(com.sumup.sdk.models.Format value) { this.values.put("format", Objects.requireNonNull(value, "format")); return this; } @@ -224,9 +224,9 @@ public ListPayoutsQueryParams format(com.sumup.sdk.models.Format2 value) { * Sets the limit query parameter. * * @param value Maximum number of payout records to return. - * @return This ListPayoutsQueryParams instance. + * @return This ListPayoutsV1QueryParams instance. */ - public ListPayoutsQueryParams limit(Long value) { + public ListPayoutsV1QueryParams limit(Long value) { this.values.put("limit", Objects.requireNonNull(value, "limit")); return this; } @@ -235,9 +235,9 @@ public ListPayoutsQueryParams limit(Long value) { * Sets the order query parameter. * * @param value Sort direction for the returned payouts. - * @return This ListPayoutsQueryParams instance. + * @return This ListPayoutsV1QueryParams instance. */ - public ListPayoutsQueryParams order(com.sumup.sdk.models.Order2 value) { + public ListPayoutsV1QueryParams order(com.sumup.sdk.models.Order2 value) { this.values.put("order", Objects.requireNonNull(value, "order")); return this; } @@ -253,16 +253,16 @@ Map toMap() { } /** Optional query parameters for this request. */ - public static final class ListPayoutsV1QueryParams { + public static final class ListPayoutsQueryParams { private final Map values = new LinkedHashMap<>(); /** * Sets the format query parameter. * * @param value Response format for the payout list. - * @return This ListPayoutsV1QueryParams instance. + * @return This ListPayoutsQueryParams instance. */ - public ListPayoutsV1QueryParams format(com.sumup.sdk.models.Format value) { + public ListPayoutsQueryParams format(com.sumup.sdk.models.Format2 value) { this.values.put("format", Objects.requireNonNull(value, "format")); return this; } @@ -271,9 +271,9 @@ public ListPayoutsV1QueryParams format(com.sumup.sdk.models.Format value) { * Sets the limit query parameter. * * @param value Maximum number of payout records to return. - * @return This ListPayoutsV1QueryParams instance. + * @return This ListPayoutsQueryParams instance. */ - public ListPayoutsV1QueryParams limit(Long value) { + public ListPayoutsQueryParams limit(Long value) { this.values.put("limit", Objects.requireNonNull(value, "limit")); return this; } @@ -282,9 +282,9 @@ public ListPayoutsV1QueryParams limit(Long value) { * Sets the order query parameter. * * @param value Sort direction for the returned payouts. - * @return This ListPayoutsV1QueryParams instance. + * @return This ListPayoutsQueryParams instance. */ - public ListPayoutsV1QueryParams order(com.sumup.sdk.models.Order2 value) { + public ListPayoutsQueryParams order(com.sumup.sdk.models.Order2 value) { this.values.put("order", Objects.requireNonNull(value, "order")); return this; } diff --git a/src/main/java/com/sumup/sdk/clients/ReadersAsyncClient.java b/src/main/java/com/sumup/sdk/clients/ReadersAsyncClient.java index e3b465d..3ee8f2a 100644 --- a/src/main/java/com/sumup/sdk/clients/ReadersAsyncClient.java +++ b/src/main/java/com/sumup/sdk/clients/ReadersAsyncClient.java @@ -43,9 +43,9 @@ public ReadersAsyncClient(ApiClient apiClient) { * @return CompletableFuture resolved with com.sumup.sdk.models.Reader parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture createReader( + public CompletableFuture create( String merchantCode, com.sumup.sdk.models.CreateReaderRequest request) throws ApiException { - return createReader(merchantCode, request, null); + return create(merchantCode, request, null); } /** @@ -62,7 +62,7 @@ public CompletableFuture createReader( * @return CompletableFuture resolved with com.sumup.sdk.models.Reader parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture createReader( + public CompletableFuture create( String merchantCode, com.sumup.sdk.models.CreateReaderRequest request, RequestOptions requestOptions) @@ -105,12 +105,12 @@ public CompletableFuture createReader( * parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture createReaderCheckout( + public CompletableFuture createCheckout( String merchantCode, String readerId, com.sumup.sdk.models.CreateReaderCheckoutRequest request) throws ApiException { - return createReaderCheckout(merchantCode, readerId, request, null); + return createCheckout(merchantCode, readerId, request, null); } /** @@ -134,7 +134,7 @@ public CompletableFuture crea * parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture createReaderCheckout( + public CompletableFuture createCheckout( String merchantCode, String readerId, com.sumup.sdk.models.CreateReaderCheckoutRequest request, @@ -159,74 +159,6 @@ public CompletableFuture crea requestOptions); } - /** - * Terminate a Reader Checkout - * - *

Terminate a Reader Checkout stops the current transaction on the target device. This process - * is asynchronous and the actual termination may take some time to be performed on the device. - * There are some caveats when using this endpoint: * The target device must be online, otherwise - * terminate won't be accepted * The action will succeed only if the device is waiting for - * cardholder action: e.g: waiting for card, waiting for PIN, etc. * There is no confirmation of - * the termination. If a transaction is successfully terminated and `return_url` was provided on - * Checkout, the transaction status will be sent as `failed` to the provided URL. **Note**: If the - * target device is a Solo, it must be in version 3.3.28.0 or higher. - * - *

Operation ID: CreateReaderTerminate - * - * @param merchantCode Merchant Code - * @param readerId The unique identifier of the Reader - * @param request A checkout initial attributes - *

Call the overload that accepts RequestOptions to customize headers, authorization, or - * request timeout. - * @return CompletableFuture completed when the request finishes. - * @throws ApiException if the SumUp API returns an error. - */ - public CompletableFuture createReaderTerminate( - String merchantCode, String readerId, java.util.Map request) - throws ApiException { - return createReaderTerminate(merchantCode, readerId, request, null); - } - - /** - * Terminate a Reader Checkout - * - *

Terminate a Reader Checkout stops the current transaction on the target device. This process - * is asynchronous and the actual termination may take some time to be performed on the device. - * There are some caveats when using this endpoint: * The target device must be online, otherwise - * terminate won't be accepted * The action will succeed only if the device is waiting for - * cardholder action: e.g: waiting for card, waiting for PIN, etc. * There is no confirmation of - * the termination. If a transaction is successfully terminated and `return_url` was provided on - * Checkout, the transaction status will be sent as `failed` to the provided URL. **Note**: If the - * target device is a Solo, it must be in version 3.3.28.0 or higher. - * - *

Operation ID: CreateReaderTerminate - * - * @param merchantCode Merchant Code - * @param readerId The unique identifier of the Reader - * @param request A checkout initial attributes - * @param requestOptions Request-specific overrides (headers, authorization, or timeout). Pass - * {@code null} to use client defaults. - * @return CompletableFuture completed when the request finishes. - * @throws ApiException if the SumUp API returns an error. - */ - public CompletableFuture createReaderTerminate( - String merchantCode, - String readerId, - java.util.Map request, - RequestOptions requestOptions) - throws ApiException { - Objects.requireNonNull(merchantCode, "merchantCode"); - Objects.requireNonNull(readerId, "readerId"); - String path = "/v0.1/merchants/{merchant_code}/readers/{reader_id}/terminate"; - path = - path.replace( - "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); - path = path.replace("{reader_id}", ApiClient.urlEncode(ApiClient.parameterValue(readerId))); - - return this.apiClient.sendAsync( - HttpMethod.POST, path, null, null, request, null, requestOptions); - } - /** * Delete a reader * @@ -241,9 +173,9 @@ public CompletableFuture createReaderTerminate( * @return CompletableFuture completed when the request finishes. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture deleteReader(com.sumup.sdk.models.ReaderId id, String merchantCode) + public CompletableFuture delete(com.sumup.sdk.models.ReaderId id, String merchantCode) throws ApiException { - return deleteReader(id, merchantCode, null); + return delete(id, merchantCode, null); } /** @@ -260,7 +192,7 @@ public CompletableFuture deleteReader(com.sumup.sdk.models.ReaderId id, St * @return CompletableFuture completed when the request finishes. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture deleteReader( + public CompletableFuture delete( com.sumup.sdk.models.ReaderId id, String merchantCode, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(id, "id"); @@ -289,9 +221,9 @@ public CompletableFuture deleteReader( * @return CompletableFuture resolved with com.sumup.sdk.models.Reader parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture getReader( + public CompletableFuture get( com.sumup.sdk.models.ReaderId id, String merchantCode) throws ApiException { - return getReader(id, merchantCode, null); + return get(id, merchantCode, null); } /** @@ -309,10 +241,10 @@ public CompletableFuture getReader( * @return CompletableFuture resolved with com.sumup.sdk.models.Reader parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture getReader( + public CompletableFuture get( com.sumup.sdk.models.ReaderId id, String merchantCode, GetReaderHeaders getReader) throws ApiException { - return getReader(id, merchantCode, getReader, null); + return get(id, merchantCode, getReader, null); } /** @@ -330,7 +262,7 @@ public CompletableFuture getReader( * @return CompletableFuture resolved with com.sumup.sdk.models.Reader parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture getReader( + public CompletableFuture get( com.sumup.sdk.models.ReaderId id, String merchantCode, GetReaderHeaders getReader, @@ -380,9 +312,9 @@ public CompletableFuture getReader( * @return CompletableFuture resolved with com.sumup.sdk.models.StatusResponse parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture getReaderStatus( + public CompletableFuture getStatus( String merchantCode, String readerId) throws ApiException { - return getReaderStatus(merchantCode, readerId, null); + return getStatus(merchantCode, readerId, null); } /** @@ -407,7 +339,7 @@ public CompletableFuture getReaderStatus( * @return CompletableFuture resolved with com.sumup.sdk.models.StatusResponse parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture getReaderStatus( + public CompletableFuture getStatus( String merchantCode, String readerId, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(merchantCode, "merchantCode"); Objects.requireNonNull(readerId, "readerId"); @@ -441,9 +373,9 @@ public CompletableFuture getReaderStatus( * response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture listReaders( - String merchantCode) throws ApiException { - return listReaders(merchantCode, null); + public CompletableFuture list(String merchantCode) + throws ApiException { + return list(merchantCode, null); } /** @@ -460,7 +392,7 @@ public CompletableFuture listReaders( * response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture listReaders( + public CompletableFuture list( String merchantCode, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(merchantCode, "merchantCode"); String path = "/v0.1/merchants/{merchant_code}/readers"; @@ -478,6 +410,74 @@ public CompletableFuture listReaders( requestOptions); } + /** + * Terminate a Reader Checkout + * + *

Terminate a Reader Checkout stops the current transaction on the target device. This process + * is asynchronous and the actual termination may take some time to be performed on the device. + * There are some caveats when using this endpoint: * The target device must be online, otherwise + * terminate won't be accepted * The action will succeed only if the device is waiting for + * cardholder action: e.g: waiting for card, waiting for PIN, etc. * There is no confirmation of + * the termination. If a transaction is successfully terminated and `return_url` was provided on + * Checkout, the transaction status will be sent as `failed` to the provided URL. **Note**: If the + * target device is a Solo, it must be in version 3.3.28.0 or higher. + * + *

Operation ID: CreateReaderTerminate + * + * @param merchantCode Merchant Code + * @param readerId The unique identifier of the Reader + * @param request A checkout initial attributes + *

Call the overload that accepts RequestOptions to customize headers, authorization, or + * request timeout. + * @return CompletableFuture completed when the request finishes. + * @throws ApiException if the SumUp API returns an error. + */ + public CompletableFuture terminateCheckout( + String merchantCode, String readerId, java.util.Map request) + throws ApiException { + return terminateCheckout(merchantCode, readerId, request, null); + } + + /** + * Terminate a Reader Checkout + * + *

Terminate a Reader Checkout stops the current transaction on the target device. This process + * is asynchronous and the actual termination may take some time to be performed on the device. + * There are some caveats when using this endpoint: * The target device must be online, otherwise + * terminate won't be accepted * The action will succeed only if the device is waiting for + * cardholder action: e.g: waiting for card, waiting for PIN, etc. * There is no confirmation of + * the termination. If a transaction is successfully terminated and `return_url` was provided on + * Checkout, the transaction status will be sent as `failed` to the provided URL. **Note**: If the + * target device is a Solo, it must be in version 3.3.28.0 or higher. + * + *

Operation ID: CreateReaderTerminate + * + * @param merchantCode Merchant Code + * @param readerId The unique identifier of the Reader + * @param request A checkout initial attributes + * @param requestOptions Request-specific overrides (headers, authorization, or timeout). Pass + * {@code null} to use client defaults. + * @return CompletableFuture completed when the request finishes. + * @throws ApiException if the SumUp API returns an error. + */ + public CompletableFuture terminateCheckout( + String merchantCode, + String readerId, + java.util.Map request, + RequestOptions requestOptions) + throws ApiException { + Objects.requireNonNull(merchantCode, "merchantCode"); + Objects.requireNonNull(readerId, "readerId"); + String path = "/v0.1/merchants/{merchant_code}/readers/{reader_id}/terminate"; + path = + path.replace( + "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); + path = path.replace("{reader_id}", ApiClient.urlEncode(ApiClient.parameterValue(readerId))); + + return this.apiClient.sendAsync( + HttpMethod.POST, path, null, null, request, null, requestOptions); + } + /** * Update a Reader * @@ -493,12 +493,12 @@ public CompletableFuture listReaders( * @return CompletableFuture resolved with com.sumup.sdk.models.Reader parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture updateReader( + public CompletableFuture update( com.sumup.sdk.models.ReaderId id, String merchantCode, com.sumup.sdk.models.UpdateReaderRequest request) throws ApiException { - return updateReader(id, merchantCode, request, null); + return update(id, merchantCode, request, null); } /** @@ -516,7 +516,7 @@ public CompletableFuture updateReader( * @return CompletableFuture resolved with com.sumup.sdk.models.Reader parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture updateReader( + public CompletableFuture update( com.sumup.sdk.models.ReaderId id, String merchantCode, com.sumup.sdk.models.UpdateReaderRequest request, diff --git a/src/main/java/com/sumup/sdk/clients/ReadersClient.java b/src/main/java/com/sumup/sdk/clients/ReadersClient.java index a1d3ff7..b779aab 100644 --- a/src/main/java/com/sumup/sdk/clients/ReadersClient.java +++ b/src/main/java/com/sumup/sdk/clients/ReadersClient.java @@ -42,9 +42,9 @@ public ReadersClient(ApiClient apiClient) { * @return com.sumup.sdk.models.Reader parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Reader createReader( + public com.sumup.sdk.models.Reader create( String merchantCode, com.sumup.sdk.models.CreateReaderRequest request) throws ApiException { - return createReader(merchantCode, request, null); + return create(merchantCode, request, null); } /** @@ -61,7 +61,7 @@ public com.sumup.sdk.models.Reader createReader( * @return com.sumup.sdk.models.Reader parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Reader createReader( + public com.sumup.sdk.models.Reader create( String merchantCode, com.sumup.sdk.models.CreateReaderRequest request, RequestOptions requestOptions) @@ -103,12 +103,12 @@ public com.sumup.sdk.models.Reader createReader( * @return com.sumup.sdk.models.CreateReaderCheckoutResponse parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.CreateReaderCheckoutResponse createReaderCheckout( + public com.sumup.sdk.models.CreateReaderCheckoutResponse createCheckout( String merchantCode, String readerId, com.sumup.sdk.models.CreateReaderCheckoutRequest request) throws ApiException { - return createReaderCheckout(merchantCode, readerId, request, null); + return createCheckout(merchantCode, readerId, request, null); } /** @@ -131,7 +131,7 @@ public com.sumup.sdk.models.CreateReaderCheckoutResponse createReaderCheckout( * @return com.sumup.sdk.models.CreateReaderCheckoutResponse parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.CreateReaderCheckoutResponse createReaderCheckout( + public com.sumup.sdk.models.CreateReaderCheckoutResponse createCheckout( String merchantCode, String readerId, com.sumup.sdk.models.CreateReaderCheckoutRequest request, @@ -156,71 +156,6 @@ public com.sumup.sdk.models.CreateReaderCheckoutResponse createReaderCheckout( requestOptions); } - /** - * Terminate a Reader Checkout - * - *

Terminate a Reader Checkout stops the current transaction on the target device. This process - * is asynchronous and the actual termination may take some time to be performed on the device. - * There are some caveats when using this endpoint: * The target device must be online, otherwise - * terminate won't be accepted * The action will succeed only if the device is waiting for - * cardholder action: e.g: waiting for card, waiting for PIN, etc. * There is no confirmation of - * the termination. If a transaction is successfully terminated and `return_url` was provided on - * Checkout, the transaction status will be sent as `failed` to the provided URL. **Note**: If the - * target device is a Solo, it must be in version 3.3.28.0 or higher. - * - *

Operation ID: CreateReaderTerminate - * - * @param merchantCode Merchant Code - * @param readerId The unique identifier of the Reader - * @param request A checkout initial attributes - *

Call the overload that accepts RequestOptions to customize headers, authorization, or - * request timeout. - * @throws ApiException if the SumUp API returns an error. - */ - public void createReaderTerminate( - String merchantCode, String readerId, java.util.Map request) - throws ApiException { - createReaderTerminate(merchantCode, readerId, request, null); - } - - /** - * Terminate a Reader Checkout - * - *

Terminate a Reader Checkout stops the current transaction on the target device. This process - * is asynchronous and the actual termination may take some time to be performed on the device. - * There are some caveats when using this endpoint: * The target device must be online, otherwise - * terminate won't be accepted * The action will succeed only if the device is waiting for - * cardholder action: e.g: waiting for card, waiting for PIN, etc. * There is no confirmation of - * the termination. If a transaction is successfully terminated and `return_url` was provided on - * Checkout, the transaction status will be sent as `failed` to the provided URL. **Note**: If the - * target device is a Solo, it must be in version 3.3.28.0 or higher. - * - *

Operation ID: CreateReaderTerminate - * - * @param merchantCode Merchant Code - * @param readerId The unique identifier of the Reader - * @param request A checkout initial attributes - * @param requestOptions Request-specific overrides (headers, authorization, or timeout). Pass - * {@code null} to use client defaults. - * @throws ApiException if the SumUp API returns an error. - */ - public void createReaderTerminate( - String merchantCode, - String readerId, - java.util.Map request, - RequestOptions requestOptions) - throws ApiException { - Objects.requireNonNull(merchantCode, "merchantCode"); - Objects.requireNonNull(readerId, "readerId"); - String path = "/v0.1/merchants/{merchant_code}/readers/{reader_id}/terminate"; - path = - path.replace( - "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); - path = path.replace("{reader_id}", ApiClient.urlEncode(ApiClient.parameterValue(readerId))); - - this.apiClient.send(HttpMethod.POST, path, null, null, request, null, requestOptions); - } - /** * Delete a reader * @@ -234,9 +169,8 @@ public void createReaderTerminate( * request timeout. * @throws ApiException if the SumUp API returns an error. */ - public void deleteReader(com.sumup.sdk.models.ReaderId id, String merchantCode) - throws ApiException { - deleteReader(id, merchantCode, null); + public void delete(com.sumup.sdk.models.ReaderId id, String merchantCode) throws ApiException { + delete(id, merchantCode, null); } /** @@ -252,7 +186,7 @@ public void deleteReader(com.sumup.sdk.models.ReaderId id, String merchantCode) * {@code null} to use client defaults. * @throws ApiException if the SumUp API returns an error. */ - public void deleteReader( + public void delete( com.sumup.sdk.models.ReaderId id, String merchantCode, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(id, "id"); @@ -280,9 +214,9 @@ public void deleteReader( * @return com.sumup.sdk.models.Reader parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Reader getReader( - com.sumup.sdk.models.ReaderId id, String merchantCode) throws ApiException { - return getReader(id, merchantCode, null); + public com.sumup.sdk.models.Reader get(com.sumup.sdk.models.ReaderId id, String merchantCode) + throws ApiException { + return get(id, merchantCode, null); } /** @@ -300,10 +234,10 @@ public com.sumup.sdk.models.Reader getReader( * @return com.sumup.sdk.models.Reader parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Reader getReader( + public com.sumup.sdk.models.Reader get( com.sumup.sdk.models.ReaderId id, String merchantCode, GetReaderHeaders getReader) throws ApiException { - return getReader(id, merchantCode, getReader, null); + return get(id, merchantCode, getReader, null); } /** @@ -321,7 +255,7 @@ public com.sumup.sdk.models.Reader getReader( * @return com.sumup.sdk.models.Reader parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Reader getReader( + public com.sumup.sdk.models.Reader get( com.sumup.sdk.models.ReaderId id, String merchantCode, GetReaderHeaders getReader, @@ -371,9 +305,9 @@ public com.sumup.sdk.models.Reader getReader( * @return com.sumup.sdk.models.StatusResponse parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.StatusResponse getReaderStatus(String merchantCode, String readerId) + public com.sumup.sdk.models.StatusResponse getStatus(String merchantCode, String readerId) throws ApiException { - return getReaderStatus(merchantCode, readerId, null); + return getStatus(merchantCode, readerId, null); } /** @@ -398,7 +332,7 @@ public com.sumup.sdk.models.StatusResponse getReaderStatus(String merchantCode, * @return com.sumup.sdk.models.StatusResponse parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.StatusResponse getReaderStatus( + public com.sumup.sdk.models.StatusResponse getStatus( String merchantCode, String readerId, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(merchantCode, "merchantCode"); Objects.requireNonNull(readerId, "readerId"); @@ -431,9 +365,8 @@ public com.sumup.sdk.models.StatusResponse getReaderStatus( * @return com.sumup.sdk.models.ListReadersResponse parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.ListReadersResponse listReaders(String merchantCode) - throws ApiException { - return listReaders(merchantCode, null); + public com.sumup.sdk.models.ListReadersResponse list(String merchantCode) throws ApiException { + return list(merchantCode, null); } /** @@ -449,7 +382,7 @@ public com.sumup.sdk.models.ListReadersResponse listReaders(String merchantCode) * @return com.sumup.sdk.models.ListReadersResponse parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.ListReadersResponse listReaders( + public com.sumup.sdk.models.ListReadersResponse list( String merchantCode, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(merchantCode, "merchantCode"); String path = "/v0.1/merchants/{merchant_code}/readers"; @@ -467,6 +400,71 @@ public com.sumup.sdk.models.ListReadersResponse listReaders( requestOptions); } + /** + * Terminate a Reader Checkout + * + *

Terminate a Reader Checkout stops the current transaction on the target device. This process + * is asynchronous and the actual termination may take some time to be performed on the device. + * There are some caveats when using this endpoint: * The target device must be online, otherwise + * terminate won't be accepted * The action will succeed only if the device is waiting for + * cardholder action: e.g: waiting for card, waiting for PIN, etc. * There is no confirmation of + * the termination. If a transaction is successfully terminated and `return_url` was provided on + * Checkout, the transaction status will be sent as `failed` to the provided URL. **Note**: If the + * target device is a Solo, it must be in version 3.3.28.0 or higher. + * + *

Operation ID: CreateReaderTerminate + * + * @param merchantCode Merchant Code + * @param readerId The unique identifier of the Reader + * @param request A checkout initial attributes + *

Call the overload that accepts RequestOptions to customize headers, authorization, or + * request timeout. + * @throws ApiException if the SumUp API returns an error. + */ + public void terminateCheckout( + String merchantCode, String readerId, java.util.Map request) + throws ApiException { + terminateCheckout(merchantCode, readerId, request, null); + } + + /** + * Terminate a Reader Checkout + * + *

Terminate a Reader Checkout stops the current transaction on the target device. This process + * is asynchronous and the actual termination may take some time to be performed on the device. + * There are some caveats when using this endpoint: * The target device must be online, otherwise + * terminate won't be accepted * The action will succeed only if the device is waiting for + * cardholder action: e.g: waiting for card, waiting for PIN, etc. * There is no confirmation of + * the termination. If a transaction is successfully terminated and `return_url` was provided on + * Checkout, the transaction status will be sent as `failed` to the provided URL. **Note**: If the + * target device is a Solo, it must be in version 3.3.28.0 or higher. + * + *

Operation ID: CreateReaderTerminate + * + * @param merchantCode Merchant Code + * @param readerId The unique identifier of the Reader + * @param request A checkout initial attributes + * @param requestOptions Request-specific overrides (headers, authorization, or timeout). Pass + * {@code null} to use client defaults. + * @throws ApiException if the SumUp API returns an error. + */ + public void terminateCheckout( + String merchantCode, + String readerId, + java.util.Map request, + RequestOptions requestOptions) + throws ApiException { + Objects.requireNonNull(merchantCode, "merchantCode"); + Objects.requireNonNull(readerId, "readerId"); + String path = "/v0.1/merchants/{merchant_code}/readers/{reader_id}/terminate"; + path = + path.replace( + "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); + path = path.replace("{reader_id}", ApiClient.urlEncode(ApiClient.parameterValue(readerId))); + + this.apiClient.send(HttpMethod.POST, path, null, null, request, null, requestOptions); + } + /** * Update a Reader * @@ -482,12 +480,12 @@ public com.sumup.sdk.models.ListReadersResponse listReaders( * @return com.sumup.sdk.models.Reader parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Reader updateReader( + public com.sumup.sdk.models.Reader update( com.sumup.sdk.models.ReaderId id, String merchantCode, com.sumup.sdk.models.UpdateReaderRequest request) throws ApiException { - return updateReader(id, merchantCode, request, null); + return update(id, merchantCode, request, null); } /** @@ -505,7 +503,7 @@ public com.sumup.sdk.models.Reader updateReader( * @return com.sumup.sdk.models.Reader parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Reader updateReader( + public com.sumup.sdk.models.Reader update( com.sumup.sdk.models.ReaderId id, String merchantCode, com.sumup.sdk.models.UpdateReaderRequest request, diff --git a/src/main/java/com/sumup/sdk/clients/ReceiptsAsyncClient.java b/src/main/java/com/sumup/sdk/clients/ReceiptsAsyncClient.java index 37d838b..71f861e 100644 --- a/src/main/java/com/sumup/sdk/clients/ReceiptsAsyncClient.java +++ b/src/main/java/com/sumup/sdk/clients/ReceiptsAsyncClient.java @@ -42,9 +42,9 @@ public ReceiptsAsyncClient(ApiClient apiClient) { * @return CompletableFuture resolved with com.sumup.sdk.models.Receipt parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture getReceipt(String id, String mid) + public CompletableFuture get(String id, String mid) throws ApiException { - return getReceipt(id, mid, null); + return get(id, mid, null); } /** @@ -62,9 +62,9 @@ public CompletableFuture getReceipt(String id, Str * @return CompletableFuture resolved with com.sumup.sdk.models.Receipt parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture getReceipt( + public CompletableFuture get( String id, String mid, GetReceiptQueryParams getReceipt) throws ApiException { - return getReceipt(id, mid, getReceipt, null); + return get(id, mid, getReceipt, null); } /** @@ -82,7 +82,7 @@ public CompletableFuture getReceipt( * @return CompletableFuture resolved with com.sumup.sdk.models.Receipt parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture getReceipt( + public CompletableFuture get( String id, String mid, GetReceiptQueryParams getReceipt, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(id, "id"); diff --git a/src/main/java/com/sumup/sdk/clients/ReceiptsClient.java b/src/main/java/com/sumup/sdk/clients/ReceiptsClient.java index 33e60c7..2581665 100644 --- a/src/main/java/com/sumup/sdk/clients/ReceiptsClient.java +++ b/src/main/java/com/sumup/sdk/clients/ReceiptsClient.java @@ -41,8 +41,8 @@ public ReceiptsClient(ApiClient apiClient) { * @return com.sumup.sdk.models.Receipt parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Receipt getReceipt(String id, String mid) throws ApiException { - return getReceipt(id, mid, null); + public com.sumup.sdk.models.Receipt get(String id, String mid) throws ApiException { + return get(id, mid, null); } /** @@ -60,9 +60,9 @@ public com.sumup.sdk.models.Receipt getReceipt(String id, String mid) throws Api * @return com.sumup.sdk.models.Receipt parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Receipt getReceipt( - String id, String mid, GetReceiptQueryParams getReceipt) throws ApiException { - return getReceipt(id, mid, getReceipt, null); + public com.sumup.sdk.models.Receipt get(String id, String mid, GetReceiptQueryParams getReceipt) + throws ApiException { + return get(id, mid, getReceipt, null); } /** @@ -80,7 +80,7 @@ public com.sumup.sdk.models.Receipt getReceipt( * @return com.sumup.sdk.models.Receipt parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Receipt getReceipt( + public com.sumup.sdk.models.Receipt get( String id, String mid, GetReceiptQueryParams getReceipt, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(id, "id"); diff --git a/src/main/java/com/sumup/sdk/clients/RolesAsyncClient.java b/src/main/java/com/sumup/sdk/clients/RolesAsyncClient.java index c1b7da0..151408c 100644 --- a/src/main/java/com/sumup/sdk/clients/RolesAsyncClient.java +++ b/src/main/java/com/sumup/sdk/clients/RolesAsyncClient.java @@ -43,10 +43,10 @@ public RolesAsyncClient(ApiClient apiClient) { * @return CompletableFuture resolved with com.sumup.sdk.models.Role parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture createMerchantRole( + public CompletableFuture create( String merchantCode, com.sumup.sdk.models.CreateMerchantRoleRequest request) throws ApiException { - return createMerchantRole(merchantCode, request, null); + return create(merchantCode, request, null); } /** @@ -64,7 +64,7 @@ public CompletableFuture createMerchantRole( * @return CompletableFuture resolved with com.sumup.sdk.models.Role parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture createMerchantRole( + public CompletableFuture create( String merchantCode, com.sumup.sdk.models.CreateMerchantRoleRequest request, RequestOptions requestOptions) @@ -100,9 +100,8 @@ public CompletableFuture createMerchantRole( * @return CompletableFuture completed when the request finishes. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture deleteMerchantRole(String merchantCode, String roleId) - throws ApiException { - return deleteMerchantRole(merchantCode, roleId, null); + public CompletableFuture delete(String merchantCode, String roleId) throws ApiException { + return delete(merchantCode, roleId, null); } /** @@ -119,7 +118,7 @@ public CompletableFuture deleteMerchantRole(String merchantCode, String ro * @return CompletableFuture completed when the request finishes. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture deleteMerchantRole( + public CompletableFuture delete( String merchantCode, String roleId, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(merchantCode, "merchantCode"); Objects.requireNonNull(roleId, "roleId"); @@ -147,9 +146,9 @@ public CompletableFuture deleteMerchantRole( * @return CompletableFuture resolved with com.sumup.sdk.models.Role parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture getMerchantRole( - String merchantCode, String roleId) throws ApiException { - return getMerchantRole(merchantCode, roleId, null); + public CompletableFuture get(String merchantCode, String roleId) + throws ApiException { + return get(merchantCode, roleId, null); } /** @@ -166,7 +165,7 @@ public CompletableFuture getMerchantRole( * @return CompletableFuture resolved with com.sumup.sdk.models.Role parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture getMerchantRole( + public CompletableFuture get( String merchantCode, String roleId, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(merchantCode, "merchantCode"); Objects.requireNonNull(roleId, "roleId"); @@ -200,9 +199,9 @@ public CompletableFuture getMerchantRole( * response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture listMerchantRoles( - String merchantCode) throws ApiException { - return listMerchantRoles(merchantCode, null); + public CompletableFuture list(String merchantCode) + throws ApiException { + return list(merchantCode, null); } /** @@ -219,7 +218,7 @@ public CompletableFuture listMer * response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture listMerchantRoles( + public CompletableFuture list( String merchantCode, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(merchantCode, "merchantCode"); String path = "/v0.1/merchants/{merchant_code}/roles"; @@ -252,10 +251,10 @@ public CompletableFuture listMer * @return CompletableFuture resolved with com.sumup.sdk.models.Role parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture updateMerchantRole( + public CompletableFuture update( String merchantCode, String roleId, com.sumup.sdk.models.UpdateMerchantRoleRequest request) throws ApiException { - return updateMerchantRole(merchantCode, roleId, request, null); + return update(merchantCode, roleId, request, null); } /** @@ -273,7 +272,7 @@ public CompletableFuture updateMerchantRole( * @return CompletableFuture resolved with com.sumup.sdk.models.Role parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture updateMerchantRole( + public CompletableFuture update( String merchantCode, String roleId, com.sumup.sdk.models.UpdateMerchantRoleRequest request, diff --git a/src/main/java/com/sumup/sdk/clients/RolesClient.java b/src/main/java/com/sumup/sdk/clients/RolesClient.java index 7515c0a..a3fb557 100644 --- a/src/main/java/com/sumup/sdk/clients/RolesClient.java +++ b/src/main/java/com/sumup/sdk/clients/RolesClient.java @@ -42,10 +42,10 @@ public RolesClient(ApiClient apiClient) { * @return com.sumup.sdk.models.Role parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Role createMerchantRole( + public com.sumup.sdk.models.Role create( String merchantCode, com.sumup.sdk.models.CreateMerchantRoleRequest request) throws ApiException { - return createMerchantRole(merchantCode, request, null); + return create(merchantCode, request, null); } /** @@ -63,7 +63,7 @@ public com.sumup.sdk.models.Role createMerchantRole( * @return com.sumup.sdk.models.Role parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Role createMerchantRole( + public com.sumup.sdk.models.Role create( String merchantCode, com.sumup.sdk.models.CreateMerchantRoleRequest request, RequestOptions requestOptions) @@ -98,8 +98,8 @@ public com.sumup.sdk.models.Role createMerchantRole( * request timeout. * @throws ApiException if the SumUp API returns an error. */ - public void deleteMerchantRole(String merchantCode, String roleId) throws ApiException { - deleteMerchantRole(merchantCode, roleId, null); + public void delete(String merchantCode, String roleId) throws ApiException { + delete(merchantCode, roleId, null); } /** @@ -115,7 +115,7 @@ public void deleteMerchantRole(String merchantCode, String roleId) throws ApiExc * {@code null} to use client defaults. * @throws ApiException if the SumUp API returns an error. */ - public void deleteMerchantRole(String merchantCode, String roleId, RequestOptions requestOptions) + public void delete(String merchantCode, String roleId, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(merchantCode, "merchantCode"); Objects.requireNonNull(roleId, "roleId"); @@ -142,9 +142,8 @@ public void deleteMerchantRole(String merchantCode, String roleId, RequestOption * @return com.sumup.sdk.models.Role parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Role getMerchantRole(String merchantCode, String roleId) - throws ApiException { - return getMerchantRole(merchantCode, roleId, null); + public com.sumup.sdk.models.Role get(String merchantCode, String roleId) throws ApiException { + return get(merchantCode, roleId, null); } /** @@ -161,7 +160,7 @@ public com.sumup.sdk.models.Role getMerchantRole(String merchantCode, String rol * @return com.sumup.sdk.models.Role parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Role getMerchantRole( + public com.sumup.sdk.models.Role get( String merchantCode, String roleId, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(merchantCode, "merchantCode"); Objects.requireNonNull(roleId, "roleId"); @@ -194,9 +193,9 @@ public com.sumup.sdk.models.Role getMerchantRole( * @return com.sumup.sdk.models.ListMerchantRolesResponse parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.ListMerchantRolesResponse listMerchantRoles(String merchantCode) + public com.sumup.sdk.models.ListMerchantRolesResponse list(String merchantCode) throws ApiException { - return listMerchantRoles(merchantCode, null); + return list(merchantCode, null); } /** @@ -212,7 +211,7 @@ public com.sumup.sdk.models.ListMerchantRolesResponse listMerchantRoles(String m * @return com.sumup.sdk.models.ListMerchantRolesResponse parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.ListMerchantRolesResponse listMerchantRoles( + public com.sumup.sdk.models.ListMerchantRolesResponse list( String merchantCode, RequestOptions requestOptions) throws ApiException { Objects.requireNonNull(merchantCode, "merchantCode"); String path = "/v0.1/merchants/{merchant_code}/roles"; @@ -245,10 +244,10 @@ public com.sumup.sdk.models.ListMerchantRolesResponse listMerchantRoles( * @return com.sumup.sdk.models.Role parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Role updateMerchantRole( + public com.sumup.sdk.models.Role update( String merchantCode, String roleId, com.sumup.sdk.models.UpdateMerchantRoleRequest request) throws ApiException { - return updateMerchantRole(merchantCode, roleId, request, null); + return update(merchantCode, roleId, request, null); } /** @@ -266,7 +265,7 @@ public com.sumup.sdk.models.Role updateMerchantRole( * @return com.sumup.sdk.models.Role parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.Role updateMerchantRole( + public com.sumup.sdk.models.Role update( String merchantCode, String roleId, com.sumup.sdk.models.UpdateMerchantRoleRequest request, diff --git a/src/main/java/com/sumup/sdk/clients/TransactionsAsyncClient.java b/src/main/java/com/sumup/sdk/clients/TransactionsAsyncClient.java index d085d94..d7a4d09 100644 --- a/src/main/java/com/sumup/sdk/clients/TransactionsAsyncClient.java +++ b/src/main/java/com/sumup/sdk/clients/TransactionsAsyncClient.java @@ -50,17 +50,17 @@ public TransactionsAsyncClient(ApiClient apiClient) { * identified by a query parameter and *one* of following parameters is required: - `id` - * `transaction_code` - `foreign_transaction_id` - `client_transaction_id` * - *

Operation ID: GetTransaction - * - *

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

Operation ID: GetTransactionV2.1 * + * @param merchantCode Merchant code of the account whose transaction should be retrieved. + *

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.TransactionFull parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture getTransaction() + public CompletableFuture get(String merchantCode) throws ApiException { - return getTransaction(null); + return get(merchantCode, null); } /** @@ -70,17 +70,18 @@ public CompletableFuture getTransaction() * identified by a query parameter and *one* of following parameters is required: - `id` - * `transaction_code` - `foreign_transaction_id` - `client_transaction_id` * - *

Operation ID: GetTransaction + *

Operation ID: GetTransactionV2.1 * - * @param getTransaction Optional query parameters for this request. + * @param merchantCode Merchant code of the account whose transaction should be retrieved. + * @param getTransactionV21 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.TransactionFull parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture getTransaction( - GetTransactionQueryParams getTransaction) throws ApiException { - return getTransaction(getTransaction, null); + public CompletableFuture get( + String merchantCode, GetTransactionV21QueryParams getTransactionV21) throws ApiException { + return get(merchantCode, getTransactionV21, null); } /** @@ -90,20 +91,28 @@ public CompletableFuture getTransaction( * identified by a query parameter and *one* of following parameters is required: - `id` - * `transaction_code` - `foreign_transaction_id` - `client_transaction_id` * - *

Operation ID: GetTransaction + *

Operation ID: GetTransactionV2.1 * - * @param getTransaction Optional query parameters for this request. + * @param merchantCode Merchant code of the account whose transaction should be retrieved. + * @param getTransactionV21 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.TransactionFull parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture getTransaction( - GetTransactionQueryParams getTransaction, RequestOptions requestOptions) throws ApiException { - String path = "/v0.1/me/transactions"; + public CompletableFuture get( + String merchantCode, + GetTransactionV21QueryParams getTransactionV21, + RequestOptions requestOptions) + throws ApiException { + Objects.requireNonNull(merchantCode, "merchantCode"); + String path = "/v2.1/merchants/{merchant_code}/transactions"; + path = + path.replace( + "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); Map queryParams = new LinkedHashMap<>(); - if (getTransaction != null) { - queryParams.putAll(getTransaction.toMap()); + if (getTransactionV21 != null) { + queryParams.putAll(getTransactionV21.toMap()); } return this.apiClient.sendAsync( @@ -123,17 +132,17 @@ public CompletableFuture getTransaction( * identified by a query parameter and *one* of following parameters is required: - `id` - * `transaction_code` - `foreign_transaction_id` - `client_transaction_id` * - *

Operation ID: GetTransactionV2.1 + *

Operation ID: GetTransaction + * + *

Call the overload that accepts optional parameter objects or RequestOptions to customize + * headers, authorization, query values, or timeouts. * - * @param merchantCode Merchant code of the account whose transaction should be retrieved. - *

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.TransactionFull parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture getTransactionV21( - String merchantCode) throws ApiException { - return getTransactionV21(merchantCode, null); + public CompletableFuture getDeprecated() + throws ApiException { + return getDeprecated(null); } /** @@ -143,18 +152,17 @@ public CompletableFuture getTransactionV21 * identified by a query parameter and *one* of following parameters is required: - `id` - * `transaction_code` - `foreign_transaction_id` - `client_transaction_id` * - *

Operation ID: GetTransactionV2.1 + *

Operation ID: GetTransaction * - * @param merchantCode Merchant code of the account whose transaction should be retrieved. - * @param getTransactionV21 Optional query parameters for this request. + * @param getTransaction 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.TransactionFull parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture getTransactionV21( - String merchantCode, GetTransactionV21QueryParams getTransactionV21) throws ApiException { - return getTransactionV21(merchantCode, getTransactionV21, null); + public CompletableFuture getDeprecated( + GetTransactionQueryParams getTransaction) throws ApiException { + return getDeprecated(getTransaction, null); } /** @@ -164,28 +172,20 @@ public CompletableFuture getTransactionV21 * identified by a query parameter and *one* of following parameters is required: - `id` - * `transaction_code` - `foreign_transaction_id` - `client_transaction_id` * - *

Operation ID: GetTransactionV2.1 + *

Operation ID: GetTransaction * - * @param merchantCode Merchant code of the account whose transaction should be retrieved. - * @param getTransactionV21 Optional query parameters for this request. + * @param getTransaction 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.TransactionFull parsed response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture getTransactionV21( - String merchantCode, - GetTransactionV21QueryParams getTransactionV21, - RequestOptions requestOptions) - throws ApiException { - Objects.requireNonNull(merchantCode, "merchantCode"); - String path = "/v2.1/merchants/{merchant_code}/transactions"; - path = - path.replace( - "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); + public CompletableFuture getDeprecated( + GetTransactionQueryParams getTransaction, RequestOptions requestOptions) throws ApiException { + String path = "/v0.1/me/transactions"; Map queryParams = new LinkedHashMap<>(); - if (getTransactionV21 != null) { - queryParams.putAll(getTransactionV21.toMap()); + if (getTransaction != null) { + queryParams.putAll(getTransaction.toMap()); } return this.apiClient.sendAsync( @@ -203,18 +203,18 @@ public CompletableFuture getTransactionV21 * *

Lists detailed history of all transactions associated with the merchant profile. * - *

Operation ID: ListTransactions - * - *

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

Operation ID: ListTransactionsV2.1 * - * @return CompletableFuture resolved with com.sumup.sdk.models.ListTransactionsResponse parsed + * @param merchantCode Merchant code of the account whose transaction history should be listed. + *

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.ListTransactionsV21Response parsed * response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture listTransactions() - throws ApiException { - return listTransactions(null); + public CompletableFuture list( + String merchantCode) throws ApiException { + return list(merchantCode, null); } /** @@ -222,18 +222,19 @@ public CompletableFuture listTran * *

Lists detailed history of all transactions associated with the merchant profile. * - *

Operation ID: ListTransactions + *

Operation ID: ListTransactionsV2.1 * - * @param listTransactions Optional query parameters for this request. + * @param merchantCode Merchant code of the account whose transaction history should be listed. + * @param listTransactionsV21 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.ListTransactionsResponse parsed + * @return CompletableFuture resolved with com.sumup.sdk.models.ListTransactionsV21Response parsed * response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture listTransactions( - ListTransactionsQueryParams listTransactions) throws ApiException { - return listTransactions(listTransactions, null); + public CompletableFuture list( + String merchantCode, ListTransactionsV21QueryParams listTransactionsV21) throws ApiException { + return list(merchantCode, listTransactionsV21, null); } /** @@ -241,22 +242,29 @@ public CompletableFuture listTran * *

Lists detailed history of all transactions associated with the merchant profile. * - *

Operation ID: ListTransactions + *

Operation ID: ListTransactionsV2.1 * - * @param listTransactions Optional query parameters for this request. + * @param merchantCode Merchant code of the account whose transaction history should be listed. + * @param listTransactionsV21 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.ListTransactionsResponse parsed + * @return CompletableFuture resolved with com.sumup.sdk.models.ListTransactionsV21Response parsed * response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture listTransactions( - ListTransactionsQueryParams listTransactions, RequestOptions requestOptions) + public CompletableFuture list( + String merchantCode, + ListTransactionsV21QueryParams listTransactionsV21, + RequestOptions requestOptions) throws ApiException { - String path = "/v0.1/me/transactions/history"; + Objects.requireNonNull(merchantCode, "merchantCode"); + String path = "/v2.1/merchants/{merchant_code}/transactions/history"; + path = + path.replace( + "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); Map queryParams = new LinkedHashMap<>(); - if (listTransactions != null) { - queryParams.putAll(listTransactions.toMap()); + if (listTransactionsV21 != null) { + queryParams.putAll(listTransactionsV21.toMap()); } return this.apiClient.sendAsync( @@ -265,7 +273,7 @@ public CompletableFuture listTran queryParams, null, null, - new TypeReference() {}, + new TypeReference() {}, requestOptions); } @@ -274,18 +282,18 @@ public CompletableFuture listTran * *

Lists detailed history of all transactions associated with the merchant profile. * - *

Operation ID: ListTransactionsV2.1 + *

Operation ID: ListTransactions * - * @param merchantCode Merchant code of the account whose transaction history should be listed. - *

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.ListTransactionsV21Response parsed + *

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.ListTransactionsResponse parsed * response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture listTransactionsV21( - String merchantCode) throws ApiException { - return listTransactionsV21(merchantCode, null); + public CompletableFuture listDeprecated() + throws ApiException { + return listDeprecated(null); } /** @@ -293,19 +301,18 @@ public CompletableFuture listT * *

Lists detailed history of all transactions associated with the merchant profile. * - *

Operation ID: ListTransactionsV2.1 + *

Operation ID: ListTransactions * - * @param merchantCode Merchant code of the account whose transaction history should be listed. - * @param listTransactionsV21 Optional query parameters for this request. + * @param listTransactions 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.ListTransactionsV21Response parsed + * @return CompletableFuture resolved with com.sumup.sdk.models.ListTransactionsResponse parsed * response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture listTransactionsV21( - String merchantCode, ListTransactionsV21QueryParams listTransactionsV21) throws ApiException { - return listTransactionsV21(merchantCode, listTransactionsV21, null); + public CompletableFuture listDeprecated( + ListTransactionsQueryParams listTransactions) throws ApiException { + return listDeprecated(listTransactions, null); } /** @@ -313,29 +320,22 @@ public CompletableFuture listT * *

Lists detailed history of all transactions associated with the merchant profile. * - *

Operation ID: ListTransactionsV2.1 + *

Operation ID: ListTransactions * - * @param merchantCode Merchant code of the account whose transaction history should be listed. - * @param listTransactionsV21 Optional query parameters for this request. + * @param listTransactions 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.ListTransactionsV21Response parsed + * @return CompletableFuture resolved with com.sumup.sdk.models.ListTransactionsResponse parsed * response. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture listTransactionsV21( - String merchantCode, - ListTransactionsV21QueryParams listTransactionsV21, - RequestOptions requestOptions) + public CompletableFuture listDeprecated( + ListTransactionsQueryParams listTransactions, RequestOptions requestOptions) throws ApiException { - Objects.requireNonNull(merchantCode, "merchantCode"); - String path = "/v2.1/merchants/{merchant_code}/transactions/history"; - path = - path.replace( - "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); + String path = "/v0.1/me/transactions/history"; Map queryParams = new LinkedHashMap<>(); - if (listTransactionsV21 != null) { - queryParams.putAll(listTransactionsV21.toMap()); + if (listTransactions != null) { + queryParams.putAll(listTransactions.toMap()); } return this.apiClient.sendAsync( @@ -344,7 +344,7 @@ public CompletableFuture listT queryParams, null, null, - new TypeReference() {}, + new TypeReference() {}, requestOptions); } @@ -362,9 +362,9 @@ public CompletableFuture listT * @return CompletableFuture completed when the request finishes. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture refundTransaction( + public CompletableFuture refund( String txnId, com.sumup.sdk.models.RefundTransactionRequest request) throws ApiException { - return refundTransaction(txnId, request, null); + return refund(txnId, request, null); } /** @@ -381,7 +381,7 @@ public CompletableFuture refundTransaction( * @return CompletableFuture completed when the request finishes. * @throws ApiException if the SumUp API returns an error. */ - public CompletableFuture refundTransaction( + public CompletableFuture refund( String txnId, com.sumup.sdk.models.RefundTransactionRequest request, RequestOptions requestOptions) @@ -395,17 +395,41 @@ public CompletableFuture refundTransaction( } /** Optional query parameters for this request. */ - public static final class GetTransactionQueryParams { + public static final class GetTransactionV21QueryParams { private final Map values = new LinkedHashMap<>(); + /** + * Sets the client_transaction_id query parameter. + * + * @param value Client transaction id. + * @return This GetTransactionV21QueryParams instance. + */ + public GetTransactionV21QueryParams clientTransactionId(String value) { + this.values.put( + "client_transaction_id", Objects.requireNonNull(value, "clientTransactionId")); + return this; + } + + /** + * Sets the foreign_transaction_id query parameter. + * + * @param value External/foreign transaction id (passed by clients). + * @return This GetTransactionV21QueryParams instance. + */ + public GetTransactionV21QueryParams foreignTransactionId(String value) { + this.values.put( + "foreign_transaction_id", Objects.requireNonNull(value, "foreignTransactionId")); + return this; + } + /** * Sets the id query parameter. * * @param value Retrieves the transaction resource with the specified transaction ID (the `id` * parameter in the transaction resource). - * @return This GetTransactionQueryParams instance. + * @return This GetTransactionV21QueryParams instance. */ - public GetTransactionQueryParams id(String value) { + public GetTransactionV21QueryParams id(String value) { this.values.put("id", Objects.requireNonNull(value, "id")); return this; } @@ -414,9 +438,9 @@ public GetTransactionQueryParams id(String value) { * Sets the transaction_code query parameter. * * @param value Retrieves the transaction resource with the specified transaction code. - * @return This GetTransactionQueryParams instance. + * @return This GetTransactionV21QueryParams instance. */ - public GetTransactionQueryParams transactionCode(String value) { + public GetTransactionV21QueryParams transactionCode(String value) { this.values.put("transaction_code", Objects.requireNonNull(value, "transactionCode")); return this; } @@ -432,41 +456,17 @@ Map toMap() { } /** Optional query parameters for this request. */ - public static final class GetTransactionV21QueryParams { + public static final class GetTransactionQueryParams { private final Map values = new LinkedHashMap<>(); - /** - * Sets the client_transaction_id query parameter. - * - * @param value Client transaction id. - * @return This GetTransactionV21QueryParams instance. - */ - public GetTransactionV21QueryParams clientTransactionId(String value) { - this.values.put( - "client_transaction_id", Objects.requireNonNull(value, "clientTransactionId")); - return this; - } - - /** - * Sets the foreign_transaction_id query parameter. - * - * @param value External/foreign transaction id (passed by clients). - * @return This GetTransactionV21QueryParams instance. - */ - public GetTransactionV21QueryParams foreignTransactionId(String value) { - this.values.put( - "foreign_transaction_id", Objects.requireNonNull(value, "foreignTransactionId")); - return this; - } - /** * Sets the id query parameter. * * @param value Retrieves the transaction resource with the specified transaction ID (the `id` * parameter in the transaction resource). - * @return This GetTransactionV21QueryParams instance. + * @return This GetTransactionQueryParams instance. */ - public GetTransactionV21QueryParams id(String value) { + public GetTransactionQueryParams id(String value) { this.values.put("id", Objects.requireNonNull(value, "id")); return this; } @@ -475,9 +475,9 @@ public GetTransactionV21QueryParams id(String value) { * Sets the transaction_code query parameter. * * @param value Retrieves the transaction resource with the specified transaction code. - * @return This GetTransactionV21QueryParams instance. + * @return This GetTransactionQueryParams instance. */ - public GetTransactionV21QueryParams transactionCode(String value) { + public GetTransactionQueryParams transactionCode(String value) { this.values.put("transaction_code", Objects.requireNonNull(value, "transactionCode")); return this; } @@ -493,7 +493,7 @@ Map toMap() { } /** Optional query parameters for this request. */ - public static final class ListTransactionsQueryParams { + public static final class ListTransactionsV21QueryParams { private final Map values = new LinkedHashMap<>(); /** @@ -502,21 +502,33 @@ public static final class ListTransactionsQueryParams { * @param value Filters the results by the latest modification time of resources and returns * only transactions that are modified *at or after* the specified timestamp (in * [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). - * @return This ListTransactionsQueryParams instance. + * @return This ListTransactionsV21QueryParams instance. */ - public ListTransactionsQueryParams changesSince(java.time.OffsetDateTime value) { + public ListTransactionsV21QueryParams changesSince(java.time.OffsetDateTime value) { this.values.put("changes_since", Objects.requireNonNull(value, "changesSince")); return this; } + /** + * Sets the entry_modes[] query parameter. + * + * @param value Filters the returned results by the specified list of entry modes. + * @return This ListTransactionsV21QueryParams instance. + */ + public ListTransactionsV21QueryParams entryModes( + java.util.List value) { + this.values.put("entry_modes[]", Objects.requireNonNull(value, "entryModes")); + return this; + } + /** * Sets the limit query parameter. * * @param value Specifies the maximum number of results per page. Value must be a positive * integer and if not specified, will return 10 results. - * @return This ListTransactionsQueryParams instance. + * @return This ListTransactionsV21QueryParams instance. */ - public ListTransactionsQueryParams limit(Long value) { + public ListTransactionsV21QueryParams limit(Long value) { this.values.put("limit", Objects.requireNonNull(value, "limit")); return this; } @@ -527,9 +539,9 @@ public ListTransactionsQueryParams limit(Long value) { * @param value Filters the results by the reference ID of transaction events and returns only * transactions with events whose IDs are *smaller* than the specified value. This * parameters supersedes the `newest_time` parameter (if both are provided in the request). - * @return This ListTransactionsQueryParams instance. + * @return This ListTransactionsV21QueryParams instance. */ - public ListTransactionsQueryParams newestRef(String value) { + public ListTransactionsV21QueryParams newestRef(String value) { this.values.put("newest_ref", Objects.requireNonNull(value, "newestRef")); return this; } @@ -540,9 +552,9 @@ public ListTransactionsQueryParams newestRef(String value) { * @param value Filters the results by the creation time of resources and returns only * transactions that are created *before* the specified timestamp (in * [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). - * @return This ListTransactionsQueryParams instance. + * @return This ListTransactionsV21QueryParams instance. */ - public ListTransactionsQueryParams newestTime(java.time.OffsetDateTime value) { + public ListTransactionsV21QueryParams newestTime(java.time.OffsetDateTime value) { this.values.put("newest_time", Objects.requireNonNull(value, "newestTime")); return this; } @@ -553,9 +565,9 @@ public ListTransactionsQueryParams newestTime(java.time.OffsetDateTime value) { * @param value Filters the results by the reference ID of transaction events and returns only * transactions with events whose IDs are *greater* than the specified value. This * parameters supersedes the `oldest_time` parameter (if both are provided in the request). - * @return This ListTransactionsQueryParams instance. + * @return This ListTransactionsV21QueryParams instance. */ - public ListTransactionsQueryParams oldestRef(String value) { + public ListTransactionsV21QueryParams oldestRef(String value) { this.values.put("oldest_ref", Objects.requireNonNull(value, "oldestRef")); return this; } @@ -566,9 +578,9 @@ public ListTransactionsQueryParams oldestRef(String value) { * @param value Filters the results by the creation time of resources and returns only * transactions that are created *at or after* the specified timestamp (in * [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). - * @return This ListTransactionsQueryParams instance. + * @return This ListTransactionsV21QueryParams instance. */ - public ListTransactionsQueryParams oldestTime(java.time.OffsetDateTime value) { + public ListTransactionsV21QueryParams oldestTime(java.time.OffsetDateTime value) { this.values.put("oldest_time", Objects.requireNonNull(value, "oldestTime")); return this; } @@ -577,9 +589,9 @@ public ListTransactionsQueryParams oldestTime(java.time.OffsetDateTime value) { * Sets the order query parameter. * * @param value Specifies the order in which the returned results are displayed. - * @return This ListTransactionsQueryParams instance. + * @return This ListTransactionsV21QueryParams instance. */ - public ListTransactionsQueryParams order(com.sumup.sdk.models.Order2 value) { + public ListTransactionsV21QueryParams order(com.sumup.sdk.models.Order value) { this.values.put("order", Objects.requireNonNull(value, "order")); return this; } @@ -589,9 +601,9 @@ public ListTransactionsQueryParams order(com.sumup.sdk.models.Order2 value) { * * @param value Filters the returned results by the specified list of payment types used for the * transactions. - * @return This ListTransactionsQueryParams instance. + * @return This ListTransactionsV21QueryParams instance. */ - public ListTransactionsQueryParams paymentTypes( + public ListTransactionsV21QueryParams paymentTypes( java.util.List value) { this.values.put("payment_types", Objects.requireNonNull(value, "paymentTypes")); return this; @@ -602,10 +614,10 @@ public ListTransactionsQueryParams paymentTypes( * * @param value Filters the returned results by the specified list of final statuses of the * transactions. - * @return This ListTransactionsQueryParams instance. + * @return This ListTransactionsV21QueryParams instance. */ - public ListTransactionsQueryParams statuses( - java.util.List value) { + public ListTransactionsV21QueryParams statuses( + java.util.List value) { this.values.put("statuses[]", Objects.requireNonNull(value, "statuses")); return this; } @@ -614,9 +626,9 @@ public ListTransactionsQueryParams statuses( * Sets the transaction_code query parameter. * * @param value Retrieves the transaction resource with the specified transaction code. - * @return This ListTransactionsQueryParams instance. + * @return This ListTransactionsV21QueryParams instance. */ - public ListTransactionsQueryParams transactionCode(String value) { + public ListTransactionsV21QueryParams transactionCode(String value) { this.values.put("transaction_code", Objects.requireNonNull(value, "transactionCode")); return this; } @@ -625,10 +637,10 @@ public ListTransactionsQueryParams transactionCode(String value) { * Sets the types query parameter. * * @param value Filters the returned results by the specified list of transaction types. - * @return This ListTransactionsQueryParams instance. + * @return This ListTransactionsV21QueryParams instance. */ - public ListTransactionsQueryParams types( - java.util.List value) { + public ListTransactionsV21QueryParams types( + java.util.List value) { this.values.put("types", Objects.requireNonNull(value, "types")); return this; } @@ -637,9 +649,9 @@ public ListTransactionsQueryParams types( * Sets the users query parameter. * * @param value Filters the returned results by user email. - * @return This ListTransactionsQueryParams instance. + * @return This ListTransactionsV21QueryParams instance. */ - public ListTransactionsQueryParams users(java.util.List value) { + public ListTransactionsV21QueryParams users(java.util.List value) { this.values.put("users", Objects.requireNonNull(value, "users")); return this; } @@ -655,7 +667,7 @@ Map toMap() { } /** Optional query parameters for this request. */ - public static final class ListTransactionsV21QueryParams { + public static final class ListTransactionsQueryParams { private final Map values = new LinkedHashMap<>(); /** @@ -664,33 +676,21 @@ public static final class ListTransactionsV21QueryParams { * @param value Filters the results by the latest modification time of resources and returns * only transactions that are modified *at or after* the specified timestamp (in * [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). - * @return This ListTransactionsV21QueryParams instance. + * @return This ListTransactionsQueryParams instance. */ - public ListTransactionsV21QueryParams changesSince(java.time.OffsetDateTime value) { + public ListTransactionsQueryParams changesSince(java.time.OffsetDateTime value) { this.values.put("changes_since", Objects.requireNonNull(value, "changesSince")); return this; } - /** - * Sets the entry_modes[] query parameter. - * - * @param value Filters the returned results by the specified list of entry modes. - * @return This ListTransactionsV21QueryParams instance. - */ - public ListTransactionsV21QueryParams entryModes( - java.util.List value) { - this.values.put("entry_modes[]", Objects.requireNonNull(value, "entryModes")); - return this; - } - /** * Sets the limit query parameter. * * @param value Specifies the maximum number of results per page. Value must be a positive * integer and if not specified, will return 10 results. - * @return This ListTransactionsV21QueryParams instance. + * @return This ListTransactionsQueryParams instance. */ - public ListTransactionsV21QueryParams limit(Long value) { + public ListTransactionsQueryParams limit(Long value) { this.values.put("limit", Objects.requireNonNull(value, "limit")); return this; } @@ -701,9 +701,9 @@ public ListTransactionsV21QueryParams limit(Long value) { * @param value Filters the results by the reference ID of transaction events and returns only * transactions with events whose IDs are *smaller* than the specified value. This * parameters supersedes the `newest_time` parameter (if both are provided in the request). - * @return This ListTransactionsV21QueryParams instance. + * @return This ListTransactionsQueryParams instance. */ - public ListTransactionsV21QueryParams newestRef(String value) { + public ListTransactionsQueryParams newestRef(String value) { this.values.put("newest_ref", Objects.requireNonNull(value, "newestRef")); return this; } @@ -714,9 +714,9 @@ public ListTransactionsV21QueryParams newestRef(String value) { * @param value Filters the results by the creation time of resources and returns only * transactions that are created *before* the specified timestamp (in * [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). - * @return This ListTransactionsV21QueryParams instance. + * @return This ListTransactionsQueryParams instance. */ - public ListTransactionsV21QueryParams newestTime(java.time.OffsetDateTime value) { + public ListTransactionsQueryParams newestTime(java.time.OffsetDateTime value) { this.values.put("newest_time", Objects.requireNonNull(value, "newestTime")); return this; } @@ -727,9 +727,9 @@ public ListTransactionsV21QueryParams newestTime(java.time.OffsetDateTime value) * @param value Filters the results by the reference ID of transaction events and returns only * transactions with events whose IDs are *greater* than the specified value. This * parameters supersedes the `oldest_time` parameter (if both are provided in the request). - * @return This ListTransactionsV21QueryParams instance. + * @return This ListTransactionsQueryParams instance. */ - public ListTransactionsV21QueryParams oldestRef(String value) { + public ListTransactionsQueryParams oldestRef(String value) { this.values.put("oldest_ref", Objects.requireNonNull(value, "oldestRef")); return this; } @@ -740,9 +740,9 @@ public ListTransactionsV21QueryParams oldestRef(String value) { * @param value Filters the results by the creation time of resources and returns only * transactions that are created *at or after* the specified timestamp (in * [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). - * @return This ListTransactionsV21QueryParams instance. + * @return This ListTransactionsQueryParams instance. */ - public ListTransactionsV21QueryParams oldestTime(java.time.OffsetDateTime value) { + public ListTransactionsQueryParams oldestTime(java.time.OffsetDateTime value) { this.values.put("oldest_time", Objects.requireNonNull(value, "oldestTime")); return this; } @@ -751,9 +751,9 @@ public ListTransactionsV21QueryParams oldestTime(java.time.OffsetDateTime value) * Sets the order query parameter. * * @param value Specifies the order in which the returned results are displayed. - * @return This ListTransactionsV21QueryParams instance. + * @return This ListTransactionsQueryParams instance. */ - public ListTransactionsV21QueryParams order(com.sumup.sdk.models.Order value) { + public ListTransactionsQueryParams order(com.sumup.sdk.models.Order2 value) { this.values.put("order", Objects.requireNonNull(value, "order")); return this; } @@ -763,9 +763,9 @@ public ListTransactionsV21QueryParams order(com.sumup.sdk.models.Order value) { * * @param value Filters the returned results by the specified list of payment types used for the * transactions. - * @return This ListTransactionsV21QueryParams instance. + * @return This ListTransactionsQueryParams instance. */ - public ListTransactionsV21QueryParams paymentTypes( + public ListTransactionsQueryParams paymentTypes( java.util.List value) { this.values.put("payment_types", Objects.requireNonNull(value, "paymentTypes")); return this; @@ -776,10 +776,10 @@ public ListTransactionsV21QueryParams paymentTypes( * * @param value Filters the returned results by the specified list of final statuses of the * transactions. - * @return This ListTransactionsV21QueryParams instance. + * @return This ListTransactionsQueryParams instance. */ - public ListTransactionsV21QueryParams statuses( - java.util.List value) { + public ListTransactionsQueryParams statuses( + java.util.List value) { this.values.put("statuses[]", Objects.requireNonNull(value, "statuses")); return this; } @@ -788,9 +788,9 @@ public ListTransactionsV21QueryParams statuses( * Sets the transaction_code query parameter. * * @param value Retrieves the transaction resource with the specified transaction code. - * @return This ListTransactionsV21QueryParams instance. + * @return This ListTransactionsQueryParams instance. */ - public ListTransactionsV21QueryParams transactionCode(String value) { + public ListTransactionsQueryParams transactionCode(String value) { this.values.put("transaction_code", Objects.requireNonNull(value, "transactionCode")); return this; } @@ -799,10 +799,10 @@ public ListTransactionsV21QueryParams transactionCode(String value) { * Sets the types query parameter. * * @param value Filters the returned results by the specified list of transaction types. - * @return This ListTransactionsV21QueryParams instance. + * @return This ListTransactionsQueryParams instance. */ - public ListTransactionsV21QueryParams types( - java.util.List value) { + public ListTransactionsQueryParams types( + java.util.List value) { this.values.put("types", Objects.requireNonNull(value, "types")); return this; } @@ -811,9 +811,9 @@ public ListTransactionsV21QueryParams types( * Sets the users query parameter. * * @param value Filters the returned results by user email. - * @return This ListTransactionsV21QueryParams instance. + * @return This ListTransactionsQueryParams instance. */ - public ListTransactionsV21QueryParams users(java.util.List value) { + public ListTransactionsQueryParams users(java.util.List value) { this.values.put("users", Objects.requireNonNull(value, "users")); return this; } diff --git a/src/main/java/com/sumup/sdk/clients/TransactionsClient.java b/src/main/java/com/sumup/sdk/clients/TransactionsClient.java index 031bad5..4be6623 100644 --- a/src/main/java/com/sumup/sdk/clients/TransactionsClient.java +++ b/src/main/java/com/sumup/sdk/clients/TransactionsClient.java @@ -49,16 +49,16 @@ public TransactionsClient(ApiClient apiClient) { * identified by a query parameter and *one* of following parameters is required: - `id` - * `transaction_code` - `foreign_transaction_id` - `client_transaction_id` * - *

Operation ID: GetTransaction - * - *

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

Operation ID: GetTransactionV2.1 * + * @param merchantCode Merchant code of the account whose transaction should be retrieved. + *

Call the overload that accepts optional parameter objects or RequestOptions to customize + * headers, authorization, query values, or timeouts. * @return com.sumup.sdk.models.TransactionFull parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.TransactionFull getTransaction() throws ApiException { - return getTransaction(null); + public com.sumup.sdk.models.TransactionFull get(String merchantCode) throws ApiException { + return get(merchantCode, null); } /** @@ -68,17 +68,18 @@ public com.sumup.sdk.models.TransactionFull getTransaction() throws ApiException * identified by a query parameter and *one* of following parameters is required: - `id` - * `transaction_code` - `foreign_transaction_id` - `client_transaction_id` * - *

Operation ID: GetTransaction + *

Operation ID: GetTransactionV2.1 * - * @param getTransaction Optional query parameters for this request. + * @param merchantCode Merchant code of the account whose transaction should be retrieved. + * @param getTransactionV21 Optional query parameters for this request. *

Call the overload that accepts RequestOptions to customize headers, authorization, or * request timeout. * @return com.sumup.sdk.models.TransactionFull parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.TransactionFull getTransaction( - GetTransactionQueryParams getTransaction) throws ApiException { - return getTransaction(getTransaction, null); + public com.sumup.sdk.models.TransactionFull get( + String merchantCode, GetTransactionV21QueryParams getTransactionV21) throws ApiException { + return get(merchantCode, getTransactionV21, null); } /** @@ -88,20 +89,28 @@ public com.sumup.sdk.models.TransactionFull getTransaction( * identified by a query parameter and *one* of following parameters is required: - `id` - * `transaction_code` - `foreign_transaction_id` - `client_transaction_id` * - *

Operation ID: GetTransaction + *

Operation ID: GetTransactionV2.1 * - * @param getTransaction Optional query parameters for this request. + * @param merchantCode Merchant code of the account whose transaction should be retrieved. + * @param getTransactionV21 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.TransactionFull parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.TransactionFull getTransaction( - GetTransactionQueryParams getTransaction, RequestOptions requestOptions) throws ApiException { - String path = "/v0.1/me/transactions"; + public com.sumup.sdk.models.TransactionFull get( + String merchantCode, + GetTransactionV21QueryParams getTransactionV21, + RequestOptions requestOptions) + throws ApiException { + Objects.requireNonNull(merchantCode, "merchantCode"); + String path = "/v2.1/merchants/{merchant_code}/transactions"; + path = + path.replace( + "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); Map queryParams = new LinkedHashMap<>(); - if (getTransaction != null) { - queryParams.putAll(getTransaction.toMap()); + if (getTransactionV21 != null) { + queryParams.putAll(getTransactionV21.toMap()); } return this.apiClient.send( @@ -121,17 +130,16 @@ public com.sumup.sdk.models.TransactionFull getTransaction( * identified by a query parameter and *one* of following parameters is required: - `id` - * `transaction_code` - `foreign_transaction_id` - `client_transaction_id` * - *

Operation ID: GetTransactionV2.1 + *

Operation ID: GetTransaction + * + *

Call the overload that accepts optional parameter objects or RequestOptions to customize + * headers, authorization, query values, or timeouts. * - * @param merchantCode Merchant code of the account whose transaction should be retrieved. - *

Call the overload that accepts optional parameter objects or RequestOptions to customize - * headers, authorization, query values, or timeouts. * @return com.sumup.sdk.models.TransactionFull parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.TransactionFull getTransactionV21(String merchantCode) - throws ApiException { - return getTransactionV21(merchantCode, null); + public com.sumup.sdk.models.TransactionFull getDeprecated() throws ApiException { + return getDeprecated(null); } /** @@ -141,18 +149,17 @@ public com.sumup.sdk.models.TransactionFull getTransactionV21(String merchantCod * identified by a query parameter and *one* of following parameters is required: - `id` - * `transaction_code` - `foreign_transaction_id` - `client_transaction_id` * - *

Operation ID: GetTransactionV2.1 + *

Operation ID: GetTransaction * - * @param merchantCode Merchant code of the account whose transaction should be retrieved. - * @param getTransactionV21 Optional query parameters for this request. + * @param getTransaction Optional query parameters for this request. *

Call the overload that accepts RequestOptions to customize headers, authorization, or * request timeout. * @return com.sumup.sdk.models.TransactionFull parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.TransactionFull getTransactionV21( - String merchantCode, GetTransactionV21QueryParams getTransactionV21) throws ApiException { - return getTransactionV21(merchantCode, getTransactionV21, null); + public com.sumup.sdk.models.TransactionFull getDeprecated( + GetTransactionQueryParams getTransaction) throws ApiException { + return getDeprecated(getTransaction, null); } /** @@ -162,28 +169,20 @@ public com.sumup.sdk.models.TransactionFull getTransactionV21( * identified by a query parameter and *one* of following parameters is required: - `id` - * `transaction_code` - `foreign_transaction_id` - `client_transaction_id` * - *

Operation ID: GetTransactionV2.1 + *

Operation ID: GetTransaction * - * @param merchantCode Merchant code of the account whose transaction should be retrieved. - * @param getTransactionV21 Optional query parameters for this request. + * @param getTransaction 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.TransactionFull parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.TransactionFull getTransactionV21( - String merchantCode, - GetTransactionV21QueryParams getTransactionV21, - RequestOptions requestOptions) - throws ApiException { - Objects.requireNonNull(merchantCode, "merchantCode"); - String path = "/v2.1/merchants/{merchant_code}/transactions"; - path = - path.replace( - "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); + public com.sumup.sdk.models.TransactionFull getDeprecated( + GetTransactionQueryParams getTransaction, RequestOptions requestOptions) throws ApiException { + String path = "/v0.1/me/transactions"; Map queryParams = new LinkedHashMap<>(); - if (getTransactionV21 != null) { - queryParams.putAll(getTransactionV21.toMap()); + if (getTransaction != null) { + queryParams.putAll(getTransaction.toMap()); } return this.apiClient.send( @@ -201,16 +200,17 @@ public com.sumup.sdk.models.TransactionFull getTransactionV21( * *

Lists detailed history of all transactions associated with the merchant profile. * - *

Operation ID: ListTransactions - * - *

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

Operation ID: ListTransactionsV2.1 * - * @return com.sumup.sdk.models.ListTransactionsResponse parsed response. + * @param merchantCode Merchant code of the account whose transaction history should be listed. + *

Call the overload that accepts optional parameter objects or RequestOptions to customize + * headers, authorization, query values, or timeouts. + * @return com.sumup.sdk.models.ListTransactionsV21Response parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.ListTransactionsResponse listTransactions() throws ApiException { - return listTransactions(null); + public com.sumup.sdk.models.ListTransactionsV21Response list(String merchantCode) + throws ApiException { + return list(merchantCode, null); } /** @@ -218,17 +218,18 @@ public com.sumup.sdk.models.ListTransactionsResponse listTransactions() throws A * *

Lists detailed history of all transactions associated with the merchant profile. * - *

Operation ID: ListTransactions + *

Operation ID: ListTransactionsV2.1 * - * @param listTransactions Optional query parameters for this request. + * @param merchantCode Merchant code of the account whose transaction history should be listed. + * @param listTransactionsV21 Optional query parameters for this request. *

Call the overload that accepts RequestOptions to customize headers, authorization, or * request timeout. - * @return com.sumup.sdk.models.ListTransactionsResponse parsed response. + * @return com.sumup.sdk.models.ListTransactionsV21Response parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.ListTransactionsResponse listTransactions( - ListTransactionsQueryParams listTransactions) throws ApiException { - return listTransactions(listTransactions, null); + public com.sumup.sdk.models.ListTransactionsV21Response list( + String merchantCode, ListTransactionsV21QueryParams listTransactionsV21) throws ApiException { + return list(merchantCode, listTransactionsV21, null); } /** @@ -236,21 +237,28 @@ public com.sumup.sdk.models.ListTransactionsResponse listTransactions( * *

Lists detailed history of all transactions associated with the merchant profile. * - *

Operation ID: ListTransactions + *

Operation ID: ListTransactionsV2.1 * - * @param listTransactions Optional query parameters for this request. + * @param merchantCode Merchant code of the account whose transaction history should be listed. + * @param listTransactionsV21 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.ListTransactionsResponse parsed response. + * @return com.sumup.sdk.models.ListTransactionsV21Response parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.ListTransactionsResponse listTransactions( - ListTransactionsQueryParams listTransactions, RequestOptions requestOptions) + public com.sumup.sdk.models.ListTransactionsV21Response list( + String merchantCode, + ListTransactionsV21QueryParams listTransactionsV21, + RequestOptions requestOptions) throws ApiException { - String path = "/v0.1/me/transactions/history"; + Objects.requireNonNull(merchantCode, "merchantCode"); + String path = "/v2.1/merchants/{merchant_code}/transactions/history"; + path = + path.replace( + "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); Map queryParams = new LinkedHashMap<>(); - if (listTransactions != null) { - queryParams.putAll(listTransactions.toMap()); + if (listTransactionsV21 != null) { + queryParams.putAll(listTransactionsV21.toMap()); } return this.apiClient.send( @@ -259,7 +267,7 @@ public com.sumup.sdk.models.ListTransactionsResponse listTransactions( queryParams, null, null, - new TypeReference() {}, + new TypeReference() {}, requestOptions); } @@ -268,17 +276,16 @@ public com.sumup.sdk.models.ListTransactionsResponse listTransactions( * *

Lists detailed history of all transactions associated with the merchant profile. * - *

Operation ID: ListTransactionsV2.1 + *

Operation ID: ListTransactions * - * @param merchantCode Merchant code of the account whose transaction history should be listed. - *

Call the overload that accepts optional parameter objects or RequestOptions to customize - * headers, authorization, query values, or timeouts. - * @return com.sumup.sdk.models.ListTransactionsV21Response parsed response. + *

Call the overload that accepts optional parameter objects or RequestOptions to customize + * headers, authorization, query values, or timeouts. + * + * @return com.sumup.sdk.models.ListTransactionsResponse parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.ListTransactionsV21Response listTransactionsV21(String merchantCode) - throws ApiException { - return listTransactionsV21(merchantCode, null); + public com.sumup.sdk.models.ListTransactionsResponse listDeprecated() throws ApiException { + return listDeprecated(null); } /** @@ -286,18 +293,17 @@ public com.sumup.sdk.models.ListTransactionsV21Response listTransactionsV21(Stri * *

Lists detailed history of all transactions associated with the merchant profile. * - *

Operation ID: ListTransactionsV2.1 + *

Operation ID: ListTransactions * - * @param merchantCode Merchant code of the account whose transaction history should be listed. - * @param listTransactionsV21 Optional query parameters for this request. + * @param listTransactions Optional query parameters for this request. *

Call the overload that accepts RequestOptions to customize headers, authorization, or * request timeout. - * @return com.sumup.sdk.models.ListTransactionsV21Response parsed response. + * @return com.sumup.sdk.models.ListTransactionsResponse parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.ListTransactionsV21Response listTransactionsV21( - String merchantCode, ListTransactionsV21QueryParams listTransactionsV21) throws ApiException { - return listTransactionsV21(merchantCode, listTransactionsV21, null); + public com.sumup.sdk.models.ListTransactionsResponse listDeprecated( + ListTransactionsQueryParams listTransactions) throws ApiException { + return listDeprecated(listTransactions, null); } /** @@ -305,28 +311,21 @@ public com.sumup.sdk.models.ListTransactionsV21Response listTransactionsV21( * *

Lists detailed history of all transactions associated with the merchant profile. * - *

Operation ID: ListTransactionsV2.1 + *

Operation ID: ListTransactions * - * @param merchantCode Merchant code of the account whose transaction history should be listed. - * @param listTransactionsV21 Optional query parameters for this request. + * @param listTransactions 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.ListTransactionsV21Response parsed response. + * @return com.sumup.sdk.models.ListTransactionsResponse parsed response. * @throws ApiException if the SumUp API returns an error. */ - public com.sumup.sdk.models.ListTransactionsV21Response listTransactionsV21( - String merchantCode, - ListTransactionsV21QueryParams listTransactionsV21, - RequestOptions requestOptions) + public com.sumup.sdk.models.ListTransactionsResponse listDeprecated( + ListTransactionsQueryParams listTransactions, RequestOptions requestOptions) throws ApiException { - Objects.requireNonNull(merchantCode, "merchantCode"); - String path = "/v2.1/merchants/{merchant_code}/transactions/history"; - path = - path.replace( - "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); + String path = "/v0.1/me/transactions/history"; Map queryParams = new LinkedHashMap<>(); - if (listTransactionsV21 != null) { - queryParams.putAll(listTransactionsV21.toMap()); + if (listTransactions != null) { + queryParams.putAll(listTransactions.toMap()); } return this.apiClient.send( @@ -335,7 +334,7 @@ public com.sumup.sdk.models.ListTransactionsV21Response listTransactionsV21( queryParams, null, null, - new TypeReference() {}, + new TypeReference() {}, requestOptions); } @@ -352,9 +351,9 @@ public com.sumup.sdk.models.ListTransactionsV21Response listTransactionsV21( * request timeout. * @throws ApiException if the SumUp API returns an error. */ - public void refundTransaction(String txnId, com.sumup.sdk.models.RefundTransactionRequest request) + public void refund(String txnId, com.sumup.sdk.models.RefundTransactionRequest request) throws ApiException { - refundTransaction(txnId, request, null); + refund(txnId, request, null); } /** @@ -370,7 +369,7 @@ public void refundTransaction(String txnId, com.sumup.sdk.models.RefundTransacti * {@code null} to use client defaults. * @throws ApiException if the SumUp API returns an error. */ - public void refundTransaction( + public void refund( String txnId, com.sumup.sdk.models.RefundTransactionRequest request, RequestOptions requestOptions) @@ -383,17 +382,41 @@ public void refundTransaction( } /** Optional query parameters for this request. */ - public static final class GetTransactionQueryParams { + public static final class GetTransactionV21QueryParams { private final Map values = new LinkedHashMap<>(); + /** + * Sets the client_transaction_id query parameter. + * + * @param value Client transaction id. + * @return This GetTransactionV21QueryParams instance. + */ + public GetTransactionV21QueryParams clientTransactionId(String value) { + this.values.put( + "client_transaction_id", Objects.requireNonNull(value, "clientTransactionId")); + return this; + } + + /** + * Sets the foreign_transaction_id query parameter. + * + * @param value External/foreign transaction id (passed by clients). + * @return This GetTransactionV21QueryParams instance. + */ + public GetTransactionV21QueryParams foreignTransactionId(String value) { + this.values.put( + "foreign_transaction_id", Objects.requireNonNull(value, "foreignTransactionId")); + return this; + } + /** * Sets the id query parameter. * * @param value Retrieves the transaction resource with the specified transaction ID (the `id` * parameter in the transaction resource). - * @return This GetTransactionQueryParams instance. + * @return This GetTransactionV21QueryParams instance. */ - public GetTransactionQueryParams id(String value) { + public GetTransactionV21QueryParams id(String value) { this.values.put("id", Objects.requireNonNull(value, "id")); return this; } @@ -402,9 +425,9 @@ public GetTransactionQueryParams id(String value) { * Sets the transaction_code query parameter. * * @param value Retrieves the transaction resource with the specified transaction code. - * @return This GetTransactionQueryParams instance. + * @return This GetTransactionV21QueryParams instance. */ - public GetTransactionQueryParams transactionCode(String value) { + public GetTransactionV21QueryParams transactionCode(String value) { this.values.put("transaction_code", Objects.requireNonNull(value, "transactionCode")); return this; } @@ -420,41 +443,17 @@ Map toMap() { } /** Optional query parameters for this request. */ - public static final class GetTransactionV21QueryParams { + public static final class GetTransactionQueryParams { private final Map values = new LinkedHashMap<>(); - /** - * Sets the client_transaction_id query parameter. - * - * @param value Client transaction id. - * @return This GetTransactionV21QueryParams instance. - */ - public GetTransactionV21QueryParams clientTransactionId(String value) { - this.values.put( - "client_transaction_id", Objects.requireNonNull(value, "clientTransactionId")); - return this; - } - - /** - * Sets the foreign_transaction_id query parameter. - * - * @param value External/foreign transaction id (passed by clients). - * @return This GetTransactionV21QueryParams instance. - */ - public GetTransactionV21QueryParams foreignTransactionId(String value) { - this.values.put( - "foreign_transaction_id", Objects.requireNonNull(value, "foreignTransactionId")); - return this; - } - /** * Sets the id query parameter. * * @param value Retrieves the transaction resource with the specified transaction ID (the `id` * parameter in the transaction resource). - * @return This GetTransactionV21QueryParams instance. + * @return This GetTransactionQueryParams instance. */ - public GetTransactionV21QueryParams id(String value) { + public GetTransactionQueryParams id(String value) { this.values.put("id", Objects.requireNonNull(value, "id")); return this; } @@ -463,9 +462,9 @@ public GetTransactionV21QueryParams id(String value) { * Sets the transaction_code query parameter. * * @param value Retrieves the transaction resource with the specified transaction code. - * @return This GetTransactionV21QueryParams instance. + * @return This GetTransactionQueryParams instance. */ - public GetTransactionV21QueryParams transactionCode(String value) { + public GetTransactionQueryParams transactionCode(String value) { this.values.put("transaction_code", Objects.requireNonNull(value, "transactionCode")); return this; } @@ -481,7 +480,7 @@ Map toMap() { } /** Optional query parameters for this request. */ - public static final class ListTransactionsQueryParams { + public static final class ListTransactionsV21QueryParams { private final Map values = new LinkedHashMap<>(); /** @@ -490,21 +489,33 @@ public static final class ListTransactionsQueryParams { * @param value Filters the results by the latest modification time of resources and returns * only transactions that are modified *at or after* the specified timestamp (in * [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). - * @return This ListTransactionsQueryParams instance. + * @return This ListTransactionsV21QueryParams instance. */ - public ListTransactionsQueryParams changesSince(java.time.OffsetDateTime value) { + public ListTransactionsV21QueryParams changesSince(java.time.OffsetDateTime value) { this.values.put("changes_since", Objects.requireNonNull(value, "changesSince")); return this; } + /** + * Sets the entry_modes[] query parameter. + * + * @param value Filters the returned results by the specified list of entry modes. + * @return This ListTransactionsV21QueryParams instance. + */ + public ListTransactionsV21QueryParams entryModes( + java.util.List value) { + this.values.put("entry_modes[]", Objects.requireNonNull(value, "entryModes")); + return this; + } + /** * Sets the limit query parameter. * * @param value Specifies the maximum number of results per page. Value must be a positive * integer and if not specified, will return 10 results. - * @return This ListTransactionsQueryParams instance. + * @return This ListTransactionsV21QueryParams instance. */ - public ListTransactionsQueryParams limit(Long value) { + public ListTransactionsV21QueryParams limit(Long value) { this.values.put("limit", Objects.requireNonNull(value, "limit")); return this; } @@ -515,9 +526,9 @@ public ListTransactionsQueryParams limit(Long value) { * @param value Filters the results by the reference ID of transaction events and returns only * transactions with events whose IDs are *smaller* than the specified value. This * parameters supersedes the `newest_time` parameter (if both are provided in the request). - * @return This ListTransactionsQueryParams instance. + * @return This ListTransactionsV21QueryParams instance. */ - public ListTransactionsQueryParams newestRef(String value) { + public ListTransactionsV21QueryParams newestRef(String value) { this.values.put("newest_ref", Objects.requireNonNull(value, "newestRef")); return this; } @@ -528,9 +539,9 @@ public ListTransactionsQueryParams newestRef(String value) { * @param value Filters the results by the creation time of resources and returns only * transactions that are created *before* the specified timestamp (in * [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). - * @return This ListTransactionsQueryParams instance. + * @return This ListTransactionsV21QueryParams instance. */ - public ListTransactionsQueryParams newestTime(java.time.OffsetDateTime value) { + public ListTransactionsV21QueryParams newestTime(java.time.OffsetDateTime value) { this.values.put("newest_time", Objects.requireNonNull(value, "newestTime")); return this; } @@ -541,9 +552,9 @@ public ListTransactionsQueryParams newestTime(java.time.OffsetDateTime value) { * @param value Filters the results by the reference ID of transaction events and returns only * transactions with events whose IDs are *greater* than the specified value. This * parameters supersedes the `oldest_time` parameter (if both are provided in the request). - * @return This ListTransactionsQueryParams instance. + * @return This ListTransactionsV21QueryParams instance. */ - public ListTransactionsQueryParams oldestRef(String value) { + public ListTransactionsV21QueryParams oldestRef(String value) { this.values.put("oldest_ref", Objects.requireNonNull(value, "oldestRef")); return this; } @@ -554,9 +565,9 @@ public ListTransactionsQueryParams oldestRef(String value) { * @param value Filters the results by the creation time of resources and returns only * transactions that are created *at or after* the specified timestamp (in * [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). - * @return This ListTransactionsQueryParams instance. + * @return This ListTransactionsV21QueryParams instance. */ - public ListTransactionsQueryParams oldestTime(java.time.OffsetDateTime value) { + public ListTransactionsV21QueryParams oldestTime(java.time.OffsetDateTime value) { this.values.put("oldest_time", Objects.requireNonNull(value, "oldestTime")); return this; } @@ -565,9 +576,9 @@ public ListTransactionsQueryParams oldestTime(java.time.OffsetDateTime value) { * Sets the order query parameter. * * @param value Specifies the order in which the returned results are displayed. - * @return This ListTransactionsQueryParams instance. + * @return This ListTransactionsV21QueryParams instance. */ - public ListTransactionsQueryParams order(com.sumup.sdk.models.Order2 value) { + public ListTransactionsV21QueryParams order(com.sumup.sdk.models.Order value) { this.values.put("order", Objects.requireNonNull(value, "order")); return this; } @@ -577,9 +588,9 @@ public ListTransactionsQueryParams order(com.sumup.sdk.models.Order2 value) { * * @param value Filters the returned results by the specified list of payment types used for the * transactions. - * @return This ListTransactionsQueryParams instance. + * @return This ListTransactionsV21QueryParams instance. */ - public ListTransactionsQueryParams paymentTypes( + public ListTransactionsV21QueryParams paymentTypes( java.util.List value) { this.values.put("payment_types", Objects.requireNonNull(value, "paymentTypes")); return this; @@ -590,10 +601,10 @@ public ListTransactionsQueryParams paymentTypes( * * @param value Filters the returned results by the specified list of final statuses of the * transactions. - * @return This ListTransactionsQueryParams instance. + * @return This ListTransactionsV21QueryParams instance. */ - public ListTransactionsQueryParams statuses( - java.util.List value) { + public ListTransactionsV21QueryParams statuses( + java.util.List value) { this.values.put("statuses[]", Objects.requireNonNull(value, "statuses")); return this; } @@ -602,9 +613,9 @@ public ListTransactionsQueryParams statuses( * Sets the transaction_code query parameter. * * @param value Retrieves the transaction resource with the specified transaction code. - * @return This ListTransactionsQueryParams instance. + * @return This ListTransactionsV21QueryParams instance. */ - public ListTransactionsQueryParams transactionCode(String value) { + public ListTransactionsV21QueryParams transactionCode(String value) { this.values.put("transaction_code", Objects.requireNonNull(value, "transactionCode")); return this; } @@ -613,10 +624,10 @@ public ListTransactionsQueryParams transactionCode(String value) { * Sets the types query parameter. * * @param value Filters the returned results by the specified list of transaction types. - * @return This ListTransactionsQueryParams instance. + * @return This ListTransactionsV21QueryParams instance. */ - public ListTransactionsQueryParams types( - java.util.List value) { + public ListTransactionsV21QueryParams types( + java.util.List value) { this.values.put("types", Objects.requireNonNull(value, "types")); return this; } @@ -625,9 +636,9 @@ public ListTransactionsQueryParams types( * Sets the users query parameter. * * @param value Filters the returned results by user email. - * @return This ListTransactionsQueryParams instance. + * @return This ListTransactionsV21QueryParams instance. */ - public ListTransactionsQueryParams users(java.util.List value) { + public ListTransactionsV21QueryParams users(java.util.List value) { this.values.put("users", Objects.requireNonNull(value, "users")); return this; } @@ -643,7 +654,7 @@ Map toMap() { } /** Optional query parameters for this request. */ - public static final class ListTransactionsV21QueryParams { + public static final class ListTransactionsQueryParams { private final Map values = new LinkedHashMap<>(); /** @@ -652,33 +663,21 @@ public static final class ListTransactionsV21QueryParams { * @param value Filters the results by the latest modification time of resources and returns * only transactions that are modified *at or after* the specified timestamp (in * [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). - * @return This ListTransactionsV21QueryParams instance. + * @return This ListTransactionsQueryParams instance. */ - public ListTransactionsV21QueryParams changesSince(java.time.OffsetDateTime value) { + public ListTransactionsQueryParams changesSince(java.time.OffsetDateTime value) { this.values.put("changes_since", Objects.requireNonNull(value, "changesSince")); return this; } - /** - * Sets the entry_modes[] query parameter. - * - * @param value Filters the returned results by the specified list of entry modes. - * @return This ListTransactionsV21QueryParams instance. - */ - public ListTransactionsV21QueryParams entryModes( - java.util.List value) { - this.values.put("entry_modes[]", Objects.requireNonNull(value, "entryModes")); - return this; - } - /** * Sets the limit query parameter. * * @param value Specifies the maximum number of results per page. Value must be a positive * integer and if not specified, will return 10 results. - * @return This ListTransactionsV21QueryParams instance. + * @return This ListTransactionsQueryParams instance. */ - public ListTransactionsV21QueryParams limit(Long value) { + public ListTransactionsQueryParams limit(Long value) { this.values.put("limit", Objects.requireNonNull(value, "limit")); return this; } @@ -689,9 +688,9 @@ public ListTransactionsV21QueryParams limit(Long value) { * @param value Filters the results by the reference ID of transaction events and returns only * transactions with events whose IDs are *smaller* than the specified value. This * parameters supersedes the `newest_time` parameter (if both are provided in the request). - * @return This ListTransactionsV21QueryParams instance. + * @return This ListTransactionsQueryParams instance. */ - public ListTransactionsV21QueryParams newestRef(String value) { + public ListTransactionsQueryParams newestRef(String value) { this.values.put("newest_ref", Objects.requireNonNull(value, "newestRef")); return this; } @@ -702,9 +701,9 @@ public ListTransactionsV21QueryParams newestRef(String value) { * @param value Filters the results by the creation time of resources and returns only * transactions that are created *before* the specified timestamp (in * [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). - * @return This ListTransactionsV21QueryParams instance. + * @return This ListTransactionsQueryParams instance. */ - public ListTransactionsV21QueryParams newestTime(java.time.OffsetDateTime value) { + public ListTransactionsQueryParams newestTime(java.time.OffsetDateTime value) { this.values.put("newest_time", Objects.requireNonNull(value, "newestTime")); return this; } @@ -715,9 +714,9 @@ public ListTransactionsV21QueryParams newestTime(java.time.OffsetDateTime value) * @param value Filters the results by the reference ID of transaction events and returns only * transactions with events whose IDs are *greater* than the specified value. This * parameters supersedes the `oldest_time` parameter (if both are provided in the request). - * @return This ListTransactionsV21QueryParams instance. + * @return This ListTransactionsQueryParams instance. */ - public ListTransactionsV21QueryParams oldestRef(String value) { + public ListTransactionsQueryParams oldestRef(String value) { this.values.put("oldest_ref", Objects.requireNonNull(value, "oldestRef")); return this; } @@ -728,9 +727,9 @@ public ListTransactionsV21QueryParams oldestRef(String value) { * @param value Filters the results by the creation time of resources and returns only * transactions that are created *at or after* the specified timestamp (in * [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format). - * @return This ListTransactionsV21QueryParams instance. + * @return This ListTransactionsQueryParams instance. */ - public ListTransactionsV21QueryParams oldestTime(java.time.OffsetDateTime value) { + public ListTransactionsQueryParams oldestTime(java.time.OffsetDateTime value) { this.values.put("oldest_time", Objects.requireNonNull(value, "oldestTime")); return this; } @@ -739,9 +738,9 @@ public ListTransactionsV21QueryParams oldestTime(java.time.OffsetDateTime value) * Sets the order query parameter. * * @param value Specifies the order in which the returned results are displayed. - * @return This ListTransactionsV21QueryParams instance. + * @return This ListTransactionsQueryParams instance. */ - public ListTransactionsV21QueryParams order(com.sumup.sdk.models.Order value) { + public ListTransactionsQueryParams order(com.sumup.sdk.models.Order2 value) { this.values.put("order", Objects.requireNonNull(value, "order")); return this; } @@ -751,9 +750,9 @@ public ListTransactionsV21QueryParams order(com.sumup.sdk.models.Order value) { * * @param value Filters the returned results by the specified list of payment types used for the * transactions. - * @return This ListTransactionsV21QueryParams instance. + * @return This ListTransactionsQueryParams instance. */ - public ListTransactionsV21QueryParams paymentTypes( + public ListTransactionsQueryParams paymentTypes( java.util.List value) { this.values.put("payment_types", Objects.requireNonNull(value, "paymentTypes")); return this; @@ -764,10 +763,10 @@ public ListTransactionsV21QueryParams paymentTypes( * * @param value Filters the returned results by the specified list of final statuses of the * transactions. - * @return This ListTransactionsV21QueryParams instance. + * @return This ListTransactionsQueryParams instance. */ - public ListTransactionsV21QueryParams statuses( - java.util.List value) { + public ListTransactionsQueryParams statuses( + java.util.List value) { this.values.put("statuses[]", Objects.requireNonNull(value, "statuses")); return this; } @@ -776,9 +775,9 @@ public ListTransactionsV21QueryParams statuses( * Sets the transaction_code query parameter. * * @param value Retrieves the transaction resource with the specified transaction code. - * @return This ListTransactionsV21QueryParams instance. + * @return This ListTransactionsQueryParams instance. */ - public ListTransactionsV21QueryParams transactionCode(String value) { + public ListTransactionsQueryParams transactionCode(String value) { this.values.put("transaction_code", Objects.requireNonNull(value, "transactionCode")); return this; } @@ -787,10 +786,10 @@ public ListTransactionsV21QueryParams transactionCode(String value) { * Sets the types query parameter. * * @param value Filters the returned results by the specified list of transaction types. - * @return This ListTransactionsV21QueryParams instance. + * @return This ListTransactionsQueryParams instance. */ - public ListTransactionsV21QueryParams types( - java.util.List value) { + public ListTransactionsQueryParams types( + java.util.List value) { this.values.put("types", Objects.requireNonNull(value, "types")); return this; } @@ -799,9 +798,9 @@ public ListTransactionsV21QueryParams types( * Sets the users query parameter. * * @param value Filters the returned results by user email. - * @return This ListTransactionsV21QueryParams instance. + * @return This ListTransactionsQueryParams instance. */ - public ListTransactionsV21QueryParams users(java.util.List value) { + public ListTransactionsQueryParams users(java.util.List value) { this.values.put("users", Objects.requireNonNull(value, "users")); return this; } diff --git a/src/test/java/com/sumup/sdk/core/ApiClientTest.java b/src/test/java/com/sumup/sdk/core/ApiClientTest.java index cf42b3d..da3064b 100644 --- a/src/test/java/com/sumup/sdk/core/ApiClientTest.java +++ b/src/test/java/com/sumup/sdk/core/ApiClientTest.java @@ -118,7 +118,7 @@ void pathParamsUnwrapSingleValueRecords() { ApiClient apiClient = ApiClient.builder().httpClient(httpClient).build(); ReadersClient readersClient = new ReadersClient(apiClient); - readersClient.deleteReader(new ReaderId("reader 123"), "merchant-code"); + readersClient.delete(new ReaderId("reader 123"), "merchant-code"); assertEquals( URI.create("https://api.sumup.com/v0.1/merchants/merchant-code/readers/reader+123"),