#samip_webhooks
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/1326014683433402378
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi, to further clarify my question. We use two different billingPortal sessions - one which the customer can use to subscribe to the product and the other billingPortal which the customer can use to upgrade to a product of a higher tier.
When a customer uses the billingPortal meant for an upgrade and uses a payment method that does not have sufficient funds in it and ends up getting declined, I want to void the invoice that was created since we do not want to retry the same invoice as it could have been a one time intent from the customer.
you would probably want to listen for the invoice.payment_failed event : https://stripe.com/docs/billing/subscriptions/webhooks#events and check the billing_reason for subscription_update : https://stripe.com/docs/api/invoices/object#invoice_object-billing_reason
You'd want to test this out throughly to make sure it works as expected though
Hi , we are using the invoice.payment_failed event already. However, if I understand it correctly, the billing_reason would be subscription_update even if it is a recurring payment right ?
For example : A customer can setup a month-to-month subscription with us and they could have their card declined in the 3rd month, we would still receive invoice.payment_failed with the billing_reason set to subscription_update ?
This makes it a bit difficult to distinguish from another customer who has tried to upgrade to a higher value product but has failed to make a payment ?
for a subscription renewal a.k.a recurring payment, it should be subscription_cycle , like our docs mention, this is when a subscription advances into a new period.
in case you haven't seen this yet, you can use test clocks to mimic the passing of time : https://stripe.com/docs/billing/testing/test-clocks