Skip to content

Commit 84d9cd1

Browse files
authored
chore: synced file(s) with sumup/apis (#84)
1 parent 4d4269b commit 84d9cd1

6 files changed

Lines changed: 187 additions & 9 deletions

File tree

openapi.json

Lines changed: 96 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
"post": {
153153
"operationId": "CreateCheckout",
154154
"summary": "Create a checkout",
155-
"description": "Creates a new payment checkout resource. The unique `checkout_reference` created by this request, is used for further manipulation of the checkout.\n\nFor 3DS checkouts, add the `redirect_url` parameter to your request body schema.\n\nFollow by processing a checkout to charge the provided payment instrument.",
155+
"description": "Creates a new payment checkout resource. The unique `checkout_reference` created by this request, is used for further manipulation of the checkout.\n\nFor 3DS checkouts, add the `redirect_url` parameter to your request body schema.\nTo use the [Hosted Checkout](https://developer.sumup.com/online-payments/checkouts/hosted-checkout/) page, set the `hosted_checkout.enabled` to `true`.\n\nFollow by processing a checkout to charge the provided payment instrument.",
156156
"requestBody": {
157157
"description": "Details for creating a checkout resource.",
158158
"required": true,
@@ -196,6 +196,20 @@
196196
"merchant_code": "MH4H92C7",
197197
"redirect_url": "https://mysite.com/completed_purchase"
198198
}
199+
},
200+
"HostedCheckout": {
201+
"description": "Create a checkout with a SumUp-hosted payment page",
202+
"x-beta": true,
203+
"value": {
204+
"checkout_reference": "b50pr914-6k0e-3091-a592-890010285b3d",
205+
"amount": 12,
206+
"currency": "EUR",
207+
"merchant_code": "MCXXXXXX",
208+
"description": "A sample checkout",
209+
"hosted_checkout": {
210+
"enabled": true
211+
}
212+
}
199213
}
200214
}
201215
}
@@ -316,6 +330,27 @@
316330
}
317331
]
318332
}
333+
},
334+
"HostedCheckout": {
335+
"description": "Response body for a checkout with a SumUp-hosted payment page",
336+
"value": {
337+
"checkout_reference": "b50pr914-6k0e-3091-a592-890010285b3d",
338+
"amount": 12,
339+
"currency": "EUR",
340+
"merchant_code": "MCXXXXXX",
341+
"merchant_country": "DE",
342+
"merchant_name": "Sample Shop",
343+
"description": "A sample checkout",
344+
"id": "64553e20-3f0e-49e4-8af3-fd0eca86ce91",
345+
"status": "PENDING",
346+
"date": "2000-01-01T12:49:24.899+00:00",
347+
"purpose": "CHECKOUT",
348+
"hosted_checkout": {
349+
"enabled": true
350+
},
351+
"hosted_checkout_url": "https://checkout.sumup.com/pay/8f9316a3-cda9-42a9-9771-54d534315676",
352+
"transactions": []
353+
}
319354
}
320355
}
321356
}
@@ -6610,6 +6645,21 @@
66106645
},
66116646
"title": "ELV Card Account"
66126647
},
6648+
"HostedCheckout": {
6649+
"description": "Hosted Checkout configuration. Enable it to receive a SumUp-hosted payment page URL in the checkout response.",
6650+
"type": "object",
6651+
"properties": {
6652+
"enabled": {
6653+
"description": "Whether the checkout should include a SumUp-hosted payment page.",
6654+
"type": "boolean",
6655+
"example": true
6656+
}
6657+
},
6658+
"required": [
6659+
"enabled"
6660+
],
6661+
"title": "Hosted Checkout"
6662+
},
66136663
"Checkout": {
66146664
"description": "Core checkout resource returned by the Checkouts API. A checkout is created before payment processing and then updated as payment attempts, redirects, and resulting transactions are attached to it.",
66156665
"type": "object",
@@ -6683,6 +6733,13 @@
66836733
"mandate": {
66846734
"$ref": "#/components/schemas/MandateResponse"
66856735
},
6736+
"hosted_checkout_url": {
6737+
"description": "URL of the SumUp-hosted payment page that handles the payment flow. Returned when Hosted Checkout is enabled for the checkout.",
6738+
"type": "string",
6739+
"format": "uri",
6740+
"example": "https://checkout.sumup.com/pay/8f9316a3-cda9-42a9-9771-54d534315676",
6741+
"readOnly": true
6742+
},
66866743
"transactions": {
66876744
"description": "Payment attempts and resulting transaction records linked to this checkout. Use the Transactions endpoints when you need the authoritative payment result and event history.",
66886745
"type": "array",
@@ -6778,6 +6835,9 @@
67786835
"description": "URL where the payer should be sent after a redirect-based payment or SCA flow completes. This is required for [APMs](https://developer.sumup.com/online-payments/apm/introduction) and recommended for card checkouts that may require [3DS](https://developer.sumup.com/online-payments/features/3ds). If it is omitted, the [Payment Widget](https://developer.sumup.com/online-payments/checkouts) can render the challenge in an iframe instead of using a full-page redirect.",
67796836
"type": "string",
67806837
"example": "https://mysite.com/completed_purchase"
6838+
},
6839+
"hosted_checkout": {
6840+
"$ref": "#/components/schemas/HostedCheckout"
67816841
}
67826842
},
67836843
"required": [
@@ -10449,6 +10509,20 @@
1044910509
"merchant_code": "MH4H92C7",
1045010510
"redirect_url": "https://mysite.com/completed_purchase"
1045110511
}
10512+
},
10513+
"HostedCheckout": {
10514+
"description": "Create a checkout with a SumUp-hosted payment page",
10515+
"x-beta": true,
10516+
"value": {
10517+
"checkout_reference": "b50pr914-6k0e-3091-a592-890010285b3d",
10518+
"amount": 12,
10519+
"currency": "EUR",
10520+
"merchant_code": "MCXXXXXX",
10521+
"description": "A sample checkout",
10522+
"hosted_checkout": {
10523+
"enabled": true
10524+
}
10525+
}
1045210526
}
1045310527
}
1045410528
}
@@ -10709,6 +10783,27 @@
1070910783
}
1071010784
]
1071110785
}
10786+
},
10787+
"HostedCheckout": {
10788+
"description": "Response body for a checkout with a SumUp-hosted payment page",
10789+
"value": {
10790+
"checkout_reference": "b50pr914-6k0e-3091-a592-890010285b3d",
10791+
"amount": 12,
10792+
"currency": "EUR",
10793+
"merchant_code": "MCXXXXXX",
10794+
"merchant_country": "DE",
10795+
"merchant_name": "Sample Shop",
10796+
"description": "A sample checkout",
10797+
"id": "64553e20-3f0e-49e4-8af3-fd0eca86ce91",
10798+
"status": "PENDING",
10799+
"date": "2000-01-01T12:49:24.899+00:00",
10800+
"purpose": "CHECKOUT",
10801+
"hosted_checkout": {
10802+
"enabled": true
10803+
},
10804+
"hosted_checkout_url": "https://checkout.sumup.com/pay/8f9316a3-cda9-42a9-9771-54d534315676",
10805+
"transactions": []
10806+
}
1071210807
}
1071310808
}
1071410809
}

src/main/java/com/sumup/sdk/clients/CheckoutsAsyncClient.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ public CheckoutsAsyncClient(ApiClient apiClient) {
4545
*
4646
* <p>Creates a new payment checkout resource. The unique `checkout_reference` created by this
4747
* request, is used for further manipulation of the checkout. For 3DS checkouts, add the
48-
* `redirect_url` parameter to your request body schema. Follow by processing a checkout to charge
49-
* the provided payment instrument.
48+
* `redirect_url` parameter to your request body schema. To use the [Hosted
49+
* Checkout](https://developer.sumup.com/online-payments/checkouts/hosted-checkout/) page, set the
50+
* `hosted_checkout.enabled` to `true`. Follow by processing a checkout to charge the provided
51+
* payment instrument.
5052
*
5153
* <p>Operation ID: CreateCheckout
5254
*
@@ -66,8 +68,10 @@ public CompletableFuture<com.sumup.sdk.models.Checkout> create(
6668
*
6769
* <p>Creates a new payment checkout resource. The unique `checkout_reference` created by this
6870
* request, is used for further manipulation of the checkout. For 3DS checkouts, add the
69-
* `redirect_url` parameter to your request body schema. Follow by processing a checkout to charge
70-
* the provided payment instrument.
71+
* `redirect_url` parameter to your request body schema. To use the [Hosted
72+
* Checkout](https://developer.sumup.com/online-payments/checkouts/hosted-checkout/) page, set the
73+
* `hosted_checkout.enabled` to `true`. Follow by processing a checkout to charge the provided
74+
* payment instrument.
7175
*
7276
* <p>Operation ID: CreateCheckout
7377
*

src/main/java/com/sumup/sdk/clients/CheckoutsClient.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ public CheckoutsClient(ApiClient apiClient) {
4444
*
4545
* <p>Creates a new payment checkout resource. The unique `checkout_reference` created by this
4646
* request, is used for further manipulation of the checkout. For 3DS checkouts, add the
47-
* `redirect_url` parameter to your request body schema. Follow by processing a checkout to charge
48-
* the provided payment instrument.
47+
* `redirect_url` parameter to your request body schema. To use the [Hosted
48+
* Checkout](https://developer.sumup.com/online-payments/checkouts/hosted-checkout/) page, set the
49+
* `hosted_checkout.enabled` to `true`. Follow by processing a checkout to charge the provided
50+
* payment instrument.
4951
*
5052
* <p>Operation ID: CreateCheckout
5153
*
@@ -65,8 +67,10 @@ public com.sumup.sdk.models.Checkout create(com.sumup.sdk.models.CheckoutCreateR
6567
*
6668
* <p>Creates a new payment checkout resource. The unique `checkout_reference` created by this
6769
* request, is used for further manipulation of the checkout. For 3DS checkouts, add the
68-
* `redirect_url` parameter to your request body schema. Follow by processing a checkout to charge
69-
* the provided payment instrument.
70+
* `redirect_url` parameter to your request body schema. To use the [Hosted
71+
* Checkout](https://developer.sumup.com/online-payments/checkouts/hosted-checkout/) page, set the
72+
* `hosted_checkout.enabled` to `true`. Follow by processing a checkout to charge the provided
73+
* payment instrument.
7074
*
7175
* <p>Operation ID: CreateCheckout
7276
*

src/main/java/com/sumup/sdk/models/Checkout.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ public record Checkout(
4141
*/
4242
String description,
4343

44+
/**
45+
* URL of the SumUp-hosted payment page that handles the payment flow. Returned when Hosted
46+
* Checkout is enabled for the checkout.
47+
*/
48+
String hostedCheckoutUrl,
49+
4450
/** Unique SumUp identifier of the checkout resource. */
4551
String id,
4652

@@ -262,6 +268,7 @@ public Checkout build() {
262268
date,
263269
description,
264270
null,
271+
null,
265272
mandate,
266273
merchantCode,
267274
returnUrl,

src/main/java/com/sumup/sdk/models/CheckoutCreateRequest.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ public record CheckoutCreateRequest(
3535
*/
3636
String description,
3737

38+
/**
39+
* Hosted Checkout configuration. Enable it to receive a SumUp-hosted payment page URL in the
40+
* checkout response.
41+
*/
42+
com.sumup.sdk.models.HostedCheckout hostedCheckout,
43+
3844
/** Merchant account that should receive the payment. */
3945
String merchantCode,
4046

@@ -82,6 +88,7 @@ public static final class Builder {
8288
private com.sumup.sdk.models.Currency currency;
8389
private String customerId;
8490
private String description;
91+
private com.sumup.sdk.models.HostedCheckout hostedCheckout;
8592
private String merchantCode;
8693
private com.sumup.sdk.models.CheckoutCreateRequestPurpose purpose;
8794
private String redirectUrl;
@@ -149,6 +156,18 @@ public Builder description(String description) {
149156
return this;
150157
}
151158

159+
/**
160+
* Sets the value for {@code hostedCheckout}.
161+
*
162+
* @param hostedCheckout Hosted Checkout configuration. Enable it to receive a SumUp-hosted
163+
* payment page URL in the checkout response.
164+
* @return This builder instance.
165+
*/
166+
public Builder hostedCheckout(com.sumup.sdk.models.HostedCheckout hostedCheckout) {
167+
this.hostedCheckout = hostedCheckout;
168+
return this;
169+
}
170+
152171
/**
153172
* Sets the value for {@code merchantCode}.
154173
*
@@ -227,6 +246,7 @@ public CheckoutCreateRequest build() {
227246
Objects.requireNonNull(currency, "currency"),
228247
customerId,
229248
description,
249+
hostedCheckout,
230250
Objects.requireNonNull(merchantCode, "merchantCode"),
231251
purpose,
232252
redirectUrl,
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Code generated by sumup-java/codegen. DO NOT EDIT.
2+
package com.sumup.sdk.models;
3+
4+
import java.util.Objects;
5+
6+
/**
7+
* Hosted Checkout configuration. Enable it to receive a SumUp-hosted payment page URL in the
8+
* checkout response.
9+
*/
10+
public record HostedCheckout(
11+
/** Whether the checkout should include a SumUp-hosted payment page. */
12+
Boolean enabled) {
13+
/**
14+
* Creates a builder for HostedCheckout.
15+
*
16+
* @return Builder that constructs immutable HostedCheckout instances.
17+
*/
18+
public static Builder builder() {
19+
return new Builder();
20+
}
21+
22+
/** Builder for HostedCheckout instances. */
23+
public static final class Builder {
24+
private Boolean enabled;
25+
26+
private Builder() {}
27+
28+
/**
29+
* Sets the value for {@code enabled}.
30+
*
31+
* @param enabled Whether the checkout should include a SumUp-hosted payment page.
32+
* @return This builder instance.
33+
*/
34+
public Builder enabled(Boolean enabled) {
35+
this.enabled = enabled;
36+
return this;
37+
}
38+
39+
/**
40+
* Builds an immutable HostedCheckout instance.
41+
*
42+
* @return Immutable HostedCheckout.
43+
*/
44+
public HostedCheckout build() {
45+
return new HostedCheckout(Objects.requireNonNull(enabled, "enabled"));
46+
}
47+
}
48+
}

0 commit comments

Comments
 (0)