#react-stripe-js PayButtonElement

4 messages · Page 1 of 1 (latest)

quaint knot
#

A little pre-face medusajs v2 stripe integration and medusajs nextjs starter are built on the older packages for stripe - these use the PayButtonElement vs the new ExpressCheckoutElement. Below i've created a temp working ExpressCheckout component.

  1. I am experiencing an issue where the button is displayed in places prior to any shipping_address being added to the cart, thus when the button is pressed it auto adds the address provided by the express checkout method (applepay/googlepay/klarna/etc). This then triggers the cart to update any applicable tax, cart get's successfully updated but the applepay session never updates.
  2. what is the best method to solve this so it updates the PayButtonElement with the new data - is a forced re-render the only solution here?
strange kiln
#

They way we implemented a similar flow with stripe is to only load the payment-component after both user-info-component and the shipping-method components have been completed.

Might be the best path forward for ya if you haven't tried that yet.

quaint knot
# strange kiln They way we implemented a similar flow with stripe is to only load the payment-c...

This methodology defeats the express checkout. My current version above works, just uix experience on applepay is a little weird. If there is a cost for shipping/taxes it updates cart correctly and if you try to process original amount it will fail. then when it reloads it has the correct payment amount.

If no change in tax/shipping it processes successfully and pulls all details from the paybuttonelement

strange kiln
#

I see, sorry I misunderstood that part. Unfortunately we don't use an express checkout feature. Hopefully you get more feedback, good luck!