#PoopFace - Trigger Action
1 messages ยท Page 1 of 1 (latest)
Hello ๐
Can you clarify what you mean? What kind of action are you trying to trigger.
2022-06-22 00:15:21 --> connect capability.updated [evt_1LDFLwPWwd3EVn8DTL6uvVuF]
2022-06-22 00:15:21 <-- [200] POST http://localhost:8080/api/payment/webhook [evt_1LDFLwPWwd3EVn8DTL6uvVuF]
2022-06-22 00:15:58 --> connect person.created [evt_1LDFMYPWwd3EVn8DJ5Wd4qDa]
2022-06-22 00:15:58 <-- [200] POST http://localhost:8080/api/payment/webhook [evt_1LDFMYPWwd3EVn8DJ5Wd4qDa]
2022-06-22 00:16:18 --> connect account.updated [evt_1LDFMsPWwd3EVn8DN3Y1QzZT]
2022-06-22 00:16:18 <-- [200] POST http://localhost:8080/api/payment/webhook [evt_1LDFMsPWwd3EVn8DN3Y1QzZT]
2022-06-22 00:16:18 --> connect capability.updated [evt_1LDFMsPWwd3EVn8DRxdOY3yi]
2022-06-22 00:16:18 <-- [200] POST http://localhost:8080/api/payment/webhook [evt_1LDFMsPWwd3EVn8DRxdOY3yi]
2022-06-22 00:16:25 --> connect account.external_account.created [evt_1LDFMzPWwd3EVn8DQjTqRPgE]
2022-06-22 00:16:25 <-- [200] POST http://localhost:8080/api/payment/webhook [evt_1LDFMzPWwd3EVn8DQjTqRPgE]
2022-06-22 00:16:26 --> connect account.updated [evt_1LDFMzPWwd3EVn8DfjYwUn2c]
2022-06-22 00:16:26 <-- [200] POST http://localhost:8080/api/payment/webhook [evt_1LDFMzPWwd3EVn8DfjYwUn2c]
2022-06-22 00:16:49 --> connect account.updated [evt_1LDFNNPWwd3EVn8D4bccNrQD]
2022-06-22 00:16:49 <-- [200] POST http://localhost:8080/api/payment/webhook [evt_1LDFNNPWwd3EVn8D4bccNrQD]
2022-06-22 00:16:50 --> connect capability.updated [evt_1LDFNNPWwd3EVn8DfqcQah6x]
2022-06-22 00:16:50 <-- [200] POST http://localhost:8080/api/payment/webhook [evt_1LDFNNPWwd3EVn8DfqcQah6x]
I have a webhook that i receive updates on, and I am trying to add the stripe customer account id to the database after the process is done, but using capability.updated can trigger false, as the user can cancel before submit button
can trigger false
What do you mean by this?
the webhook triggers update after each step, how can i trigger after the last submit ?
if i cancelled now, before submitting, it's still saved to the database, since the action is triggered after the first capability.updated
Well the accounts capabilities are being updated. What is it you are trying to achieve by waiting for the final submit?
How are you onboarding these accounts?
sorry what do you mean by onboarding ?
The form you linked is the one used to onboard connect accounts. Often using something like an Account Link
i am forcing the users on my app to create stripe connect account
so that they can receive payments
I am adding their account id to the database : acct_1LDFecBBKBGpMxwP
indicating they already have account, so they can proceed
Okay so the Account is created before it has any capabilities. Usually that is the first step.
You create the Account here: https://stripe.com/docs/api/accounts/create
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
// user creates an account
// ToDo : check externel_account.create
case 'account.updated':
const accountId = event.data.object.id
const userId = event.data.object.metadata._id
await paymentService.updateStripeAccount(accountId, userId)
default:
console.log(`Unhandled event type : ${event.type}`)
The account ID won't change when the capabilities update. You have the Account ID when the account is created.
i already know this, that's what i am doing
If you want to exclude these accounts from your DB until they have completed all the requirements then you will want to examine the requirements property of the Account object.
https://stripe.com/docs/api/accounts/object#account_object-requirements
So in your case 'account.updated' event handler you can inspect the event.data.object.requirements. If it's empty then the user has provided everything they need. to.
thank you, gonna try it out ๐
I hope it works for you ๐
thanks Snufkin, it worked ๐
sorry quick question : is there any way to print the response in stripe cli ?
I can only see the status code
What response do you mean? Are you talking about the stripe listen?
yes, the returned response for the webhook
it only shows the status code :
2022-06-22 01:08:27 <-- [200] POST http://localhost:8080/api/payment/webhook [evt_1LDGBKBHQNOY4ZJXsHMRRUqj]
try adding the --format JSON flag to your stripe listen command