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

Fix can't find Subscription from SubscriptionPayment #33

Merged
merged 1 commit into from
Jul 15, 2023
Merged

Fix can't find Subscription from SubscriptionPayment #33

merged 1 commit into from
Jul 15, 2023

Conversation

ycs77
Copy link
Contributor

@ycs77 ycs77 commented Jul 14, 2023

I want to listen to the SubscriptionPaymentSuccess, SubscriptionPaymentFailed, and SubscriptionPaymentRecovered events. Still, it does not work, the $this->findSubscription($payload['data']['id']) always returns null, then I look at my webhooks records and see the SubscriptionPaymentSuccess event's data.attributes.subscription_id same as my database's Subscription lemon_squeezy_id, so this PR is to fix this.

Reference

The SubscriptionPaymentSuccess, SubscriptionPaymentFailed and SubscriptionPaymentRecovered events both are Subscription Invoice object in Webhooks Event types:

screenshot-1

And trace to Subscription Invoice object has the subscription_id field:

screenshot-2

@driesvints driesvints merged commit 4bb87ad into lmsqueezy:main Jul 15, 2023
@driesvints
Copy link
Collaborator

Good find! Thanks. I'll tag this now.

@ycs77 ycs77 deleted the patch-1 branch July 15, 2023 13:15
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

Successfully merging this pull request may close these issues.

2 participants