Skip to content
Checkout & the First Payment

03.01 · Concept · Free

Hosted, Embedded, or Your Own Form

Choose between a redirect, an embedded element and your own card form, and say what each choice does to the PCI questionnaire you have to answer.

The player loads only when you ask for it, so this page stays fast.

Curated for this lesson

Checkout & the First Payment

Working with Stripe Elements and Checkout Sessions

Directly compares Stripe Checkout Sessions and Elements, matching the hosted-versus-embedded decision beginners must make.

Hosted checkout minimises card-data exposure, embedded payment elements keep the flow on your page while isolating sensitive fields, and a custom card form puts your systems in the highest-risk path. The key decision is who can see or influence the card number, because that drives PCI scope and questionnaire effort.

What this lesson answers

  • hosted checkout or embedded payment element
  • how does PCI scope change with card forms
  • when should I build my own payment form

Notes

For a first card payment, you are choosing how much of the payment page you own. A hosted checkout redirects the customer to the payment provider’s page, so the provider collects the card details. An embedded element places provider-owned card-entry UI inside your page, usually in an iframe, so your site controls the surrounding experience but not the raw card fields. Your own form means you build the card inputs yourself and send card data onward, which gives maximum control but also maximum responsibility.

The practical mental model is: who touches the card number? With hosted checkout, your server creates a payment or checkout session and the browser leaves your site to pay. With embedded elements, your site displays the payment flow, but sensitive card data goes directly from the provider-controlled component to the provider. With your own card form, your JavaScript and infrastructure handle sensitive payment data, even if only briefly, so you have stepped into a much larger compliance scope.

The common misconception is that PCI compliance only matters if you store card numbers. That is wrong. PCI scope is also about whether your systems can see, transmit, or affect the security of cardholder data. Hosted checkout usually leads to the simplest PCI questionnaire. Embedded provider elements usually keep you in a reduced questionnaire because raw card data bypasses your systems. A fully custom card form generally increases the questionnaire burden and may require stronger controls, audits, and security processes.

After this lesson, you should be able to make a product-and-risk tradeoff. Choose hosted checkout when speed, security, and low compliance work matter most. Choose embedded elements when you need a more integrated user experience while still keeping card data mostly out of your systems. Avoid your own card form unless the business truly needs that control and is prepared for the extra PCI responsibility.

Common questions

What is the difference between hosted checkout and an embedded payment element?
Hosted checkout sends the customer to the payment provider’s page to enter card details. An embedded element keeps the customer on your site, but the sensitive card fields are controlled by the provider, usually inside an isolated frame. Hosted is simpler operationally; embedded gives more control over the surrounding checkout experience.
Does PCI compliance matter if I never store card numbers?
Yes. PCI scope is not only about storage. It also covers whether your systems can view, transmit, process, or affect the security of cardholder data. A site that briefly handles raw card details can still create significant compliance work, even if those details are immediately sent to a payment provider.
When is a custom card form worth it?
A custom card form is worth considering only when the business genuinely needs control that hosted checkout or provider elements cannot provide. It increases responsibility because your front end and infrastructure become part of the sensitive payment path. For most early checkout implementations, the extra compliance and security burden is not justified.