Paddle.Checkout.close()
Closes an opened checkout.
Use Paddle.Checkout.close()
to close an opened checkout.
Typically used when working with overlay checkout to close the Paddle Checkout overlay. If used with inline checkout, removes the Paddle Checkout iframe from the DOM.
For success workflows, you can redirect to a success URL or pass an
eventCallback
toPaddle.Initialize()
forcheckout.completed
.To learn more, see Handle checkout success.
Example
This example shows how you can use Paddle.Checkout.close()
to close an inline checkout.
12345678910111213141516171819201<!-- Checkout buttons -->
2<button onclick="openCheckout();">Open checkout</button>
3<button onclick="closeCheckout();">Close checkout</button>
4
5<!-- Inline checkout container -->
6<div class="checkout-container"></div>
7
8<script type="text/javascript">
9 Paddle.Initialize({
10 token: 'live_7d279f61a3499fed520f7cd8c08'
11 });
12
13 function openCheckout() {
14 var items = [{
15 priceId: 'pri_01gsz8x8sawmvhz1pv30nge1ke',
16 quantity: 10
17 },
18 {
19 priceId: 'pri_01gsz95g2zrkagg294kpstx54r',
20 quantity: 1
Events
checkout.closed | Emitted when the checkout is closed. |
Related pages
On this page