#testDeveloper
1 messages · Page 1 of 1 (latest)
hi! No. I don't think there's any situation where you would only have a ba_xxx ExternalAccount ID and not already know the account ID acct_xxx it's related to. What is the context of your questiom?
i am performing a trace back to transfers from payouts of external accounts
so require somehow connected account Id from payout object or another related link or something
you already know the ID since you needed to pass Stripe-Account when calling the /v1/payouts API to access the Payout object.
no thats where i require the id
i am doing it in the case of event
payout.paid
and there i only have the payout object and external account Id
is there any way to know payout was of which connected account?
there's an account field in the webhook for payout.paid
In addition to the documented response properties in the event object reference, each event for a connected account will also contain a top-level account property. It identifies the user for whom the webhook is being sent.
will the old events be triggered to newly created webhook ?
no
I am passing the raw request body
Webhook signature verification failed. No signatures found matching the expected signature for payload. Are you passing the raw request body you received from Stripe? https://github.com/stripe/stripe-node#webhook-signing
but still getting an error
are you using the right signing secret whsec_xxx?
to debug this you'll need to add logging to log every value you pass to constructEvent (the payload, the secret, and the signature header) and then we can try to have a look at what part is wrong
can you say more about it "not working" exactly?
no logs for events that i defined inside the switch case
could you share the exact code and which part is not working?
and an event ID evt_xxx that is triggering the problem
switch (event.type) { case 'payout.created': await TransactionModel.findOneAndUpdate( { transactionId: event.data.object.balance_transaction }, { payoutDate: new Date(new Date(0).setUTCSeconds(event.data.object.arrival_date)) }, ); console.log('payout', event.data.object.created); break; case 'transfer.created': console.log('transfer', event.data.object); console.log('transfer.createdDate', new Date(new Date(0).setUTCSeconds(event.data.object.created))); break; case 'payout.paid': console.log('event', event); const retrievePayment = await StripeService.BalancePaymentTransactionList( { payoutId: event.data.object.id, stripeAccount: event.account }, ); console.log('retrivePayment', retrievePayment.data); const paymentIds = retrievePayment.data.map(payment => payment.source); console.log('paymentIds', paymentIds); await TransactionModel.updateMany( { paymentId: { $in: paymentIds } }, { $set: { payoutDate: new Date(new Date(0).setUTCSeconds(event.data.object.arrival_date)), }, }, ); console.log('payout.paidDate', new Date(new Date(0).setUTCSeconds(event.data.object.arrival_date))); break; case 'charge.succeeded': console.log('charge_success', event.data.object); console.log('charge.succeededDate', new Date(new Date(0).setUTCSeconds(event.data.object.created))); break; default: // Unexpected event type console.log(Unhandled event type ${event.type}.); }
thanks
and an event ID evt_xxx that is triggering the problem?
for example, you said earlier you are using payout.paid
but that code only looks for payout.created
its being triggered but after endpoint check nothing works
no logs
i suppose code execution stops after that
possibly, hard for me to say really, I don't have access to your code