#mukul-bhardwaj_api

1 messages ยท Page 1 of 1 (latest)

cinder ferryBOT
#

๐Ÿ‘‹ 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/1352217840303734844

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

dire wharf
#

๐Ÿ‘‹
Could you please share a webhook endpoint Id and an eventId that you were expecting it on your webhook nedpoint

willow star
#

i am expecting this event account.updated to fire

dire wharf
#

Please share Stripe Object Ids

dire wharf
willow star
#

account = await stripe.accounts.create({
type: 'express',
country: 'US',
email: dbUser.email,
capabilities: {
transfers: { requested: true },
},
}); }
const onboarding = await stripe.accountLinks.create({
account: dbUser.stripeCustomerId,
type: 'account_onboarding',
refresh_url: 'https://example.com/reauth',
return_url: 'https://example.com/return',
});

dire wharf
#

There is no update action from these api calls

cinder ferryBOT
willow star
#

it generate a link url to update kyc documents

dire wharf
#

Yes but the account.update will be generated at the end of the onboarding

willow star
#

yes i also awaiting this to fire but it does not trigger

dire wharf
willow star
#

ok testing

kindred wraith
#

Hi there ๐Ÿ‘‹ jumping in as my teammate needs to step away soon. Do you see account.update Events getting generated, but they just aren't being sent to your endpoint? If so, can you share the ID of one of those Events? That ID should have a evt_ prefix.

willow star
#

one more important thing i forget to tell that after completing the kyc verification which is generted through this method await stripe.accountLinks.create() event are not even visible in my stripe dashboard

kindred wraith
#

Is that your Platform's Stripe Dashboard? If so, they aren't expected to show there, I'm pretty sure.

willow star
#

yes

kindred wraith
#

Are you able to share the ID of a Connected Account that you're testing with?

willow star
#

this is how why web hook is set

kindred wraith
#

That endpoint isn't listening for Events from your Connected Accounts, it's listening for Events from your Platform account.

#

If you want to listen to Events from your Connected Accounts, you need to create a new webhook endpoint that is configured to do so.

#

This option if you're creating those through the dashboard:

willow star
#

like this?

kindred wraith
#

Yup

willow star
#

ok can i use same end point here ??

kindred wraith
#

Yes

willow star
#

ok i am just testing thanks

kindred wraith
#

Any time!

willow star
#

hi now event start triggering but it shows this but this is a
export async function handlePaymentRedirect(
req: Request,
res: Response,
next: NextFunction,
) {
const sig = req.headers['stripe-signature'];
const rawBody = req.body;
try {
if (!sig) {
return res.status(400).send('Missing Stripe signature');
}
const event: Stripe.Event = Stripe.webhooks.constructEvent(
rawBody,
sig,
process.env.ENDPOINT_SECRET,
);
console.log('webhook invoked', event.type);
await paymentQueue.add('payment-processing', event, {
attempts: 4,
backoff: {
type: 'fixed',
delay: 30000,
},
});
res.json('received');
} catch (err) {
next(err);
}
} this is the same controller that is using by other webhook event and this route that is associated with this controller have raw type router.post(
'/webhook',
express.raw({ type: 'application/json' }),
ReservationAuthRoute.handlePaymentRedirect,
);

kindred wraith
#

Did you swap the signing secret used by your event handling code? Since each webhook endpoint generates their own unique signing secret that has to be used to verify signatures generated for Events sent to that webhook endpoint.

willow star
#

no i didnt swap

kindred wraith
#

That's likely the problem then, but let us know if updating your ENDPOINT_SECRET environment variable doesn't resolve the issue.

willow star
#

thanks a lot it works