Skip to content

Commit c2ffa4c

Browse files
authored
chore: synced file(s) with sumup/apis (#169)
1 parent 73e97f9 commit c2ffa4c

3 files changed

Lines changed: 126 additions & 1 deletion

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
}

sdk/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
//! purpose: None,
6969
//! valid_until: None,
7070
//! redirect_url: None,
71+
//! hosted_checkout: None,
7172
//! })
7273
//! .await
7374
//! .expect("create checkout");

sdk/src/resources/checkouts.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,15 @@ pub struct Checkout {
138138
pub customer_id: Option<String>,
139139
#[serde(skip_serializing_if = "Option::is_none")]
140140
pub mandate: Option<MandateResponse>,
141+
/// URL of the SumUp-hosted payment page that handles the payment flow. Returned when Hosted Checkout is enabled for the checkout.
142+
///
143+
/// Constraints:
144+
/// - read-only
145+
/// - format: `uri`
146+
///
147+
/// Example: `https://checkout.sumup.com/pay/8f9316a3-cda9-42a9-9771-54d534315676`
148+
#[serde(skip_serializing_if = "Option::is_none")]
149+
pub hosted_checkout_url: Option<String>,
141150
/// Payment attempts and resulting transaction records linked to this checkout. Use the Transactions endpoints when you need the authoritative payment result and event history.
142151
///
143152
/// Constraints:
@@ -206,6 +215,8 @@ pub struct CheckoutCreateRequest {
206215
/// Example: `https://mysite.com/completed_purchase`
207216
#[serde(skip_serializing_if = "Option::is_none")]
208217
pub redirect_url: Option<String>,
218+
#[serde(skip_serializing_if = "Option::is_none")]
219+
pub hosted_checkout: Option<HostedCheckout>,
209220
}
210221
/// Checkout resource returned after a synchronous processing attempt. In addition to the base checkout fields, it can include the resulting transaction identifiers and any newly created payment instrument token.
211222
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
@@ -277,6 +288,15 @@ pub struct CheckoutSuccess {
277288
pub customer_id: Option<String>,
278289
#[serde(skip_serializing_if = "Option::is_none")]
279290
pub mandate: Option<MandateResponse>,
291+
/// URL of the SumUp-hosted payment page that handles the payment flow. Returned when Hosted Checkout is enabled for the checkout.
292+
///
293+
/// Constraints:
294+
/// - read-only
295+
/// - format: `uri`
296+
///
297+
/// Example: `https://checkout.sumup.com/pay/8f9316a3-cda9-42a9-9771-54d534315676`
298+
#[serde(skip_serializing_if = "Option::is_none")]
299+
pub hosted_checkout_url: Option<String>,
280300
/// Payment attempts and resulting transaction records linked to this checkout. Use the Transactions endpoints when you need the authoritative payment result and event history.
281301
///
282302
/// Constraints:
@@ -346,6 +366,14 @@ impl std::fmt::Display for DetailsError {
346366
}
347367
}
348368
impl std::error::Error for DetailsError {}
369+
/// Hosted Checkout configuration. Enable it to receive a SumUp-hosted payment page URL in the checkout response.
370+
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
371+
pub struct HostedCheckout {
372+
/// Whether the checkout should include a SumUp-hosted payment page.
373+
///
374+
/// Example: `true`
375+
pub enabled: bool,
376+
}
349377
/// Mandate details used when a checkout should create a reusable card token for future recurring or merchant-initiated payments.
350378
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
351379
pub struct MandatePayload {
@@ -882,6 +910,7 @@ impl<'a> CheckoutsClient<'a> {
882910
/// Creates a new payment checkout resource. The unique `checkout_reference` created by this request, is used for further manipulation of the checkout.
883911
///
884912
/// For 3DS checkouts, add the `redirect_url` parameter to your request body schema.
913+
/// To use the [Hosted Checkout](https://developer.sumup.com/online-payments/checkouts/hosted-checkout/) page, set the `hosted_checkout.enabled` to `true`.
885914
///
886915
/// Follow by processing a checkout to charge the provided payment instrument.
887916
///

0 commit comments

Comments
 (0)