#jarek-webhook-connect
1 messages · Page 1 of 1 (latest)
If you delete the webhook and recreate it, that should work
Hmm. For some reason our webhook is never getting hit. But when I test locally, it is.
I checked all the basic stuff, like the whsec secret, which is also added to our .env file in GL
Our deployed endpoint is https://distro-api[...]run.app/webhooks/orders
And locally I'm running http://localhost:8080/webhooks/orders
I added a bunch of logs and deployed it to test and it's not even hitting the endpoint
Do you have an example event ID that you're expecting to hit your deployed endpoint?
This is what we're trying
case 'checkout.session.completed': {
const stripeResponse = await StripeClient.checkout.sessions.retrieve(
event.data.object.id,
{ expand: ['line_items', 'line_items.data.price.product'] },
{ stripeAccount: event.account },
)
const lineItems = stripeResponse.line_items
// Check if the order is paid (for example, from a card payment)
//
// A delayed notification payment will have an `unpaid` status, as
// you're still waiting for funds to be transferred from the customer's
// account.
if (stripeResponse.payment_status === 'paid') {
addOrderToFirebase(stripeResponse, lineItems)
}
break
}
Do you have an event ID? Like evt_123 (which you should be able to findi n the dashboard at https://dashboard.stripe.com/events)
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
This one, but it was triggered locally evt_1OUu0FFNCC3cxje5r44JTBro
Did you intentionally crate your deployed endpoint as a connect webhook endpoint? Or did you. mean to create an "account" type one?
It's for handling stripe checkout sessions when someone purchases a product. It should send the payload to .../webhooks/orders, which we then save to our db.
It was working, but I recently updated our frontend to create a session like this using transfer_data
const session = await stripe.checkout.sessions.create({
line_items: lineItems,
metadata: {
organizationId: config.public.orgId,
},
success_url: 'https://example.com/success',
cancel_url: 'https://example.com/cancel',
allow_promotion_codes: true,
payment_intent_data: {
transfer_data: {
destination: stripeConfig.account,
},
on_behalf_of: stripeConfig.account,
},
billing_address_collection: 'required',
shipping_address_collection: {
allowed_countries: ['US', 'CA'],
},
mode: 'payment',
});
return session;
Yes, but is there a reason you made it "connect" webhook endpoint and not an "account" one? If you're not using the Stripe-Account header the Checkout Sessions will be created on the platform account, not the connected one
Our customers will have a Connect account, connected to our platform account. Is that what you're asking?
For some reason the accounts are receiving the payments, but we're just not getting the webhook request
This is the stripeAccount that is getting the test payments acct_1O1Ci9FKaLkdf1TY
When the checkout.session.completed session is done, the Connect account user does get the payment. However, we're not getting anything to the webhook.
Sorry letme back up - based on what you've shared you're creating CHeckout Session on the Platform account (not the connected one). When the payment is done, on the platform some portion of the funds are automatically transferred to the connected account.
Since the Checkout Session is still being actually created on the Platform, you need an Account webhook endpoint in order to get the Checkout Session events you expect
👍
jarek-webhook-connect
ohhhhk I did get something. I get it, so now it's "pay us, we'll transfer it to this connected account" so its now our checkout session, not the connected account.
Yup!
You are awesome thank you!