Hi guys! I have a website where I charge per image since I pay for the API, it occurred to me that the best idea and the one most people use is to add credits to each subscription. Weekly 100- Monthly: 1000 - Annual: 10000.
Now, I'm not sure if the logic I applied is correct and recommended! I was reading this package like the Lemon Squeezy documentation to do my best, but I'm a newbie. Here I leave them.
UpdateCredits (adding the credits when the subscription renews automatically and when they go from monthly to annual) is the same as above, except that I put:
use LemonSqueezy\Laravel\Events\SubscriptionUpdated;
DeleteCredits (delete the credits on the day the subscription ends, according to the documentation I understood that the SubscriptionExpired webhook is triggered on the day the subscription ends)
Hey @NicolasMelian. This indeed seems more like a feature request and more something for usage based billing which this package doesn't support yet. Please see https://github.com/lmsqueezy/laravel/issues/55
Lemon Squeezy for Laravel Version
1.4
Laravel Version
10.10
PHP Version
8.3
Description
Hi guys! I have a website where I charge per image since I pay for the API, it occurred to me that the best idea and the one most people use is to add credits to each subscription. Weekly 100- Monthly: 1000 - Annual: 10000.
Now, I'm not sure if the logic I applied is correct and recommended! I was reading this package like the Lemon Squeezy documentation to do my best, but I'm a newbie. Here I leave them.
Create 3 listeners:
Steps To Reproduce
UpdateCredits (adding the credits when the subscription renews automatically and when they go from monthly to annual) is the same as above, except that I put:
use LemonSqueezy\Laravel\Events\SubscriptionUpdated;
DeleteCredits (delete the credits on the day the subscription ends, according to the documentation I understood that the SubscriptionExpired webhook is triggered on the day the subscription ends)
EventServiceProvider:
(I'm sorry, I marked it as a bug without realizing it.)