#snblackwell_api
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.
🔗 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/1255227631784169602
📝 Have more to share? Add details, code, screenshots, videos, etc. below.
Hello! No, you can't remove the quantity from the UI. Why are you doing quantities like that? Maybe I can recommend a better approach?
please do recommend. we went this path becuase without it, the totals show up as thousands more than intended and woudn't process the decimals needed.
it would round the total up or down to the nearest whole dollar
My mistake, it would round up (not down). So this charge would be $52 in stripe but in my database, it would accurately reflect the $50 charge and the $1.80 stripe fee the client is opting to pay (in this particular transactio).
Sorry, I don't understand. My question is why are you charging by doing a large quantity of a 1¢ item?
Why not specify the total price as a single item instead?
Like in that example, you're charging 1¢ with a quantity of 5,180. Why aren't you charging $51.80 with a quantity of 1?
that would be ideal. but from what I've seen and been shown, the payment intent line of the stripe checkout session won't read the decimals of the actual charge. In other area of my app with payments, that input is multiple by 100 to get what we need. But everything in that transaction involves whole dollars so it worked.
better explanation, we don't have set priced product. we need a dynamic amount ot be charged
I'm not sure I understand. Checkout supports prices with cents just fine. When you create a Checkout Session you can provide ad-hoc Price and Product info using price_data: https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-line_items-price_data
So, for example, try creating a Checkout Session with line_items.price_data.unit_amount set to 5180 and, if the currency is USD, it should be $51.80.