#Tiaguinho

1 messages ยท Page 1 of 1 (latest)

shut parrotBOT
timid wedge
hollow tulip
#

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

timid wedge
#

I would ignore the invoice in your webhook code if the billing_reason:"subscription_create" since it's being handled inside Checkout.

hollow tulip
#

But the lookup key is only visible from the api

#

Its not very convenient to configure on the dashboard

timid wedge
hollow tulip
#

That pricing table is nice but i already made one from scratch soo

timid wedge
#

understood

hollow tulip
#

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

timid wedge
#

did you have any specific questions about that?

hollow tulip
#

Does stripe retry payments after they fail?

#

Bcs inonly really want to suspend when stripe gives up

timid wedge
hollow tulip
#

So how do i know when stripe gives up trying?

timid wedge
#

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

hollow tulip
#

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

primal seal
#

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

timid wedge
hollow tulip
#

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

primal seal
#

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.

hollow tulip
#

Thats pretty much what i want

#

Does it allow to change the subscription's payment method too?

primal seal
#

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

Manage customer relationships with your business.

hollow tulip
#

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

primal seal
#

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.

hollow tulip
#

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

primal seal
hollow tulip
#

Yes

primal seal
#

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.