#suren168
1 messages · Page 1 of 1 (latest)
Hi
You can render the Element using the same ClientSecret multiple time. Is this what you are looking for actually ?
not quite what im looking for. I'm trying to just create my own overview with the data that was inputted using address and payment element before I actually submit the payment intent. I am trying to pass input data from the checkout component to review component essentially. i was trying to use getelements and then getvalue but I get null. I was assuming the element wrapper is like a context provider but it doesnt seem to work correctly when im in revieworder but works in the same component where i input the data when i use useelement hook.
my own overview with the data that was inputted
What data exatcly you want to preview ?
all of the address and payment + the items in the cart. I can display the cart fine since thats outside the stripe ecosystem and retrieved on my own server where i use the items to create the total price in the priceintent .
so after i click checkout the checkout form appears with the 2 elements address and payment from stripe. the button will take me from the form to the review component. basically i have a usestate(true or false) to render the review component once you click the button on the form.
im trying to pass the data from form to review component then the button will pay to which i am redirected to the success page.
thats what im trying to do. so checkout > payment and address form > review > success
That's not how Stripe components are working actually, Stripe Element and Address are for completing the payment and not for previewing or collecting.... you need to use them for collecting/previewing and confirming.
you need to use them for collecting/previewing and confirming? I dont quite understand. Is there a way to preview the data? So basically i can only probably collect the address myself (not use address element) and then preview the shipping address and cart items then use stripe pay to finalize the payment?
Is there a way to preview the data?
Nope.
okay i understand. so you mean all 3 have to be done at the same time
Yeap
no problem now i understand a lot more
ill collect the address myself then then only use stripe to pay where i can preview address and cart
then have the pay element on the same page to finalize the order
Yes you can do that I think.
thanks for your help. been trying so hard to get getvalue to work since everything is in an iframe i cant fetch the data. but it makes sense because of security.
yes. Happy to help!