#zeroes_paymentelement-update

1 messages · Page 1 of 1 (latest)

fathom socketBOT
empty graniteBOT
#

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.

fathom socketBOT
#

👋 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.

quiet marsh
#

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)

lean agate
#

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.

quiet marsh
#

now the flow is, we load the payment element
cool, what do you do exactly. Share exact code related to that

lean agate
#

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.

quiet marsh
#

Okay how do you update the amount exactly like what do you do in code?

lean agate
#

using redux, there is a component to update the amount, and the component host stripe Elements has connection to that store.

quiet marsh
#

Sorry those are words. Please share the exact code you wrote to update the amount

lean agate
#

i think thats why the amount is updated elsewhere, and in option it does not get updated as i didnt use element.update

quiet marsh
#

Gotcha, I thought you were using this at first but when you mentioned redux I realized you likely didn't know that bit

lean agate
#

now it makes sense, so i was like give a default value, and never get a chance to update it😰

#

thank you so much!!!