#monsherry-connect
1 messages · Page 1 of 1 (latest)
I am using stripe listen --forward-connect-to localhost:3000/api/v1/stripe-hooks/connect
what is your issue exactly?
and i simply dont get any hooks happening
if you use stripe-cli that way you would recieve events that happen on the connected account
maybe nothing happened on the connected account?
Well its a new account
i am trying to create a new account
it used to work before
can you give more details?
I do:
account = await stripe.accounts.create({
type: 'express',
email: user.email,
individual
});
individual ofc hold the right details
then i create a link,
accountLink = await stripe.accountLinks.create({
type: 'account_onboarding',
account: user.stripeAccountId,
collect: 'eventually_due',
refresh_url: `${protocol}://${appHost}/user-settings/creator-billing`,
return_url: `${protocol}://${appHost}/user-settings/creator-billing`,
});
return the link to client
and redirect to that link
and listen to webhook as i mentioned above
Is there a way to delete connected account from my platform as i am running out of emails to try with
that all looks good! What events or event types exactly were you expecting to see that you did not see?
you can use https://stripe.com/docs/api/accounts/delete I believe(API-only, not the dashboard)
const accountUpdate = 'account.updated';
const capabilityUpdate = 'capability.updated';
Well anything really that tells me that the account is completed
anything that will tell me that the account can now receive transfer from the platform
I am not sure how to check that
I used to check
unction accountIsValid(account) {
const active = 'active';
if (!account) {
return false;
}
if (!account.charges_enabled) {
return false;
}
if (!account.payouts_enabled) {
return false;
}
if (account.capabilities.card_payments !== active) {
return false;
}
if (account.capabilities.transfers !== active) {
return false;
}
return true;
}
for those capabilities but i am no longer requesting those capabilties
do you have the account ID acct_xxx of the account where you did not receive any events from it?
You mean my main account ?
acct_1KTQVC4FzyVhZThR
I wonder if
if (account.capabilities.transfers !== active) {
return false;
}
would be enough
Hmm something weirder is happening
stripe listen --forward-to localhost:3000/api/v1/stripe-hooks/payments
stripe listen --forward-connect-to localhost:3000/api/v1/stripe-hooks/connect
i have to listeners
however only localhost:3000/api/v1/stripe-hooks/payments is being fired.
Hello. Taking over for karllekko here. Looking
Secondly out of all those capabilites
(
accountIsValid(account) {
const active = 'active';
if (!account) {
return false;
}
if (!account.charges_enabled) {
return false;
}
if (!account.payouts_enabled) {
return false;
}
if (account.capabilities.card_payments !== active) {
return false;
}
if (account.capabilities.transfers !== active) {
return false;
}
return true;
}
)
which one can i check for to make sure the account is ready ?
ready to receive transfers
For transfers, that would be: account.capabilities.transfers
But looks like the connect account you shared has been deleted...
what does "charges_enabled": true, means
yea i just deleted the connected account so i can create a new one
Its very weird why my connect hook wont fire.
charges_enabled indicates that your account can now accept charges
You can take a look at this page, which talks about the minimum required information needed to start accepting charges, transfers, etc: https://stripe.com/docs/connect/required-verification-information
To be able to get transfers do i need to be able to accept charges ?
If not then i dont need charges_enabled
Well ... cli is weird !!
⣟ Getting ready... > Ready! You are using Stripe API Version [2020-08-27]. Your webhook signing secret is whsec_011220b134e96ce8bc209265e1e241e5d958628dc12a571bf3833ecc21d6e1b1 (^C to quit)
2022-02-15 06:47:08 --> connect account.updated [evt_1KTSJ6QSgKiGfZ8f7MW1dVx1]
2022-02-15 06:47:08 --> connect capability.updated [evt_1KTSJ6QSgKiGfZ8fIBcgmj6y]
It looks like its getting the hook but it just wont fire
Ok this is for the new account you just created?
Don't delete it. I'll look into it
one sec
let me restart my machine
maybe i have double CLI process running
in some weird combination
Ok
Both those webhook events were queued up it looks like
But yeah after you restart and bring your webserver up and then the listen command in another terminal process, let me know
Nope.. its still wont work
it still wont fire the connect hook
when i use postman to make a post request to:
localhost:3000/api/v1/stripe-hooks/connect
the URI works fine
Is --forward-connect-to even a thing ?
duchess ?
Hey there 👋 jumping in.
Let's recap to make sure I'm understanding correctly. You're creating new connected accounts, and trying to listen to the generated webhook events. You're using Stripe CLI currently to forward these to your endpoint. But something is going wrong along the way?
Toby yes
thats correct
I've also just updated to 1.7.12
just to be sure
getting the same results
What did you update?
stripe CLI
Ah gotcha
⢿ Getting ready... > Ready! You are using Stripe API Version [2020-08-27]. Your webhook signing secret is whsec_011220b134e96ce8bc209265e1e241e5d958628dc12a571bf3833ecc21d6e1b1 (^C to quit)
2022-02-15 07:25:31 --> connect account.updated [evt_1KTSuFQOoXsByAf1SW64z2x5]
2022-02-15 07:25:32 --> connect capability.updated [evt_1KTSuFQOoXsByAf1AhUQtTwD]
when i run the listner i did get those
but it seems the post request simply wont fire
at all
Can you restart the listen command, but this time include http:// at the beginning of the --forward-connect-to value?
Sure
Same thing
its like it doesnt even try to make a request
I've just installed morgan just to see if any request is happening
The hook doesnt make any http request what so ever
its weird
stripe listen --forward-to localhost:3000/api/v1/stripe-hooks/payments
Fires everything correctly
stripe listen --forward-connect-to localhost:3000/api/v1/stripe-hooks/connect
doesnt fire anything
Aaahhhh, I see what's happening. So --forward-connect-to is for telling the CLI if you want to send connect events to a different endpoint than the account events. If you don't need to differentiate then you can just use --forward-to for all events.
But if you wanted to send the events to different endpoints then you can do something like this:
stripe listen --forward-connect-to localhost:4242/connect --forward-to localhost:4242
Sure
I mean right now i only have 1 listener running
which is the --foward-connect-to
Let me try what you said 1 sec
stripe listen --forward-connect-to localhost:3000/api/v1/stripe-hooks/connect --forward-to localhost:3000/api/v1/stripe-hooks/payments
basically this is what you are suggesting ?
If you need to listen to all the events and split the endpoint that they're sent to. If you don't need to send connect events to a different location than account events, then you can use just --forward-to like this:
stripe listen --forward-to localhost:4242
--forward-connect-to doesn't do anything on its own, it has to be coupled with --forward-to
Ok just a sec
There we go !!
So this has been changed
because 2 it used to work on its own before
Glad to hear you're up and running now, I am going to look into this more offline as you mentioned that it seems to have changed.
It used to work 100% today i found out that it doesnt and started investigating
Thanks for the help glad you help me find the solution
Happy to help!