laravel / cashier-paddle

Cashier Paddle provides an expressive, fluent interface to Paddle's subscription billing services.
https://laravel.com/docs/cashier-paddle
MIT License
245 stars 57 forks source link

Disable generic trial once customer is subscribed #221

Closed haszzam closed 10 months ago

haszzam commented 10 months ago

Hi,

I'm trying to signup users with a free trial without payment upfront (Generic Trial).

But currently when a customer subscribe to a plan the generic trial is not disabled.

So $request->user()->onTrial(); and $request->user()->onGenericTrial(); still returns true even after the user is subscribed to a plan.

This causes some issues when you try to perform certain actions when the user is on trial.

I checked the handleSubscriptionCreated webhook handler and it's not doing anything to disable the generic trial, I think adding something like this $billable->update(['trial_ends_at' => null]); to the handleSubscriptionCreated handler should fix this issue.

Thanks!

driesvints commented 10 months ago

Thanks! I've sent in a PR for this: https://github.com/laravel/cashier-paddle/pull/222