#akashpatil7596_webhooks

1 messages ¡ Page 1 of 1 (latest)

vocal roostBOT
#

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

📝 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.

pure shell
#

Hi, let me help you with this.

#

Why is it supposed to go to paid?

slate arch
#

Yes

#

As soon as invoice creates I wants to finalize it and get paid

pure shell
#

Basically, you're asking why it takes ~24h for the Invoice to attempt to charge the customer?

slate arch
#

Yes

#

In my code as you can see I manage that as soon invoice.created it gets finalized

Still on 3rd and 4th may it went to open

pure shell
#

This is to ensure your app acknowledges the Invoice creation, in case you need to make any changes to the Invoice.

slate arch
#

So what to do? I want to finalize it as it gets created

pure shell
#

I am not sure what you mean. Finalization turns a draft Invoice into an open Invoice. After that the payment needs to be collected for it to turn paid.
It all happens automatically, but not immediately, to give you time to make changes to the draft Invoice.

#

What is exactly the issue you're facing with this?

slate arch
#

Finalization turns a draft Invoice into an open Invoice

No finalize should be turns a draft into paid

slate arch
pure shell
vocal roostBOT
pure shell
slate arch
#

So what to do for pay instantly

pure shell
slate arch
#

I do the same, as you can see in my code, still the invoice draft went to open?

pure shell
#

Do the same as what exactly?

slate arch
#
if (data?.type === 'invoice.created') {
          const isSubscriptionExist = await this.subscriptionRepo.isSubscriptionExist(data, transaction);

          if (isSubscriptionExist) {
            await this.stripeService.finalizeInvoice(data?.data?.object?.id);
          }
}

async finalizeInvoice(invoiceId: string) {
  try {
    return await this.stripe.invoices.finalizeInvoice(invoiceId);
  } catch (error) {
    logger.error('error', error);
    throw new HttpException(500, 'SOMETHING_WRONG', error);
  }
}
austere tapir
#

Hey! Taking over for my colleague. Let me catch up.

austere tapir
slate arch
#

04 May : in_1RKz9qAGlCdR56ap7AgP4bvd

03 May : in_1RKcgdAGlCdR56apAH9v53ve

These two invoices after they are created went into open not paid, I want to go to paid after created

austere tapir
#

Thanks for sharing these two invoices. Firstly, these invoices were paid automatically

#

These are a result of a Subscription, right?

slate arch
#

Yes, but it took time to get paid like 1-2 day, until that they were open and not paid

austere tapir
#

Usually invoices are finalized and paid automatically after 1 hour from creation

slate arch
austere tapir
#

For that, all your webhook endpoints needs to respond successfully to the event evt_1RKz9rAGlCdR56apNxnIUxXq

austere tapir
#

Here it tools 1-2 days, because your webhook failed to responde to Stripe

#

Same for this event https://admin.corp.stripe.com/notification/evt_1RKz9rAGlCdR56apNxnIUxXq

slate arch
austere tapir
#

Let's stop sharing the same message multiple time please, we have access to the full conversation.

austere tapir
#

You need to fix this webhook endpoint in particular we_1RHk7BAGlCdR56apLtDPVICv

slate arch
#

Okay thanks let me check

austere tapir
#

Between, it responded with 404

#

Make sure, that you have this endpoint set /api/v1/webhook/stipe

slate arch
#

ok let me check

#

thanks

#

Hey wait

#

my webhook endpoint is : whsec_J7ZkhGlBjhEG6UjXi9892xor1WJwjcVh not we_1RHk7BAGlCdR56apLtDPVICv

austere tapir