Initial implementation relied on a shopping cart library which causes issues when you have two different checkout forms open for the user (since cart is stored in the browser, this happens when the user opens a new page with a form in a new tab etc.)
New implementation relies on the backend for totals, taxes, currency, quantity calculations etc.. Instead of sending the cart to the payment intent generation api, we send the assets list for the given checkoutform (which is, incidentally the exact same data for our use case).
Where this differs from the previous implementation is instead of using the cart data for
listing assets in the summary
showing total and currencies
we use the response from the backend. small hassle is asset name etc. was kept in the local storage before, now we need to use useAsset
Initial implementation relied on a shopping cart library which causes issues when you have two different checkout forms open for the user (since cart is stored in the browser, this happens when the user opens a new page with a form in a new tab etc.)
New implementation relies on the backend for totals, taxes, currency, quantity calculations etc.. Instead of sending the cart to the payment intent generation api, we send the assets list for the given checkoutform (which is, incidentally the exact same data for our use case).
Where this differs from the previous implementation is instead of using the cart data for
we use the response from the backend. small hassle is asset name etc. was kept in the local storage before, now we need to use
useAsset