Closed mishabachkur closed 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.
@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.
@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
Genius.
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?