#adi-webhook-limit

1 messages · Page 1 of 1 (latest)

spark fieldBOT
round trench
#

adi-webhook-limit

#

@stray wasp What's your real question? You shouldn't need many endpoints on an account in most cases. I think our maximum is around 10

stray wasp
#

a client is sending an e-sign doc and asking for payment, over there we are attaching webhook on every payment so after 16 limits it stops the webhooks to get triggerd or attached

#

if the payement succes we are deleting webhook data

round trench
#

Yeah that doesn't really make sense to attach a "webhook on every payment". That's not a thing and that can never work. A WebhookEndpoint is configured to listen to certain Event types and will get all Events of that types

stray wasp
#

ok so plz suggest a method for my query how to handle those

#

there are different clients and each have different amounts

round trench
#

You should have one webhook endpoint that gets all Events related to what you are doing like payment_intent.succeeded. Your database should already know which PaymentIntent pi_123 is associated with with order/payment/customer since you created the PaymentIntent yourself and when your webhook enpoint gets the Event you can look up that PaymentIntent id in your database.
Or you can also use Metadata: https://stripe.com/docs/api/metadata

stray wasp
#

i'm using create product and then create payment link at that time i'm registering webhook with metadata of that user so when the payement succed the webhook request recieved then from that meta data part i'm updating db data of that particular user

round trench
#

Sure but it does not make sense to create a WebhookEndpoint at all in that flow. You're just going to get all Events multiple times. You need one WebhookEndpoint

stray wasp
#

ok can ypu please help me out to handle this via one webhook for different payments

round trench
#

I'm sorry, your asks are super unclear unfortunately. You're only giving a bit of information so I am not sure how else to explain or help you as I've already explained how a WebhookEndpoint works

stray wasp
#

should i share my code here so you can understand the flow

round trench
#

Maybe but you should be able to explain clearly what is blocking you with words

stray wasp
round trench
#

I;m sorry that's a 4 page pdf of code with absolutely not details or context or question.

#

Please, try to explain your overall problem again and explicitly say what the problem is with a relevant 2 or 3 lines of code. Not hundreds.

#

I tried to read the code but honestly don't understand what your webhook endpoint is trying to do or what the problem is

stray wasp
#

im sorry i'll explain in that pdf will update the pdf give me minute

round trench
#

Please don't share yet another PDF

#

I'm sorry that's not really how we help here. This is text based chat, developer to developer. Like you would on Stackoverflow or many forums. You shouldn't need to upload a multi-pages PDF to ask a question about your code

stray wasp
#

createProduct function and productCatalog
Calling this function to create a product when user ask for payment via e-sign doc, by using the details provided by the product we are creating Payement link using paymentLink function

At the same time calling createWebhook function to create webhook and attaching api key and userid details in the metadata of webhook so that when we get succes from the webhook event in checkoutSession function we get metadata stored in webhook and can update respective user data by using that userid stored in metadata

#

i'm sorry for inconvenience

round trench
#

Sure but I already explained it doesn't make sense to create a new WebhookEndpoint every time. I explained this three times already. So can you explain what you don't understand here? I definitely see there's something that isn't "clicking" yet but I don't get what part so I'm not sure how to explain it differently.

Like as a developer, you have one WebhookEndpoint that will get all payment-related Events. Every time a Customer pays for something you will get an Event such as checkout.session.completed and then your code reacts to that Event by looking up relevant information it cares about.

You should never be creating a WebhookEndpoint for every payment, that doesn't really make sense

#

If you can try and explain what you don't understand about that part, that should help me frame it differently

stray wasp
#

ok thanks, there is one part i'm not getting that is if i use one webhook then how will i differentiate that for which users payment it is and how should i update that users data in the DB

#

this is the main issue

round trench
#

You can set payment_intent_data[metadata] (docs) on your PaymentLink so that the payment_intent.* Events will get the right metadata on it for reconciliation?

Technically the way you are using PaymentLinks is quite wrong. Those aren't supposed to be "one-time url for one customer". They are supposed to be re-usable for many customers like to sell a book for $10 to everyone on twitter or something

stray wasp
#

ok thanks for the help i'll go through one more time my integration

round trench
#

Does my recommendation with metadata solve your problem?

#

This means that the metadata on your PaymentLink are already on the Checkout Session so we're back to me asking what the issue is

stray wasp
#

i'll update my code with your suggestion and will update you

round trench
#

but you shouldn't need to update anything since you are already setting metadata on the PaymentLink which already pipes to the Checkout Session which your webhook handler already reads.
I'm sorry, just we're back to square one right now. I think the next step is you explaining with a concrete example of an exact Event that is not showing what you need at this point