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
97 changes: 96 additions & 1 deletion openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
"post": {
"operationId": "CreateCheckout",
"summary": "Create a checkout",
"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.",
"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.",
"requestBody": {
"description": "Details for creating a checkout resource.",
"required": true,
Expand Down Expand Up @@ -196,6 +196,20 @@
"merchant_code": "MH4H92C7",
"redirect_url": "https://mysite.com/completed_purchase"
}
},
"HostedCheckout": {
"description": "Create a checkout with a SumUp-hosted payment page",
"x-beta": true,
"value": {
"checkout_reference": "b50pr914-6k0e-3091-a592-890010285b3d",
"amount": 12,
"currency": "EUR",
"merchant_code": "MCXXXXXX",
"description": "A sample checkout",
"hosted_checkout": {
"enabled": true
}
}
}
}
}
Expand Down Expand Up @@ -316,6 +330,27 @@
}
]
}
},
"HostedCheckout": {
"description": "Response body for a checkout with a SumUp-hosted payment page",
"value": {
"checkout_reference": "b50pr914-6k0e-3091-a592-890010285b3d",
"amount": 12,
"currency": "EUR",
"merchant_code": "MCXXXXXX",
"merchant_country": "DE",
"merchant_name": "Sample Shop",
"description": "A sample checkout",
"id": "64553e20-3f0e-49e4-8af3-fd0eca86ce91",
"status": "PENDING",
"date": "2000-01-01T12:49:24.899+00:00",
"purpose": "CHECKOUT",
"hosted_checkout": {
"enabled": true
},
"hosted_checkout_url": "https://checkout.sumup.com/pay/8f9316a3-cda9-42a9-9771-54d534315676",
"transactions": []
}
}
}
}
Expand Down Expand Up @@ -6610,6 +6645,21 @@
},
"title": "ELV Card Account"
},
"HostedCheckout": {
"description": "Hosted Checkout configuration. Enable it to receive a SumUp-hosted payment page URL in the checkout response.",
"type": "object",
"properties": {
"enabled": {
"description": "Whether the checkout should include a SumUp-hosted payment page.",
"type": "boolean",
"example": true
}
},
"required": [
"enabled"
],
"title": "Hosted Checkout"
},
"Checkout": {
"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.",
"type": "object",
Expand Down Expand Up @@ -6683,6 +6733,13 @@
"mandate": {
"$ref": "#/components/schemas/MandateResponse"
},
"hosted_checkout_url": {
"description": "URL of the SumUp-hosted payment page that handles the payment flow. Returned when Hosted Checkout is enabled for the checkout.",
"type": "string",
"format": "uri",
"example": "https://checkout.sumup.com/pay/8f9316a3-cda9-42a9-9771-54d534315676",
"readOnly": true
},
"transactions": {
"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.",
"type": "array",
Expand Down Expand Up @@ -6778,6 +6835,9 @@
"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.",
"type": "string",
"example": "https://mysite.com/completed_purchase"
},
"hosted_checkout": {
"$ref": "#/components/schemas/HostedCheckout"
}
},
"required": [
Expand Down Expand Up @@ -10449,6 +10509,20 @@
"merchant_code": "MH4H92C7",
"redirect_url": "https://mysite.com/completed_purchase"
}
},
"HostedCheckout": {
"description": "Create a checkout with a SumUp-hosted payment page",
"x-beta": true,
"value": {
"checkout_reference": "b50pr914-6k0e-3091-a592-890010285b3d",
"amount": 12,
"currency": "EUR",
"merchant_code": "MCXXXXXX",
"description": "A sample checkout",
"hosted_checkout": {
"enabled": true
}
}
}
}
}
Expand Down Expand Up @@ -10709,6 +10783,27 @@
}
]
}
},
"HostedCheckout": {
"description": "Response body for a checkout with a SumUp-hosted payment page",
"value": {
"checkout_reference": "b50pr914-6k0e-3091-a592-890010285b3d",
"amount": 12,
"currency": "EUR",
"merchant_code": "MCXXXXXX",
"merchant_country": "DE",
"merchant_name": "Sample Shop",
"description": "A sample checkout",
"id": "64553e20-3f0e-49e4-8af3-fd0eca86ce91",
"status": "PENDING",
"date": "2000-01-01T12:49:24.899+00:00",
"purpose": "CHECKOUT",
"hosted_checkout": {
"enabled": true
},
"hosted_checkout_url": "https://checkout.sumup.com/pay/8f9316a3-cda9-42a9-9771-54d534315676",
"transactions": []
}
}
}
}
Expand Down
12 changes: 8 additions & 4 deletions src/main/java/com/sumup/sdk/clients/CheckoutsAsyncClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ public CheckoutsAsyncClient(ApiClient apiClient) {
*
* <p>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.
* `redirect_url` parameter to your request body schema. To use the [Hosted
* Checkout](https://developer.sumup.com/online-payments/checkouts/hosted-checkout/) page, set the
* `hosted_checkout.enabled` to `true`. Follow by processing a checkout to charge the provided
* payment instrument.
*
* <p>Operation ID: CreateCheckout
*
Expand All @@ -66,8 +68,10 @@ public CompletableFuture<com.sumup.sdk.models.Checkout> create(
*
* <p>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.
* `redirect_url` parameter to your request body schema. To use the [Hosted
* Checkout](https://developer.sumup.com/online-payments/checkouts/hosted-checkout/) page, set the
* `hosted_checkout.enabled` to `true`. Follow by processing a checkout to charge the provided
* payment instrument.
*
* <p>Operation ID: CreateCheckout
*
Expand Down
12 changes: 8 additions & 4 deletions src/main/java/com/sumup/sdk/clients/CheckoutsClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ public CheckoutsClient(ApiClient apiClient) {
*
* <p>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.
* `redirect_url` parameter to your request body schema. To use the [Hosted
* Checkout](https://developer.sumup.com/online-payments/checkouts/hosted-checkout/) page, set the
* `hosted_checkout.enabled` to `true`. Follow by processing a checkout to charge the provided
* payment instrument.
*
* <p>Operation ID: CreateCheckout
*
Expand All @@ -65,8 +67,10 @@ public com.sumup.sdk.models.Checkout create(com.sumup.sdk.models.CheckoutCreateR
*
* <p>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.
* `redirect_url` parameter to your request body schema. To use the [Hosted
* Checkout](https://developer.sumup.com/online-payments/checkouts/hosted-checkout/) page, set the
* `hosted_checkout.enabled` to `true`. Follow by processing a checkout to charge the provided
* payment instrument.
*
* <p>Operation ID: CreateCheckout
*
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/com/sumup/sdk/models/Checkout.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ public record Checkout(
*/
String description,

/**
* URL of the SumUp-hosted payment page that handles the payment flow. Returned when Hosted
* Checkout is enabled for the checkout.
*/
String hostedCheckoutUrl,

/** Unique SumUp identifier of the checkout resource. */
String id,

Expand Down Expand Up @@ -261,6 +267,7 @@ public Checkout build() {
date,
description,
null,
null,
mandate,
merchantCode,
returnUrl,
Expand Down
20 changes: 20 additions & 0 deletions src/main/java/com/sumup/sdk/models/CheckoutCreateRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ public record CheckoutCreateRequest(
*/
String description,

/**
* Hosted Checkout configuration. Enable it to receive a SumUp-hosted payment page URL in the
* checkout response.
*/
com.sumup.sdk.models.HostedCheckout hostedCheckout,

/** Merchant account that should receive the payment. */
String merchantCode,

Expand Down Expand Up @@ -82,6 +88,7 @@ public static final class Builder {
private com.sumup.sdk.models.Currency currency;
private String customerId;
private String description;
private com.sumup.sdk.models.HostedCheckout hostedCheckout;
private String merchantCode;
private com.sumup.sdk.models.CheckoutCreateRequestPurpose purpose;
private String redirectUrl;
Expand Down Expand Up @@ -149,6 +156,18 @@ public Builder description(String description) {
return this;
}

/**
* Sets the value for {@code hostedCheckout}.
*
* @param hostedCheckout Hosted Checkout configuration. Enable it to receive a SumUp-hosted
* payment page URL in the checkout response.
* @return This builder instance.
*/
public Builder hostedCheckout(com.sumup.sdk.models.HostedCheckout hostedCheckout) {
this.hostedCheckout = hostedCheckout;
return this;
}

/**
* Sets the value for {@code merchantCode}.
*
Expand Down Expand Up @@ -227,6 +246,7 @@ public CheckoutCreateRequest build() {
Objects.requireNonNull(currency, "currency"),
customerId,
description,
hostedCheckout,
Objects.requireNonNull(merchantCode, "merchantCode"),
purpose,
redirectUrl,
Expand Down
48 changes: 48 additions & 0 deletions src/main/java/com/sumup/sdk/models/HostedCheckout.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Code generated by sumup-java/codegen. DO NOT EDIT.
package com.sumup.sdk.models;

import java.util.Objects;

/**
* Hosted Checkout configuration. Enable it to receive a SumUp-hosted payment page URL in the
* checkout response.
*/
public record HostedCheckout(
/** Whether the checkout should include a SumUp-hosted payment page. */
Boolean enabled) {
/**
* Creates a builder for HostedCheckout.
*
* @return Builder that constructs immutable HostedCheckout instances.
*/
public static Builder builder() {
return new Builder();
}

/** Builder for HostedCheckout instances. */
public static final class Builder {
private Boolean enabled;

private Builder() {}

/**
* Sets the value for {@code enabled}.
*
* @param enabled Whether the checkout should include a SumUp-hosted payment page.
* @return This builder instance.
*/
public Builder enabled(Boolean enabled) {
this.enabled = enabled;
return this;
}

/**
* Builds an immutable HostedCheckout instance.
*
* @return Immutable HostedCheckout.
*/
public HostedCheckout build() {
return new HostedCheckout(Objects.requireNonNull(enabled, "enabled"));
}
}
}
Loading