#kenehermitcoder

1 messages · Page 1 of 1 (latest)

bright jacinthBOT
#

Hello! We'll be with you shortly. 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.

grim oar
#

Hi, let me help you with this.

#

You can only filter by event types. But not specific objects.

#

You will have to create the logic on your own. E.g. add a metadata field, and then each webhook listeners will filter out the PaymentIntents that contain metadata relevant to them.

frank stirrup
#

How can I configure the metadata to handle this in Node.js?

#

I am quite new here; so I am still trying to find my way around the whole documentation.

grim oar
#

How are you creating payments?

frank stirrup
#

I handle it using the stripe.checkout.sessions.create function as in the code above.

grim oar
frank stirrup
grim oar
#

It depends on your business requirements. It's not something inherently provided by Stripe, I'm just designing solutions on the fly.
How do you want to split the events between webhook endpoints exactly?

frank stirrup
#

Okay, I want to be able to specify the kind of payment I am about to make or that I just made. So that the webhook(endpoint) that handles the verification on my system can know where to store the transaction data.

#

I handle transactions like ticket purchases, payment for services rendered, withdrawal, etc

grim oar
#

What do you mean by "kind of payment" exactly?

grim oar
#

You can add this to the metadata field. It's a free form object that stores key-value pairs. You can call it something like "service_type": "ticket".

#

E.g.

stripe.checkout.sessions.create({
  ...
  metadata: { "service_type": "ticket" }
})
#

And then when you receive the checkout.session.succeeded event, you check the metadata and route the business logic appropriately.

frank stirrup
#

Okay.
So in essence, I am only allowed to use one webhook per stripe account?

wise pike
#

Hi there 👋 jumping in as my teammate needs to step away. Please bear with me a moment while I catch up on the context here.

frank stirrup
#

And also, on the webhook, what are the different eventType possibilities I should be expecting?
Like, for when a transaction failed, succeeded, pending, etc.?