Stripe Plugin Error Handling

Great questions. I would need a little more details on the user or payment flows to be able to give more specific answers (especially on when a 402 ERR is being sent), but can try and offer more general insight.

In general, Yes - “When an unhandled error occurs” is probably the most straightforward way to catch errors and handle them manually (instead of browser alerts).

Version 3 of the Stripe Plugin uses the Stripe Checkout experience, which means actions like subscribing the user to a plan or paying for a product happen on a stripe hosted page. As such, error handling will happen on that Checkout page directly (such as an expired card) and the user will only be directed back to the Bubble app on a successful payment.

For automatic payments, like recurring subscriptions, Stripe also has built-in error handling. You can configure these settings in your Stripe Dashboard > Settings > Subscriptions & emails for things like retrying failed payments or notifying the user of a failed payment.

For more custom error handling in Bubble, we recently enabled more thorough error handling within workflows using the API Connector with the option to allow workflows to continue running and expose the error object. In the past, we would simply terminate the workflow if there was an error. If any of your payment flows involve the api connector, this will help give you more control.

Lastly, setting up Stripe Webhooks on specific errors you’d want to handle that might fall outside of the options available in the Stripe Dashboard should give you the most control. API Workflows can be set up to run when a webhook is received to perform whatever action you’d like.

Hope this helps!