#mildiemilk_subscription-failed-sepa
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/1290280215762829424
π Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- mildiemilk_api, 4 days ago, 9 messages
- mildiemilk_api, 4 days ago, 12 messages
- mildiemilk_webhooks, 5 days ago, 36 messages
hellooo
Hi
const customer = await stripe.customers.retrieve(
paymentData.customer_id
)
const defaultPaymentMethod =
customer.invoice_settings.default_payment_method ||
paymentData.payment_method_id
const invoice = await stripe.invoices.retrieve(paymentData.invoice_id)
const amountDue = invoice.amount_due
const paymentIntent = await stripe.paymentIntents.create({
amount: paymentData.amount,
currency: "eur",
customer: paymentData.customer_id,
payment_method_types: ["sepa_debit"],
payment_method: defaultPaymentMethod, // Reuse the same SEPA mandate
confirm: true,
off_session: true,
metadata: {
subscription_id: paymentData.subscription_id, // Store the Subscription ID in metadata
invoice_id: invoice.id,
},
})
I've tried to retry the failed payment with this code but it seems not working as I expected
- got new transaction
- BUT no any updated from the previous subscription that I want to retry the payment
I understand that you want to retry a Payment related to a Susbcription ?
yes
retry the failed payment for SEPA method
as far as I know, stripe doesn't handled the auto retry failed payment for the SEPA method, right?
so I've to create the logic manually π
You can retry the payment by calling this endpoint :
https://docs.stripe.com/api/invoices/pay
You retreive the latest invoice fo the Subscirption and retry the payment if you want.
what if user update the payment detail ? can I retry with the new payment detail?
for example
if it was failed because of some issue of the IBAN number so user has to update their detail first then the retry logic will proceed after 3 days once got the webhook failed (as I already done this logic for the delay schedule)
hi there!
if you want to collect a new payment method for the invoice, the simplest option is to send the user to the hosted invoice URL: https://docs.stripe.com/api/invoices/object?lang=node#invoice_object-hosted_invoice_url
ummm, I've integrated with the customer portal session that provided from stripe
that works too, yes
yes π and how to retry the failed payment for SEPA with the latest default payment method?
here is what I've tried but I found that the new transaction was created BUT no any updated from my subscription that I want to retry the payment
when you call the /pay endpoint you can set a payment_method https://docs.stripe.com/api/invoices/pay
happy to help π
and how about managing my subscription when it was auto-canceled for the first failed payment? what if the second retry is successful?
if a subscription is cancelled, then there's not much you can do except re-create a new subscription.
you cannot "reactivate" a cancelled subscription.
ahhhh, so that mean in my case, I don't have to pay the previous invoice
The step for retry the SEPA failed payment should be
- Create new subscription (as the previous was auto-canceled when first failed payment)
- Create new invoice for new subscription
- Pay new invoice
am I correct? please advice
that could work. but why are you auto-cancelling the Subscription in the first place?
not me but stripe auto-canceled the Subscription when got failed payment π₯Ί
Isn't it?
you mean the very first payment of the subscription, or a recurring payment?
very first payment
got it. then yes your suggestion makes sense (creating a new subscription)
but something's weird, I've compared the logic from failed payment between SEPA and Card that there is the smart auto-retried failed payment from card method that Stripe provided
The subscription for card, if it failed in the first place, it will not auto-canceled then after smart retried proceed, we can still use the same subscription without creating a new one
the automatic doesn't apply to the very first payment of a Subscription, it's only for the recurring payments. and it's only for card payments.
mildiemilk_subscription-failed-sepa
Hi there π jumping in as my teammates need to step away soon. I did want to confirm that you are correct, we don't retry subscription payments for SEPA (and some other bank debit payment methods) due to the fees that banks can charge customers for those:
https://docs.stripe.com/billing/revenue-recovery/smart-retries#:~:text=To avoid bank fees%2C Stripe βdoesnβt retry invoice payments that customers made with bank debit methods including%3A
Ah I seee, okay will try on the way we discussed