#michael-webhooks

1 messages · Page 1 of 1 (latest)

lusty swan
#

sure, what's the specific question you have?

true eagle
#

Great, thanks!

#

I'm trying to create a payment intent on our platform from a customer to a connected account. We are collecting platform fees.

#

The backend taking care of this is written in typescript, here is the excerpt of the intent creation:

const intent = await stripe.paymentIntents.create(
{
payment_method_types: ['card', 'eps', 'sepa_debit', 'sofort'],
amount: totalTicketValue,
currency: 'eur',
application_fee_amount: totalPlatformFee,
},
{
stripeAccount: stripeAccountId,
}
)

#

We have been doing local tests with the Local listeners set up that have been working fine. We have received the charge.succeeded webhook and have then fulfilled the order on our side.

#

Now trying to test the same functions on our staging server (AWS EC2) i expected to receive the webhooks and see them in the my stripe dashboard, in test mode because we are still using the test keys, where I have setup the staging endpoint.

lusty swan
#

maybe when you set up the new endpoint you didn't tick the box to listen to Connect events

true eagle
#

Beside the customers, we also have sellers on our platform. They are using subscriptions. The subscription webhooks I can see.

#

We have 6 event listeners set up: account.updated
charge.succeeded
customer.subscription.deleted
customer.subscription.updated
invoice.payment_succeeded
payment_intent.created

#

and for subscriptions they are working, but charging connected accounts and taking a platform fee they are not visible.

lusty swan
#

cool. Do you have a PaymentIntent ID pi_xxx of one of those payments you created for which you're not receiving an event so I can check things?

true eagle
#

Here you go: pi_3K9RAS2XAEzG6Vq11UKJqk9w

lusty swan
#

you need to delete it and create it again with the Connect option ticked

true eagle
#

Ahh...

#

Ok, I misunderstood o listen to Connect events.

#

Yes, please give me a few minutes. I'll try that right away and let you know if it worked.

#

Success, I'm receiving the webhooks!

#

Thank you very much.

#

Does this mean that I always need 2 endpoints for the direct and connected webhooks?

#

Since I guess the secrets will be different for the signature validation.

lusty swan
#

yep you need two endpoints , one for listening to events on your own platform account, and one for all events across all connected accounts, and yes, they use different signing secrets(I'd highly recommend using entirely different URLs for them so you don't get events from both webhooks as it makes things hard to work with in terms of signatures)

true eagle
#

Makes sense. Thank you very much.

true eagle
#

So I guess I have to listen on both endpints with the local listener as well?

lusty swan
true eagle
#

That is what I am doing, but I need to forward to both endpoints with 2 listeners now?

lusty swan
#

pretty sure you can do it one call

#

stripe listen --forward-to=<url1> --forward-connect-to=<url2>

#

not sure if that's exactly what you mean