Add a property to buyerJourney to know if 'Pay Now' is pressed

Right now our useBuyerInterceptor will have to call a function to listen to every buyerJourney update, but in reality we only care if ‘Pay Now’ is pressed. We’re using this to fetch live pricing before checking out.

in pseudocode:

  useBuyerJourneyIntercept(({ canBlockProgress }) => {
    return canBlockProgress && !validateCart()
      ? {
          behavior: 'block',
          reason: 'Live prices updating',
          errors: [
            {
              message: 'Please update live pricing',
            },
          ],
        }
      : {
          behavior: 'allow',
        };
  });

Would be cool if we had a property to check so we can return early, or only conditionally run this progress

Hey @ramones :waving_hand: - not sure if this is exactly what you’re looking for, but you could use buyerjourney.steps to grab that info (if you aren’t already):

For example, you could set something up like this, have “finalStep” = steps includes review ? 'review' : 'payment'

Then, only validate the cart, when the active step is returning “final step” based on the step handle including review/payment handles, since these effectively match the last part of the checkout sequence:

This wouldn’t give you the exact time the payment button is pressed, but might work, so I wanted to share in case it’s helpful. That said, it’s not the most ideal for sure, so I’m happy to set up a feature request on my end here too if you’re open to sharing a bit more about your use case - just let me know!

Hey @ramones , following up to see if the above helped or if we can close the thread out? Let me know if I can help out further :slight_smile: