laravel / cashier-stripe

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.
https://laravel.com/docs/billing
MIT License
2.39k stars 679 forks source link

Add support pricing except plan #1121

Closed mishabachkur closed 3 years ago

mishabachkur commented 3 years ago

Cashier used to fill stripe_plan from product name, which is a readable name and is the same on all environments. However, when subscribing to Stripe’s plan “price”, you get a Stripe generated ID of that price written to stripe_plan of the subscriptions instead of a readable string. Accordingly, without an additional stripe request, it is impossible to extract the readable name. Is there a solution or is it planned to add filling of price.lookup_key/product.name in the subscriptions table?

driesvints commented 3 years ago

a readable string

Not sure what you mean by that. Stripe's plan and price ID's both work fine in API requests. Readable names for Plan's have been deprecated for a while. In the near future most "plan" references will be removed from Cashier Stripe in favor of Stripe's new Price API.

oprypkhantc commented 3 years ago

@driesvints Okay, but what's the proposed way to add logic per plan? Imagine you have "standard" and "advanced" plans, each having it's own feature set. How do you check if user with plan "pric_hasdha7123" has the feature of "advanced" plan or not, without making an additional request to Stripe?

Something like a lookup_key of Stripe's Price object could be utilized, but it's currently not stored on Cashier's side.

driesvints commented 3 years ago

@oprypkhantc handling application logic based on a plan or price is something that's done in userland and not in Cashier. You can either try one of the below support channels or check into Laravel Spark: https://spark.laravel.com

Thanks

oprypkhantc commented 3 years ago

Genius.