#yurtdweller_api

1 messages ¡ Page 1 of 1 (latest)

tulip heartBOT
#

👋 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/1405195153336963174

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

hazy rivet
#

You can turn the Stripe emails back on to account for future events. But you can't retroactively send a Stripe email for a Stripe Event that already occurred

#

You'd need to send the email in your custom code

loud kraken
#

OK. I have another question then... I can't seem to replicate how this payment failed in my own staging environment. What test card can I use to replicate how this customer's payment failed?

#

In my staging environment, I can't get past the checkout page with cards because they get declined up front. It seems like somehow this customer got a lot further into the process of being created before the payment failed

hazy rivet
#

You'd have to use 4000000000000341 decline after attaching card

#

So use a setupintent to attach that to the customer

#

And then create the subscription with that card

#

It's the last one in that section

loud kraken
#

That one seems to get declined in the checkout page as well

hazy rivet
#

Are you using a setupintent?

#

You have to attach it first

#

Not accept a payment

#

It gets declined when you try to charge it

loud kraken
#

I'm not sure what setupintent is

#

The checkout page is embedded

hazy rivet
#

To test this scenario you can't use the card to pay

#

You need to attach it to the customer

#

Which is why i suggested a setupintent

loud kraken
#

OK. Is there a way for me to see a list of prior payment_failed events, or would they not have been logged if I didn't have an endpoint listening for it?

hazy rivet
loud kraken
#

Looking through the invoice.payment_failed events, I noticed there are times that the invoice.payment_failed event gets generated but no email is made by stripe because it seems like there is a verification step happening with the payment method.

Is there something in the invoice.payment_failed event that indicates this?

Here is an example event: evt_1RuvoGEXjRBPmDmBvQ979rld. The event before it was payment_intent.requires_action and after the invoice.payment_failed was invoice.payment_action_required

#

In the scenario like this one, if I send an email to the customer that the payment failed while this workflow is happening, what will they see if they click on the customer portal link in the original payment failed email?

hazy rivet
#

You shouldn't send an email in this case

#

Really I recommend listening to payment_intent.payment_failed events and using those instead

#

because those will only be generated if it's a real failure

#

not 3ds

loud kraken
#

It seems like I can't get to subscription information from the payment_intent.payment_failed event?

hazy rivet
#

What do you mean

#

What information are you referring to

loud kraken
#
  • We sell items on a one-time purchase or a subscription basis. We were looking to make custom branded emails for payment failures. The default emails from Stripe about payment failures don't include what the customer was purchasing, so we were looking to be a little more detailed about that. We also use several different "brands" for different websites connected to the same account, so we wanted to be specific about the email addresses and branding around these emails.
  • It seems like with items that are on a subscription basis, we were able to use invoice.payment_failed and reference the invoice to capture details about what they were purchasing (using InvoiceLineItems) to generate this email.
  • Looking at payment_intent.payment_failed, I see that we have payments that fail for the non-subscription items as well. Originally when I was asking about getting more information, I was wondering if payment_intent.payment_failed had a way to access the items being purchased, for which this payment was for.
  • Also it seems like payment_intent.payment_failed events can happen and then recover very quickly, like with this payment_id: pi_3Rv34oEXjRBPmDmB0AGKd99W. So if we send an email on payment_intent.payment_failed, it would be confusing to the customer as it no longer has an actionable step.
  • I guess my question has now become: Is there one definitive, actionable event we can listen to for failed payments that we can use to notify a customer, that does not create confusion?
hazy rivet
#

Do you want emails for failed non-subscription payments as well?

#

Or is the goal to only send them for failed recurring payments

tulip heartBOT
loud kraken
#

I think it depends on what the setting on this page controls: https://dashboard.stripe.com/settings/billing/automatic

"Send emails when card payments fail" and "Send emails when bank debit payments fail"

If I turn these off to avoid duplicate emails, am I turning these off just for subscriptions, or for all failed payments?

night lotus
#

Hi there, I'm taking over from my colleague. Give me a couple of minutes to catch up.

loud kraken
#

Thank you

night lotus
#

If you disable the e-mail notifications for "Send emails when card payments fail" and "Send emails when bank debit payments fail" you'll be disabling them for jut subscriptions.

loud kraken
#

Is there a different place that controls failed payment notifications for one time purchases?

night lotus
#

I don't believe we send e-mails for failed one off payments.

loud kraken
#

If a payment failure occurs on a one-off invoice and Link to a Stripe-hosted page is selected, Stripe sends a link to the Hosted Invoice Page to the customer.

#

Oh it's an invoice

#

Not a failed one off payment

#

I see

night lotus
#

Exactly.

loud kraken
#

OK so to go back to this - if I am trying to send email for payment failure on a subscription, is there an event that is actionable for notifying the customer? It seems like invoice.payment_failed can be triggered during payment verification methods (like in this payment: pi_3RuvoCEXjRBPmDmB1eE258JG) which later got resolved.

Is there an event for failed payments that is more actionable from the perspective of actually notifying the customer?

tulip heartBOT
ornate matrix
#

Hi, taking over as my teammate needs to step away. Let me catch up.

#

For these, you can look at invoice.payment_action_required as well. For those without these events, you can send the email? Otherwise, hold and look for the invoice.payment_succeededevent

tulip heartBOT
loud kraken
#

I'm wondering what kind of payment failed emails get sent by Stripe - say someone needs to authorize their payment with 3Ds wen they first buy the subscription. Then a year goes by, does Stripe email them to reauthorize the subscription?

ornate matrix
#

This is no longer an integration question related to your code, rather you're asking about the content of the email. We do not have the expertise here and you'll need to talk to our support team

loud kraken
#

I guess my main concern is still from an integration standpoint: if I turn off "Send emails when card payments fail" and want to handle those emails myself, am I accidentally turning off any card verification functions?

ornate matrix
#

How would you do that? The email and the 3DS are separate.