#nico-thsler_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
âąď¸ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime!
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1211972141533106276
đ Have more to share? You can add more detail below, including code, screenshots, videos, etc.
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question. Thank you for your patience!
hi! not sure I follow. What "items" are they? what does your existing code look like? What Stripe API do you use to process the payment?
with items i mean products/prices.
I dont think the existing code should be relevant for this question
it is a little, since for example if you process the payment using a raw PaymentIntent, that does not accept Prices/Products
if you're using Invoices or CheckoutSessions, you'd simply pass the Prices/Products to those so I don't see where the issue would be, so I'm overall a little lost on your question
i dont want to process the payment, i just want a calculated total for given products and quantities
so we have our own checkout page, where you can select an amount for some predefined products and we want a "total price preview"
hmm. Can't you just do the multiplication in your code easily? Ultimately the 'shopping cart' is not part of Stripe, it's part of your own e-commerce software
otherwise, you can pass lines to https://docs.stripe.com/api/invoices/upcoming to get a preview Invoice. But to me this is all just logic I'd build in my own site really
well that endpoint doesnt accept recurring prices.. so its not applicable for us
but i will discuss that with my team again, I also think its best to just calculate it by ourself
really it doesn't? I'm fairly certain it does, it's for previewing subscriptions
but yeah I mean I don't understand why you don't just do the multiplication
you say you already have "[your] our own checkout page, where you can select an amount for some predefined products" so the total is just sum(each price * each quantity)
because we want to be 100% sure that the displayed amount is also the amount that is being charged
request ID req_xxx ?
req_kj4aRce8urIz2t
then pass the item to a CheckoutSession and redirect to that and it will show a preview and accept the payment
but its a requirement by our stakeholders to display the total amount in our own page...
you'd use subscription_items instead of invoice_items.
it appears that I cannot input a price that is already existing in that subscription. I need to update the amount of a given price in that subscription and need the total amount before to display it in our checkout.
Request ID: req_4iJyGuvT5HuMR0
I need to update the amount of a given price
What do you mean by 'update the amount'? The unit amount or the quantity?
the quantity, sorry
OK, so the payload of this request (https://dashboard.stripe.com/test/logs/req_4iJyGuvT5HuMR0) is attempting to add a new item. You need to include the id parameter in your payload that maps to the si_xxx ID you want to update the quantity of: https://docs.stripe.com/api/invoices/upcoming#upcoming_invoice-subscription_items-id
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.