#td3_webhooks
1 messages ยท Page 1 of 1 (latest)
๐ 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/1468018798442315919
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
destination id:
ed_61U5tOORqeQ3kNXMz16RxsG735SQnrGCANkTmcC8e5E8
Destination ID should start with we_
weird this one doesn't
my other webhooks do start with we_
I set this one up the same way i did the others in the dashboard
I'm going to send you a DM with a link that will request consent for us to look at your account and available account objects which will allow me to investigate this issue better.
ok
do you have an account ID handy?
Hello @zinc rover, we have sent you a direct message, please check it at https://discord.com/channels/@me/1468020878964166847
- ๐ The message has instructions on how to grant read and write access to your Stripe Dashboard for our Developer Support team, in order to help you more effectively.
i approved
Ty! Looking into this.
Attempting to reproduce end to end, appreciate your patience.
router.post('/webhook', async (req, res) => {
// Since we used express.raw() middleware for this route,
// req.body is already a Buffer
const relevantEvents = new Set([
'v2.core.account.closed',
'v2.core.account.created',
'v2.core.account.updated',
'v2.core.account[identity].updated',
'v2.core.account[requirements].updated',
]);
const sig = req.headers['stripe-signature'];
const webhookSecret = process.env.STRIPE_WEBHOOK_SECRET_PLAYFUL;
let event;
try {
if (!sig || !webhookSecret) {
return res.status(400).json({ error: 'Webhook secret not found.' });
}
event = stripe.webhooks.constructEvent(req.body, sig, webhookSecret);
console.log(๐ Webhook received: ${event.type});
} catch (err) {
console.log(โ Error message: ${err.message});
return res.status(400).json({ error: Webhook Error: ${err.message}, event: event });
}
if (relevantEvents.has(event.type)) {
try {
switch (event.type) {
case 'v2.core.account[requirements].updated':
const account = event.data.object;
await manageAccountNeedsImmediateAction(account.id, account.requirements);
break;
case 'v2.core.account.closed':
case 'v2.core.account.created':
case 'v2.core.account.updated':
case 'v2.core.account[identity].updated':
await manageAccountStatusChange(event.data.object.id);
break;
default:
throw new Error('Unhandled relevant event!');
}
} catch (error) {
console.log(error);
return res.status(400).json({ error: 'Webhook handler failed. View your Next.js function logs.', event: event });
}
} else {
// Unsupported event type - log but return success to prevent Stripe retries
console.log(โน๏ธ Unsupported event type received: ${event.type});
return res.status(200).json({ received: true, message: Unsupported event type: ${event.type} });
}
return res.status(200).json({ received: true });
});
that's my nodejs webhook fyi^
Ok, can you do me a favor and create a new endpoint destination.
Instead of selecting "Connect and V2 accounts", select "Your account" (counter intuitive I know)
Then down below where you select what events to listen to. Check "accounts v2"
You can refer to the Screenshot.
After the end point is created. try resending one of the v2 account events and it should show up in the newly created end point.
ok doing it now
Ok, this next part is totally optional, but it might be worth reaching out to support to voice feedback relating to how counter intuitive this flow is.
I would think most people would end up in the same situation you did given the way the information is presented. (I know I did)
haha yea