#gaskraank-checkout
1 messages · Page 1 of 1 (latest)
I am a bit confused by your ask and what it means. What does using Price and Product have to do with Secret key?
You can do all of that in code
From my understanding Checkout ONLYallows you to have prices or products configured. If you want to do that or just a payment without prices or products, that is all through PaymentIntent
Which requires code
Thanks for the fast answers, what I want to achieve is, creating a variable price in my shopping cart in the Frontend and then do the Payment without providing the Secret Key. So it possible to do it only with the Publishable Key ?
@tight turtle not possible, otherwise anyone can change the price all the time and unless you build a donation platform it doesn't really work well
You always need that call to your server. Though you don't have to create Product and Prices early, you can do this during the Checkout Session creation, we support passing a dynamic amount https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price_data
@upper venture thank you so much for the fast answer, would I always do this through a Backend Microservice? I am calling the API in the checkout shopping cart after successfully finsihing an order and when the customer hits the "pay 34xx$" button the price will be generated via API call. Is there any issue with doing without a backend server model?
no that seems totally fine. You submit your "form", server-side you create the Session with the right price and then you redirect to Checkout directly from the server (it's a full page redirect)