#mildiemilk_subscription-failed-sepa

1 messages Β· Page 1 of 1 (latest)

gritty egretBOT
#

πŸ‘‹ 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.

twin jay
#

hellooo

timid badge
#

Hi

twin jay
#
          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
gritty egretBOT
timid badge
#

I understand that you want to retry a Payment related to a Susbcription ?

twin jay
#

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 😭

timid badge
#

You retreive the latest invoice fo the Subscirption and retry the payment if you want.

twin jay
#

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)

summer cove
#

hi there!

twin jay
#

ummm, I've integrated with the customer portal session that provided from stripe

summer cove
#

that works too, yes

twin jay
#

yes 😁 and how to retry the failed payment for SEPA with the latest default payment method?

twin jay
summer cove
twin jay
#

okayyy, I'll try with this way

#

thank you so much @summer cove @timid badge πŸ™

summer cove
#

happy to help πŸ™‚

twin jay
#

and how about managing my subscription when it was auto-canceled for the first failed payment? what if the second retry is successful?

summer cove
#

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.

twin jay
#

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

summer cove
#

that could work. but why are you auto-cancelling the Subscription in the first place?

twin jay
#

not me but stripe auto-canceled the Subscription when got failed payment πŸ₯Ί

#

Isn't it?

summer cove
#

you mean the very first payment of the subscription, or a recurring payment?

twin jay
#

very first payment

summer cove
#

got it. then yes your suggestion makes sense (creating a new subscription)

twin jay
#

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

gritty egretBOT
summer cove
#

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.

gritty egretBOT
#

mildiemilk_subscription-failed-sepa

tawny dew
#

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

Automatically retry failed payments and reduce involuntary churn.

twin jay
#

Ah I seee, okay will try on the way we discussed