#neha_best-practices
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1397612421392109692
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there,! You may be able to achieve this using Customer portal flows [0]. Essentially not giving the customer the ability to confirm the update to subscription (subscription_update_confirm) until after a specified amount of time.
[0] https://docs.stripe.com/customer-management/portal-deep-links?lang=node
You'll have to build the delay logic yourself though.
ooooh very interesting
so they don't go to the normal customer portal
they go to a one off flow?
and as such, should i turn off "update subscriptions" in my settings? as it will be programatically triggered?
i want them to use the normal customer portal for updating their payment method + cancelling
so just trying to understand (1) how these UI settings affect the flows, if at all and (2) if flows are all-or-nothing (meaning i have to use the regular customer portal in entirety, or i have to split each functionality into a flow)
seems all or nothing
and like each flow respects the UI settings
I don't believe customer flows are all or nothing. Let me double check.
like if i want to rate-limit upgrades, seems like i can't expose the "normal" customer portal elsewhere
bc that's a bypass
i have to parcel out each fn: update subscription, update payment method, cancel
but then how does the customer view their invoices?
these are the four features i use:
update payment info
view invoices
update subscription (with rate limit)
cancel subscription
so let me know
Ok, thinking about this. You may be able to achieve what you're looking for by managing the customer portal configuration [0]. You can have a configuration that allows updates to the subscriptions and one that does not. And you can then listen for webhook events and use that information to determine when to switch from one configuration to another depending on a set time.
[0] https://docs.stripe.com/api/customer_portal/configurations/object
but isn't the config global?
across all customers?
the rate limit would be customer-by-customer
is there another way for the customer to view their invoices?
i noticed that the invoices don't show one-off payments
just subscription payments
The config is global, the portal session is not.
When you create the customer portal session for the customer, you can specify the config to use.
interesting
is there any way to create the configs via the Stripe UI
or do i have to do it programatically
You'll need to do this programatically.
and i can't see or manage the configs in Stripe?
That is correct.
the flows seemed easier tbh
is there another way for the user to view their invoices?
okay meanwhile i have another question
i want to (eventually) set up a fixed fee + overage model
https://docs.stripe.com/products-prices/pricing-models
i can't find any dev-focused tutorials and i'm unsure about:
- how users see their usage at any given time (am i supposed to store a copy, or do i make a call to stripe)
- if i have a price ID now that's just fixed, can i tack on the overage fee later or do i have to make a new price ID?
- i have an "unlimited" plan with a fair usage policy, trying to figure out if it makes sense to use stripe meters for this too
Hi, taking over as my teammate needs to step away. Let me catch up.
ok
is there another way for the user to view their invoices?
If you do not use the Customer Portal, you can build this on your end. You can listen to the invoice created event, and then store that data to surface to the customer.
i want to (eventually) set up a fixed fee + overage model
https://docs.stripe.com/products-prices/pricing-models
how users see their usage at any given time (am i supposed to store a copy, or do i make a call to stripe)
if i have a price ID now that's just fixed, can i tack on the overage fee later or do i have to make a new price ID?
You can store that information on your end. As you scale, making GET calls will impact your rate limits: https://docs.stripe.com/rate-limits
You will need to create a new price for a different pricing model. There is not an 'overage' concept for a fixed price.
Let me know what questions you may have on the above
I don't want to do a custom portal solution
That's what I have now and it's a nightmare
I want to use the real customer portal. What's wrong with the "flow" solution described above, or the "config" solution?
The ONLY thing I'm trying to do is rate limit the updates & prevent abuse
You can use the Customer Portal
You can pass the cusotmer portal configuration to each Customer portal session as my teammate described above
Okay so that's the preferred implementation
Not the flows?
Can you please send me a dev guide for setting up "fixed fee + overage"
I understand the APIs involved but a tutorial would be great
Also I still dont' understand how I'm supposed to surface metered usage to the customer
Would that be in the customer portal?
You could: https://docs.stripe.com/customer-management/portal-deep-links#what-is-a-flow
That is really up to you.
But if I do the flows
Then the customer cannot hit the regular customer portal
Since that would let them bypass the rate limit
Right?
I do not know what you mean by the regular customer portal. You should test this end to end to see which one works better for you