Skip to main content
Prevent users from clicking buttons outside the checkout while payment is being processed.

Recipe

How it works

  1. Get a reference to your external button(s)
  2. Listen for the primer:state-change event
  3. Set the button’s disabled property based on isProcessing
The isProcessing flag is unified across all payment methods — when any payment is in progress, it returns true.

Variations

Disable multiple buttons

Add visual feedback

Disable navigation during payment

See also

Show loading indicator

Display a loading state during payment processing

External submit button

Trigger payment submission from outside the checkout component