Skip to content

Proper error handling/return code. #666

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

d8ahazard
Copy link

When Stripe sends an event to the webhook that this Stripe Payments Firebase extension creates (e.g. "https://us-central1-abcdefg.cloudfunctions.net/ext-firestore-stripe-payments-handleWebhookEvents"), and if an error happens, then the code returns to Stripe a success http status code (200). This is problematic because Stripe thinks that the webhook succeeded.

When the webhook fails with an example error message "An error occurred with our connection to Stripe" (like in my case), then I would rather Stripe know that it failed with the 500 internal server error status code so that it can properly do a retry process, rather than swallow it and forget about it. Without this PR code change, I would have to not use the extension, and write my own event handlers so that I can properly handle errors on the Stripe side of things.

The logic should ideally be:

  1. Error happens -> Tell Stripe it was an error with an error status code like a 500.
  2. Error doesn't happen -> Return a 200 success status.

This addresses that.

image

@CLAassistant
Copy link

CLAassistant commented May 20, 2025

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants