You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on an app where I have to save the current_period_start and current_period_end after I create a StripeSubscription. Right now I do it by calling Subscription::asStripeSubscription() after SubscriptionBuilder::create() and pulling the info I need from there. However that is another call to the Stripe API and I'm thinking it could be avoided by allowing the extraction of extra info after the first API call. Perhaps a Closure that would take in the new StripeSubscription object and would return an array, which then can be merged with the other info before the Subscription is persisted to the database...?
I'm not sure what the best solution would be or even if this is needed all that often, being that this is my first project that requires it.
The text was updated successfully, but these errors were encountered:
Hi there. At the moment we aren't considering adding these database columns to Cashier. I'm afraid retrieving them from Stripe is the only way. You could overwrite the Cashier models if you want (see the docs) or consider implementing caching.
I understand, but that is not what I was asking. I already created all the extra columns I need. I was talking about a mechanism that would allow me to tap into the newly created Stripe Subscription, inside the SubscriptionBuilder::create() method, to avoid making an extra Stripe API call. No worries though. Thanks.
I'm working on an app where I have to save the
current_period_start
andcurrent_period_end
after I create aStripeSubscription
. Right now I do it by callingSubscription::asStripeSubscription()
afterSubscriptionBuilder::create()
and pulling the info I need from there. However that is another call to the Stripe API and I'm thinking it could be avoided by allowing the extraction of extra info after the first API call. Perhaps aClosure
that would take in the newStripeSubscription
object and would return anarray
, which then can be merged with the other info before theSubscription
is persisted to the database...?I'm not sure what the best solution would be or even if this is needed all that often, being that this is my first project that requires it.
The text was updated successfully, but these errors were encountered: