#Tiaguinho
1 messages ยท Page 1 of 1 (latest)
hi there! that is possible yes, you can have a subscription that bills for multiple different products and combines them all into one monthly invoice. https://stripe.com/docs/billing/subscriptions/multiple-products
Also i ran into a problem yesterday, the webhook handler is crashing on invoice.payment_failed , it happens when you try to finish the checkout, it only sets the subscription id when the checkout session is completed, so i probably should move it to when a subscription is created?
Also how do i know which plan to give to a user?
Like the right way
Im chrcking for the lookup key
I would ignore the invoice in your webhook code if the billing_reason:"subscription_create" since it's being handled inside Checkout.
But the lookup key is only visible from the api
Its not very convenient to configure on the dashboard
not sure I understand, that's your own logic really, you decide what the customer is going to used base on what they pick on your site's code.
you could also use our Pricing Table for your frontend which would simplify things.https://stripe.com/docs/payments/checkout/pricing-table
That pricing table is nice but i already made one from scratch soo
understood
Also I want to make a system that it suspends the plan when some invoices payment fails and only reactivates it once all invoices are paid, i probably know how to do it but im afraid of race conditions
did you have any specific questions about that?
Does stripe retry payments after they fail?
Bcs inonly really want to suspend when stripe gives up
we can, it depends on the settings you configure in https://dashboard.stripe.com/settings/billing/automatic
So how do i know when stripe gives up trying?
well for instance, the change you specify would happen. So if your settings looked like mine, I'd get a customer.subscription.deleted event when the retries are exhausted. If your settings were to "mark the subscription as unpaid"(which seems more like what you'd want for your use case), you'd get a customer.subscription.updated event with the status changing to unpaid
I dont want to cancel the subscription immediately because it has the user's applications, its not very cool to lose everything because you couldnt pay at the moment
The storage is persisted
Hi there ๐ jumping in as my teammate needs to step away soon. You can also check on the Invoice objects as there is a next_payment_attempt field that will be null when no future payment attempts are scheduled:
https://stripe.com/docs/api/invoices/object#invoice_object-next_payment_attempt
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
makes sense. I did say you might want to use "mark the subscription as unpaid" though so I think you're replying to a suggestion I didn't make ๐
gotta run!
Ok thx you helped me a lot
I have just one more question
Is there like some embed to allow the user to manage the payment methods?
I dont really wsnt to program that myself because its highly error prone
And there's lots of caveats and different payment methods i need to handle
No, there is not a prebuilt Element that allows for managing existing Payment Methods. If your flow only allowed your customers to delete existing payment methods or add new ones, then you could use the Payment Element to have a single integration that supports a wide range of payment method types.
Thats pretty much what i want
Does it allow to change the subscription's payment method too?
No, you would need to make the request to update the Subscription's payment method, but that reminds me that there is a prebuilt Customer Portal that may be similar to what you're looking for. I think the drawback for you may be that it's an entire site rather than an embeddable component:
https://stripe.com/docs/customer-management
Now i noticed that apple/google pay is missing on the checkout
Do i need to pass smthng when i create the session?
To enable every method
Bcs its only accepting CCs
And also when we'll be able to use pix? Many people use pix to pay on discloud
Were currently using our old system to do that
Google and Apple Pay are only presented if the prerequisites for those are met, meaning a supported browser/device combination is being used and that there is already a card added to the associated wallet.
What about PIX?
pix is a popular payment method in brazil where the website generates a qrcode/string and the customer scans it on the pix app to pay
This one?
https://stripe.com/docs/payments/pix
Yes
Out of curiosity, could you help me understand how you looked for that documentation? I'm trying to understand how folks search for and through our documentation to see if there are any possible ways we could make it easier to surface the information you're looking for.