#zeroes_paymentelement-update
1 messages · Page 1 of 1 (latest)
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- zerozero00_docs, 6 days ago, 5 messages
👋 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/1253376081902174310
📝 Have more to share? Add details, code, screenshots, videos, etc. below.
zeroes_paymentelement-update
@lean agate Are you passing a PaymentIntent client_secret to Elements? Like what is your exact integration path (there are dozens of ways to integrate Stripe)
no, i dont pass client_secret to elements. now the flow is, we load the payment element, and when submit the form, it will create payment method, and we pass it to our server, and it will create payment intent and get client_secret, and confirm payment afterwards.
now the flow is, we load the payment element
cool, what do you do exactly. Share exact code related to that
in the option: { mode: 'payment',
amount: parseFloat(store.get('amount'), 10) *100,
currency: business.get('base_currency').toLowerCase(),
paymentMethodCreation: 'manual', }
<Elements stripe={ stripeObj } options={ stripeOptions }>
<StripeElementsForm
amount={ store.get('amount') }
/>
</Elements>
and for the stripe elements form, its bascially payment element and adress element and a field that i can update the amount to pay
when i update the amount, Elements is supposed to re-render.
Okay how do you update the amount exactly like what do you do in code?
using redux, there is a component to update the amount, and the component host stripe Elements has connection to that store.
Sorry those are words. Please share the exact code you wrote to update the amount
You need to use https://docs.stripe.com/js/elements_object/update#elements_update-options-amount explicitly
i think this is exactly what i am looking for😁
i think thats why the amount is updated elsewhere, and in option it does not get updated as i didnt use element.update
Gotcha, I thought you were using this at first but when you mentioned redux I realized you likely didn't know that bit