#naren_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ 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.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always 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/1296268685836816489
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
here's the backend code i tried out (but doesn't work)
hello! sorry i'm a little confused, what doesn't work specifically for the above code snippet you shared?
what does a stripe checkout bar mean? Can you share a screenshot?
If you're using a PaymentIntent, the Payment Element is used only to collect the payment method details. The Payment Element itself doesn't display the payment amount and currency. It's up to you to build the logic to display the payment amount and currency on your own site.
i mean the floating bar that shows up when i call presentPaymentSheet in the frontend
ah, so you're using our React Native SDK?
yes i am
are you following this guide? https://docs.stripe.com/payments/accept-a-payment?platform=react-native
if so, can you share the rest of your code snippets?
yes i am. here's most the code
once i click a button, i call openPaymentSheet to trigger the pop up
can you log data? and share what's the output?
wait a sec i just found what's wrong. i was testing with indian ruppees and they were worth too less for the transaction
i want to charge different amounts for different currencies. will i have to hard-code set prices on the client?
like i make a dictionary of locations and amounts and just get that info directly
like i make a dictionary of locations and amounts and just get that info directly
pretty much, yes
i wouldn't hardcode it on the frontend though, this list should be stored on your backend
oh ok. what if i want to charge the user based on the number of events they selected on the frontend? since we're already calling initializepaymentsheet on the first state which sets the price, how can i alter this price to reflect the users selection later on?
wait can i actually init payment sheet only when the user clicks checkout?
you should be presenting the payment sheet only when the user clicks on checkout
it might take longer to load but is that the way?
should i also only initpaymentsheet and call the backend when checkout's clicked?