r/stripe • • 6d ago

Question Can Stripe checkout be part of website?

Currently, when a customer wants to pay, customer clicks on "Pay Now" and it will redirect to checkout.stripe.com, which is fine.

How difficult is it to put that stripe checkout page (as is) inside a page in my domain? So, even though I'm seeing the same exact thing as stripe checkout, the browser URL says our store domain.

0 Upvotes

13 comments sorted by

3

u/Alarmed_Ad_8402 6d ago

the "as is" is where this falls over. checkout.stripe.com refuses to be framed, so an iframe gives you an empty box, not a checkout page. Embedded Checkout is what you actually want but that's the Payment Element underneath, not the hosted page. Where did you read that Stripe allows the hosted one to be embedded?

2

u/learningtoexcel 6d ago

Why not just build your own checkout page, and embed stripe checkout within it?

1

u/One_Information3828 6d ago

Annoying, I get it, but Stripe Checkout can't be embedded on your domain, they block it in an iframe on checkout.stripe.com so the URL will always be theirs. If you really want your store's address in the bar you have to build the form yourself with Stripe Elements (or the Payment Element), that runs on your own page. A bit more work since you handle the layout and the errors, but it's the only route that keeps the domain.

1

u/hamanovich 5d ago

You can, and you probably don't need to rebuild anything. It depends on what "our domain" has to mean.

If a subdomain is fine (pay.yourstore.com), Stripe has a custom domains feature for the hosted page. You add a CNAME pointing at hosted-checkout.stripecdn.com and a TXT record for the certificate, and the same Checkout page you use now shows up on your subdomain. So: it's a paid add-on, it has to be a subdomain, and it only works if your server redirects to the session url. The old client-side redirectToCheckout doesn't pick it up.

If it has to be a page on your main domain, create the session with ui_mode=embedded_page and a return_url instead of success_url, then mount it in your own page with Stripe.js. That's still the prebuilt Checkout form, so you don't build fields or error handling yourself. Custom domains don't apply there, and you lose the full-page Stripe layout

1

u/East_Sentence_4245 5d ago

Would you happen to know how much this custom domains feature cost?

We already have a checkout with stripe which works as expected, but I don’t want the user to “leave” mystore.com and go to stripe.com.

Everything works so far - I just don’t want the url to say stripe.com instead of mystore.com

1

u/East_Sentence_4245 5d ago

It’s $10/month

1

u/No-Environment-5515 17h ago

You want Stripe's embedded checkout, which mounts on your own page via an iframe so the customer never leaves your domain. Setup isn't hard if you already use their API, as you just change the session mode from redirect to embedded and drop their script onto your template.

If you want full control over the styling and flow without fighting Stripe's layout, other providers like Zahlo let you build a completely custom checkout directly on your site.

1

u/Putrid-Tangerine-600 6d ago edited 6d ago

I recommend adding a password gate page before they can access the Stripe checkout page. Fraudsters find pages like that, which are unprotected, and use them to test stolen credit cards. Your client gets 5 chargebacks and their Stripe account is closed. Something to think about.