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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 17 additions & 26 deletions openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -543,10 +543,10 @@
]
}
},
"/v0.1/checkouts/{id}": {
"/v0.1/checkouts/{checkout_id}": {
"parameters": [
{
"name": "id",
"name": "checkout_id",
"in": "path",
"description": "Unique ID of the checkout resource.",
"required": true,
Expand Down Expand Up @@ -1150,14 +1150,14 @@
]
}
},
"/v0.2/checkouts/{id}/apple-pay-session": {
"/v0.2/checkouts/{checkout_id}/apple-pay-session": {
"put": {
"operationId": "CreateApplePaySession",
"summary": "Create an Apple Pay session",
"description": "Creates an Apple Pay merchant session for the specified checkout.\n\nUse this endpoint after the customer selects Apple Pay and before calling\n`ApplePaySession.completeMerchantValidation(...)` in the browser.\nSumUp validates the merchant session request and returns the Apple Pay\nsession object that your frontend should pass to Apple's JavaScript API.\n",
"parameters": [
{
"name": "id",
"name": "checkout_id",
"in": "path",
"description": "Unique ID of the checkout resource.",
"required": true,
Expand Down Expand Up @@ -1900,7 +1900,7 @@
]
}
},
"/v1.0/merchants/{merchant_code}/payments/{id}/refunds": {
"/v1.0/merchants/{merchant_code}/payments/{transaction_id}/refunds": {
"parameters": [
{
"name": "merchant_code",
Expand All @@ -1913,7 +1913,7 @@
}
},
{
"name": "id",
"name": "transaction_id",
"in": "path",
"description": "Unique ID of the transaction.",
"required": true,
Expand Down Expand Up @@ -2658,14 +2658,14 @@
]
}
},
"/v1.1/receipts/{id}": {
"/v1.1/receipts/{transaction_id}": {
"get": {
"operationId": "GetReceipt",
"summary": "Retrieve receipt details",
"description": "Retrieves receipt specific data for a transaction.",
"parameters": [
{
"name": "id",
"name": "transaction_id",
"in": "path",
"description": "SumUp unique transaction ID or transaction code, e.g. TS7HDYLSKD.",
"required": true,
Expand Down Expand Up @@ -4549,14 +4549,14 @@
"UpdateReaderByID": {
"operationId": "UpdateReader",
"parameters": {
"id": "$response.body#/id"
"reader_id": "$response.body#/id"
},
"description": "Update the reader object. This can be used to set a name after using this endpoint to verify the pairing code."
},
"DeleteReaderByID": {
"operationId": "DeleteReader",
"parameters": {
"id": "$response.body#/id"
"reader_id": "$response.body#/id"
},
"description": "Delete the reader."
}
Expand Down Expand Up @@ -4639,7 +4639,7 @@
]
}
},
"/v0.1/merchants/{merchant_code}/readers/{id}": {
"/v0.1/merchants/{merchant_code}/readers/{reader_id}": {
"get": {
"operationId": "GetReader",
"summary": "Retrieve a Reader",
Expand Down Expand Up @@ -4677,7 +4677,7 @@
}
},
{
"name": "id",
"name": "reader_id",
"in": "path",
"description": "The unique identifier of the reader.",
"required": true,
Expand Down Expand Up @@ -4757,7 +4757,7 @@
}
},
{
"name": "id",
"name": "reader_id",
"in": "path",
"description": "The unique identifier of the reader.",
"required": true,
Expand Down Expand Up @@ -4830,7 +4830,7 @@
}
},
{
"name": "id",
"name": "reader_id",
"in": "path",
"description": "The unique identifier of the reader.",
"required": true,
Expand Down Expand Up @@ -5403,7 +5403,7 @@
}
},
"CheckoutID": {
"name": "id",
"name": "checkout_id",
"in": "path",
"required": true,
"description": "Unique ID of the checkout resource.",
Expand Down Expand Up @@ -5539,15 +5539,6 @@
"type": "string"
}
},
"TxnID": {
"in": "path",
"name": "txn_id",
"required": true,
"description": "Unique ID of the transaction.",
"schema": {
"type": "string"
}
},
"TypesFilter": {
"name": "types",
"in": "query",
Expand Down Expand Up @@ -9595,14 +9586,14 @@
"UpdateReaderByID": {
"operationId": "UpdateReader",
"parameters": {
"id": "$response.body#/id"
"reader_id": "$response.body#/id"
},
"description": "Update the reader object. This can be used to set a name after using this endpoint to verify the pairing code."
},
"DeleteReaderByID": {
"operationId": "DeleteReader",
"parameters": {
"id": "$response.body#/id"
"reader_id": "$response.body#/id"
},
"description": "Delete the reader."
}
Expand Down
6 changes: 3 additions & 3 deletions src/SumUp.Tests/ReadersClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public async Task Requests_UseDefaultAccessToken()

await client.Readers.GetAsync(
merchantCode: "merchant-123",
id: "reader-456",
readerId: "reader-456",
requestOptions: null,
cancellationToken: CancellationToken.None);

Expand Down Expand Up @@ -297,7 +297,7 @@ public async Task Requests_CanOverrideAccessTokenPerRequest()

await client.Readers.GetAsync(
merchantCode: "merchant-123",
id: "reader-456",
readerId: "reader-456",
requestOptions: requestOptions,
cancellationToken: CancellationToken.None);

Expand Down Expand Up @@ -372,7 +372,7 @@ public async Task Requests_RespectPerRequestTimeout()

await Assert.ThrowsAsync<TaskCanceledException>(() => client.Readers.GetAsync(
merchantCode: "merchant-123",
id: "reader-456",
readerId: "reader-456",
requestOptions: requestOptions,
cancellationToken: CancellationToken.None));
}
Expand Down
64 changes: 32 additions & 32 deletions src/SumUp/CheckoutsClient.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,15 @@ public async Task<ApiResponse<Checkout>> CreateAsync(CheckoutCreateRequest body,
/// Create an Apple Pay session
/// </summary>
/// <remarks>Creates an Apple Pay merchant session for the specified checkout. Use this endpoint after the customer selects Apple Pay and before calling ApplePaySession.completeMerchantValidation(...) in the browser. SumUp validates the merchant session request and returns the Apple Pay session object that your frontend should pass to Apple's JavaScript API.</remarks>
/// <param name="id">Unique ID of the checkout resource.</param>
/// <param name="checkoutId">Unique ID of the checkout resource.</param>
/// <param name="body">The data needed to create an apple pay session for a checkout.</param>
/// <param name="requestOptions">Optional per-request overrides.</param>
/// <param name="cancellationToken">Token used to cancel the request.</param>
public ApiResponse<JsonDocument> CreateApplePaySession(string id, CheckoutsCreateApplePaySessionRequest? body = null, RequestOptions? requestOptions = null, CancellationToken cancellationToken = default)
public ApiResponse<JsonDocument> CreateApplePaySession(string checkoutId, CheckoutsCreateApplePaySessionRequest? body = null, RequestOptions? requestOptions = null, CancellationToken cancellationToken = default)
{
var request = _client.CreateRequest(HttpMethod.Put, "/v0.2/checkouts/{id}/apple-pay-session", builder =>
var request = _client.CreateRequest(HttpMethod.Put, "/v0.2/checkouts/{checkout_id}/apple-pay-session", builder =>
{
builder.AddPath("id", id);
builder.AddPath("checkout_id", checkoutId);
});
var effectiveCancellationToken = ApiClient.CreateCancellationToken(cancellationToken, requestOptions, out var timeoutScope);
try
Expand Down Expand Up @@ -217,15 +217,15 @@ public ApiResponse<JsonDocument> CreateApplePaySession(string id, CheckoutsCreat
/// Create an Apple Pay session
/// </summary>
/// <remarks>Creates an Apple Pay merchant session for the specified checkout. Use this endpoint after the customer selects Apple Pay and before calling ApplePaySession.completeMerchantValidation(...) in the browser. SumUp validates the merchant session request and returns the Apple Pay session object that your frontend should pass to Apple's JavaScript API.</remarks>
/// <param name="id">Unique ID of the checkout resource.</param>
/// <param name="checkoutId">Unique ID of the checkout resource.</param>
/// <param name="body">The data needed to create an apple pay session for a checkout.</param>
/// <param name="requestOptions">Optional per-request overrides.</param>
/// <param name="cancellationToken">Token used to cancel the request.</param>
public async Task<ApiResponse<JsonDocument>> CreateApplePaySessionAsync(string id, CheckoutsCreateApplePaySessionRequest? body = null, RequestOptions? requestOptions = null, CancellationToken cancellationToken = default)
public async Task<ApiResponse<JsonDocument>> CreateApplePaySessionAsync(string checkoutId, CheckoutsCreateApplePaySessionRequest? body = null, RequestOptions? requestOptions = null, CancellationToken cancellationToken = default)
{
var request = _client.CreateRequest(HttpMethod.Put, "/v0.2/checkouts/{id}/apple-pay-session", builder =>
var request = _client.CreateRequest(HttpMethod.Put, "/v0.2/checkouts/{checkout_id}/apple-pay-session", builder =>
{
builder.AddPath("id", id);
builder.AddPath("checkout_id", checkoutId);
});
var effectiveCancellationToken = ApiClient.CreateCancellationToken(cancellationToken, requestOptions, out var timeoutScope);
try
Expand Down Expand Up @@ -276,14 +276,14 @@ public async Task<ApiResponse<JsonDocument>> CreateApplePaySessionAsync(string i
/// Deactivate a checkout
/// </summary>
/// <remarks>Deactivates an identified checkout resource. If the checkout has already been processed it can not be deactivated.</remarks>
/// <param name="id">Unique ID of the checkout resource.</param>
/// <param name="checkoutId">Unique ID of the checkout resource.</param>
/// <param name="requestOptions">Optional per-request overrides.</param>
/// <param name="cancellationToken">Token used to cancel the request.</param>
public ApiResponse<Checkout> Deactivate(string id, RequestOptions? requestOptions = null, CancellationToken cancellationToken = default)
public ApiResponse<Checkout> Deactivate(string checkoutId, RequestOptions? requestOptions = null, CancellationToken cancellationToken = default)
{
var request = _client.CreateRequest(HttpMethod.Delete, "/v0.1/checkouts/{id}", builder =>
var request = _client.CreateRequest(HttpMethod.Delete, "/v0.1/checkouts/{checkout_id}", builder =>
{
builder.AddPath("id", id);
builder.AddPath("checkout_id", checkoutId);
});
var effectiveCancellationToken = ApiClient.CreateCancellationToken(cancellationToken, requestOptions, out var timeoutScope);
try
Expand Down Expand Up @@ -335,14 +335,14 @@ public ApiResponse<Checkout> Deactivate(string id, RequestOptions? requestOption
/// Deactivate a checkout
/// </summary>
/// <remarks>Deactivates an identified checkout resource. If the checkout has already been processed it can not be deactivated.</remarks>
/// <param name="id">Unique ID of the checkout resource.</param>
/// <param name="checkoutId">Unique ID of the checkout resource.</param>
/// <param name="requestOptions">Optional per-request overrides.</param>
/// <param name="cancellationToken">Token used to cancel the request.</param>
public async Task<ApiResponse<Checkout>> DeactivateAsync(string id, RequestOptions? requestOptions = null, CancellationToken cancellationToken = default)
public async Task<ApiResponse<Checkout>> DeactivateAsync(string checkoutId, RequestOptions? requestOptions = null, CancellationToken cancellationToken = default)
{
var request = _client.CreateRequest(HttpMethod.Delete, "/v0.1/checkouts/{id}", builder =>
var request = _client.CreateRequest(HttpMethod.Delete, "/v0.1/checkouts/{checkout_id}", builder =>
{
builder.AddPath("id", id);
builder.AddPath("checkout_id", checkoutId);
});
var effectiveCancellationToken = ApiClient.CreateCancellationToken(cancellationToken, requestOptions, out var timeoutScope);
try
Expand Down Expand Up @@ -394,14 +394,14 @@ public async Task<ApiResponse<Checkout>> DeactivateAsync(string id, RequestOptio
/// Retrieve a checkout
/// </summary>
/// <remarks>Retrieves an identified checkout resource. Use this request after processing a checkout to confirm its status and inform the end user respectively.</remarks>
/// <param name="id">Unique ID of the checkout resource.</param>
/// <param name="checkoutId">Unique ID of the checkout resource.</param>
/// <param name="requestOptions">Optional per-request overrides.</param>
/// <param name="cancellationToken">Token used to cancel the request.</param>
public ApiResponse<CheckoutSuccess> Get(string id, RequestOptions? requestOptions = null, CancellationToken cancellationToken = default)
public ApiResponse<CheckoutSuccess> Get(string checkoutId, RequestOptions? requestOptions = null, CancellationToken cancellationToken = default)
{
var request = _client.CreateRequest(HttpMethod.Get, "/v0.1/checkouts/{id}", builder =>
var request = _client.CreateRequest(HttpMethod.Get, "/v0.1/checkouts/{checkout_id}", builder =>
{
builder.AddPath("id", id);
builder.AddPath("checkout_id", checkoutId);
});
var effectiveCancellationToken = ApiClient.CreateCancellationToken(cancellationToken, requestOptions, out var timeoutScope);
try
Expand Down Expand Up @@ -448,14 +448,14 @@ public ApiResponse<CheckoutSuccess> Get(string id, RequestOptions? requestOption
/// Retrieve a checkout
/// </summary>
/// <remarks>Retrieves an identified checkout resource. Use this request after processing a checkout to confirm its status and inform the end user respectively.</remarks>
/// <param name="id">Unique ID of the checkout resource.</param>
/// <param name="checkoutId">Unique ID of the checkout resource.</param>
/// <param name="requestOptions">Optional per-request overrides.</param>
/// <param name="cancellationToken">Token used to cancel the request.</param>
public async Task<ApiResponse<CheckoutSuccess>> GetAsync(string id, RequestOptions? requestOptions = null, CancellationToken cancellationToken = default)
public async Task<ApiResponse<CheckoutSuccess>> GetAsync(string checkoutId, RequestOptions? requestOptions = null, CancellationToken cancellationToken = default)
{
var request = _client.CreateRequest(HttpMethod.Get, "/v0.1/checkouts/{id}", builder =>
var request = _client.CreateRequest(HttpMethod.Get, "/v0.1/checkouts/{checkout_id}", builder =>
{
builder.AddPath("id", id);
builder.AddPath("checkout_id", checkoutId);
});
var effectiveCancellationToken = ApiClient.CreateCancellationToken(cancellationToken, requestOptions, out var timeoutScope);
try
Expand Down Expand Up @@ -708,15 +708,15 @@ public async Task<ApiResponse<CheckoutsListAvailablePaymentMethodsResponse>> Lis
/// Process a checkout
/// </summary>
/// <remarks>Processing a checkout will attempt to charge the provided payment instrument for the amount of the specified checkout resource initiated in the Create a checkout endpoint. Follow this request with Retrieve a checkout to confirm its status.</remarks>
/// <param name="id">Unique ID of the checkout resource.</param>
/// <param name="checkoutId">Unique ID of the checkout resource.</param>
/// <param name="body">Details of the payment instrument for processing the checkout.</param>
/// <param name="requestOptions">Optional per-request overrides.</param>
/// <param name="cancellationToken">Token used to cancel the request.</param>
public ApiResponse<CheckoutSuccess> Process(string id, ProcessCheckout body, RequestOptions? requestOptions = null, CancellationToken cancellationToken = default)
public ApiResponse<CheckoutSuccess> Process(string checkoutId, ProcessCheckout body, RequestOptions? requestOptions = null, CancellationToken cancellationToken = default)
{
var request = _client.CreateRequest(HttpMethod.Put, "/v0.1/checkouts/{id}", builder =>
var request = _client.CreateRequest(HttpMethod.Put, "/v0.1/checkouts/{checkout_id}", builder =>
{
builder.AddPath("id", id);
builder.AddPath("checkout_id", checkoutId);
});
var effectiveCancellationToken = ApiClient.CreateCancellationToken(cancellationToken, requestOptions, out var timeoutScope);
try
Expand Down Expand Up @@ -777,15 +777,15 @@ public ApiResponse<CheckoutSuccess> Process(string id, ProcessCheckout body, Req
/// Process a checkout
/// </summary>
/// <remarks>Processing a checkout will attempt to charge the provided payment instrument for the amount of the specified checkout resource initiated in the Create a checkout endpoint. Follow this request with Retrieve a checkout to confirm its status.</remarks>
/// <param name="id">Unique ID of the checkout resource.</param>
/// <param name="checkoutId">Unique ID of the checkout resource.</param>
/// <param name="body">Details of the payment instrument for processing the checkout.</param>
/// <param name="requestOptions">Optional per-request overrides.</param>
/// <param name="cancellationToken">Token used to cancel the request.</param>
public async Task<ApiResponse<CheckoutSuccess>> ProcessAsync(string id, ProcessCheckout body, RequestOptions? requestOptions = null, CancellationToken cancellationToken = default)
public async Task<ApiResponse<CheckoutSuccess>> ProcessAsync(string checkoutId, ProcessCheckout body, RequestOptions? requestOptions = null, CancellationToken cancellationToken = default)
{
var request = _client.CreateRequest(HttpMethod.Put, "/v0.1/checkouts/{id}", builder =>
var request = _client.CreateRequest(HttpMethod.Put, "/v0.1/checkouts/{checkout_id}", builder =>
{
builder.AddPath("id", id);
builder.AddPath("checkout_id", checkoutId);
});
var effectiveCancellationToken = ApiClient.CreateCancellationToken(cancellationToken, requestOptions, out var timeoutScope);
try
Expand Down
Loading
Loading