#Divya.Shalini

1 messages · Page 1 of 1 (latest)

compact cloudBOT
crystal prairie
distant rapids
#

Let me explain

#

When any customer is updating there payout details, then three webhook is getting triggered all together

#

I have done deactivate action on webhook listen of action.external_account.deleted

#

But It should trigger only when someone deleting there external account.

#

For this I am thinking handle on checking next and previous webhook triggering on account.external_account.deleted

#

How to check next and previous webhook on listen of any webhook?

#

Any help?

crystal prairie
#

Hmm not sure what is the content of those 3 events. Were they deletion of the old account, creation of the new account, and updated from old account to new account?

distant rapids
#

These are related to Connect Account. Every connect account would have atleast one external account

crystal prairie
#

evt_xxx

distant rapids
#

Sure

#

account.external_account.updated - "evt_1NR92TQfZmFMqqJunu9yr05I"
account.external_account.created - "evt_1NR92TQfZmFMqqJuaP0Ozue9"
account.external_account.deleted - "evt_1NR92TQfZmFMqqJuvNOc3WvS"

crystal prairie
#

Ah okie I think it's expected. updated moved the old card card_1NQ9d9QfZmFMqqJuwzFWPPcl default_for_currency from true to false, then deleted removed it entirely.

#

Finally created generate the new card card_1NR92SQfZmFMqqJu2KycWkcj

#

I have done deactivate action on webhook listen of action.external_account.deleted
I think you would want to revise this logic then

#

The webhook event is still sent in this update scenario

distant rapids
#

So, what should be the pattern of webhook trigger to update the card/bank account

#

Because we have a stituation in our application that whenever account.external_account.deleted webhook is getting triggered in stripe then we need to listen it and deactivate the user for it's further usage

#

But I observed that in the case of payout update also account.external_account.deleted is triggering

compact cloudBOT
crystal prairie
#

It's up to you really, it's more of an async engineering problem to deal with. For example when you receive deleted event you can put the account in a queue, when you receive updated from card_A -> card_B, you mark card A as to_be_update.

#

Later on a daily job, check the queue and ignore everything that is to_be_update, then take the final list and finally perform account deactivation

distant rapids
#

If there be any pattern for update that would also be very helpful for us

#

Because if you see below screenshot

#

All account.external_account.updated , account.external_account.created,
account.external_account.deleted triggering without any pattern

#

Or if there be any way to find out on time how time webhooks has been triggered that would also work

#

We can check count and perform as per that

#

Because see account.external_account.updated , account.external_account.created,
account.external_account.deleted are triggering at same time