# Embedding Payment Forms in your app

By default, the Stripe Connect - Marketplace plugin creates Checkout Sessions where the payment form is displayed on a Stripe-hosted page. However, you can also embed the payment form in your own app.

### Video Tutorial

The below video tutorial demonstrates how to embed payment forms (i.e. Checkout Sessions) in your Bubble app:

{% embed url="https://www.youtube.com/watch?v=QAHj5Hv18XI" %}

\
To embed payments forms in your app, follow the steps outlined in the '[**Splitting one-off payment section**](splitting-one-off-payments)', but:

* When creating the Checkout Session set the 'Embed Session' field to 'Yes'
* Select a 'Return URL' - this is where the user will be redirected after completing their purchase

<div data-full-width="true"><figure><img src="https://445589018-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOYowMYV4NApuJz7Z6lKJ%2Fuploads%2FNZ4ilI1KkDwHHddKHgtO%2FScreenshot%202024-01-09%20at%2014.52.51.png?alt=media&#x26;token=9293e465-0f63-4568-88de-5ac308bc01e7" alt="" width="563"><figcaption></figcaption></figure></div>

* Navigate to a page in your own app rather than to an external website

\
On the page you navigate to:

* You will need to drop the 'Embedded Checkout Session' element on the page to display the payment form

<figure><img src="https://445589018-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOYowMYV4NApuJz7Z6lKJ%2Fuploads%2FjBmaSEtMaZZqE0mNRCBK%2F2024-01-09%2014.55.38.gif?alt=media&#x26;token=87cb3d5e-4477-4873-9da7-0fdcd79976f4" alt=""><figcaption></figcaption></figure>

* Use the 'Load Embedded Checkout Session' action to load the payment form

<figure><img src="https://445589018-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOYowMYV4NApuJz7Z6lKJ%2Fuploads%2F98OARxxcZb3XatQO9SdT%2F2024-01-09%2014.56.45.gif?alt=media&#x26;token=ed147012-183b-4cf6-841e-0ed4d9efafcd" alt=""><figcaption></figcaption></figure>

* You will need to provide a clientSecret value from the associated Checkout Session for the 'Load Embedded Checkout Session' action - you can get this by using the 'Retrieve Checkout Session Details' data call

<figure><img src="https://445589018-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOYowMYV4NApuJz7Z6lKJ%2Fuploads%2FynxwuPxWaxFvvysbAgNH%2F2024-01-09%2014.57.24.gif?alt=media&#x26;token=0ca45a9c-40f6-445c-ac6c-927ad497a6c7" alt=""><figcaption></figcaption></figure>

**For security reasons, do not save this clientSecret value down in your database or display it anywhere on the page.**

If you've done all this correctly, you'll be able to load the payment form created from the Checkout Session in your app\


<figure><img src="https://445589018-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOYowMYV4NApuJz7Z6lKJ%2Fuploads%2FMlcVLxxp1IRhmk1c5OQ2%2F2024-01-09%2015.04.31.gif?alt=media&#x26;token=32f64be2-6548-47e0-af39-27baa5fea4f4" alt=""><figcaption></figcaption></figure>

### Demo app

You can view an example of the page setup and workflow actions for creating and embedded Checkout Session in the demo app at the below link (relevant section is the 'Embedding Checkout Sessions in your app' section):

{% embed url="https://stripeconnectmarketplace.bubbleapps.io/version-test" %}

The editor is public and can be accessed by clicking the 'View Editor' button at the top of the page.\
