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

Listen to Webhook events #17

Open
knufri opened this issue Jul 26, 2024 · 2 comments
Open

Listen to Webhook events #17

knufri opened this issue Jul 26, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@knufri
Copy link

knufri commented Jul 26, 2024

Description

I'm trying to figure out how to listen to the webhook events. The CheckoutSessionEvent works perfectly. But I would like to create a user in craft after successful subscription via module. I can't find anything in the documentation. Is there a way to react to the customer.subscription.created?

Additional info

  • Craft version: Craft Pro 5.2.8
  • PHP version: 8.2.21
  • Database driver & version: MySQL 8.0.33
@knufri knufri added the bug Something isn't working label Jul 26, 2024
@i-just i-just self-assigned this Aug 7, 2024
@i-just
Copy link
Contributor

i-just commented Aug 8, 2024

Hi, thanks for reaching out! The Stripe plugin is already listening to the customer.subscription.created event (among others) and reacting to it. Technically, listening to the events from your plugin/module is already achievable, but you’d have to do it all yourself - create your own endpoint, listen and react. That being said, I think it makes sense for the plugin to provide an event you can tap into to take the hassle out of it. I just raised a PR for it.

@knufri
Copy link
Author

knufri commented Aug 8, 2024

Hello @i-just,

Many thanks for the quick reply and the associated PR. I really appreciate it. I'm looking forward to when the PR has been merged and I can test the extension. If I understand correctly, you can intercept all webhooks sent by Stripe via the event type?

Greetings Jan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants