Skip to content
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

name/email changes are not synchronized between supabase and stripe #362

Open
cgar420 opened this issue Aug 5, 2024 · 5 comments
Open

Comments

@cgar420
Copy link

cgar420 commented Aug 5, 2024

When you change the customers name or email on the /account page, it updates in Supabase, NOT in Stripe.

When you change the customers name or email on the Stripe dashboard, it sends a Webhook, but the response is always 400.

image

customer.update events are not part of relevantEvents and return a 400 error.

image

So its a combination of 2 problems:

  1. We are updating the customer info on Supabase instead of Stripe - updating on Stripe will trigger webhook
  2. We are not handling the customer.update webhook
@t6tv8e
Copy link

t6tv8e commented Aug 14, 2024

That's not per se an issue with this repository, but rather something you could implement yourself.

@cgar420
Copy link
Author

cgar420 commented Aug 14, 2024

That's not per se an issue with this repository, but rather something you could implement yourself.

If the repository instructions say to turn on every webhook, and then returns an error for most of them, that's an issue imo.

There are some options to fix:

  1. only instruct to enable the relevant events

  2. return a 200 even for the ones that aren't relevant

  3. add integration for more webhooks into the template

@cgar420 cgar420 closed this as completed Aug 14, 2024
@cgar420 cgar420 reopened this Aug 14, 2024
@jcarioti
Copy link

@cgar420 seems like modifying the user directly in Stripe and then implementing the customer.update webhook would be the cleanest approach, right?

@cgar420
Copy link
Author

cgar420 commented Sep 23, 2024

@cgar420 seems like modifying the user directly in Stripe and then implementing the customer.update webhook would be the cleanest approach, right?

That's what I ended up doing for my project

@jcarioti
Copy link

Great, that's exactly how I'm implementing it now. Just curious, though, are you modifying the users table directly or are you modifying auth.users like the original template was?

I noticed that auth.users.full_name and users.full_name weren't staying in sync, so I added this db trigger: #311 (comment), but now I'm realizing that modifying auth.users from a webhook context is kinda difficult.

I'm curious how you did it if you're willing to share.

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

No branches or pull requests

3 participants