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
7 changes: 7 additions & 0 deletions src/Types/Checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ class Checkout
*/
public ?MandateResponse $mandate = null;

/**
* URL of the SumUp-hosted payment page that handles the payment flow. Returned when Hosted Checkout is enabled for the checkout.
*
* @var string|null
*/
public ?string $hostedCheckoutUrl = null;

/**
* Payment attempts and resulting transaction records linked to this checkout. Use the Transactions endpoints when you need the authoritative payment result and event history.
*
Expand Down
12 changes: 11 additions & 1 deletion src/Types/CheckoutCreateRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ class CheckoutCreateRequest
*/
public ?string $redirectUrl = null;

/**
* Hosted Checkout configuration. Enable it to receive a SumUp-hosted payment page URL in the checkout response.
*
* @var HostedCheckout|null
*/
public ?HostedCheckout $hostedCheckout = null;

/**
* Create request DTO.
*
Expand All @@ -92,6 +99,7 @@ class CheckoutCreateRequest
* @param CheckoutCreateRequestPurpose|string|null $purpose
* @param string|null $validUntil
* @param string|null $redirectUrl
* @param HostedCheckout|null $hostedCheckout
*/
public function __construct(
string $checkoutReference,
Expand All @@ -103,7 +111,8 @@ public function __construct(
?string $customerId = null,
CheckoutCreateRequestPurpose|string|null $purpose = null,
?string $validUntil = null,
?string $redirectUrl = null
?string $redirectUrl = null,
?HostedCheckout $hostedCheckout = null
) {
\SumUp\Hydrator::hydrate([
'checkout_reference' => $checkoutReference,
Expand All @@ -116,6 +125,7 @@ public function __construct(
'purpose' => $purpose,
'valid_until' => $validUntil,
'redirect_url' => $redirectUrl,
'hosted_checkout' => $hostedCheckout,
], self::class, $this);
}

Expand Down
7 changes: 7 additions & 0 deletions src/Types/CheckoutSuccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ class CheckoutSuccess
*/
public ?MandateResponse $mandate = null;

/**
* URL of the SumUp-hosted payment page that handles the payment flow. Returned when Hosted Checkout is enabled for the checkout.
*
* @var string|null
*/
public ?string $hostedCheckoutUrl = null;

/**
* Payment attempts and resulting transaction records linked to this checkout. Use the Transactions endpoints when you need the authoritative payment result and event history.
*
Expand Down
19 changes: 19 additions & 0 deletions src/Types/HostedCheckout.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

declare(strict_types=1);

namespace SumUp\Types;

/**
* Hosted Checkout configuration. Enable it to receive a SumUp-hosted payment page URL in the checkout response.
*/
class HostedCheckout
{
/**
* Whether the checkout should include a SumUp-hosted payment page.
*
* @var bool
*/
public bool $enabled;

}
Loading