#monsherry-connect

1 messages · Page 1 of 1 (latest)

nocturne glacier
#

not that I know of

nimble jacinth
#

I am using stripe listen --forward-connect-to localhost:3000/api/v1/stripe-hooks/connect

nocturne glacier
#

what is your issue exactly?

nimble jacinth
#

and i simply dont get any hooks happening

nocturne glacier
#

if you use stripe-cli that way you would recieve events that happen on the connected account

#

maybe nothing happened on the connected account?

nimble jacinth
#

Well its a new account

#

i am trying to create a new account

#

it used to work before

nocturne glacier
#

can you give more details?

nimble jacinth
#

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

nocturne glacier
#

that all looks good! What events or event types exactly were you expecting to see that you did not see?

nimble jacinth
#

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

nocturne glacier
#

do you have the account ID acct_xxx of the account where you did not receive any events from it?

nimble jacinth
#

You mean my main account ?

nocturne glacier
#

nope, the connected account.

#

the Express account.

nimble jacinth
#

acct_1KTQVC4FzyVhZThR

#

I wonder if

if (account.capabilities.transfers !== active) {
    return false;
  }

would be enough

nimble jacinth
#

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.

plucky lagoon
#

Hello. Taking over for karllekko here. Looking

nimble jacinth
#

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

plucky lagoon
#

For transfers, that would be: account.capabilities.transfers

#

But looks like the connect account you shared has been deleted...

nimble jacinth
#

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.

plucky lagoon
#

charges_enabled indicates that your account can now accept charges

nimble jacinth
#

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

plucky lagoon
#

Ok this is for the new account you just created?

#

Don't delete it. I'll look into it

nimble jacinth
#

one sec

#

let me restart my machine

#

maybe i have double CLI process running

#

in some weird combination

plucky lagoon
#

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

nimble jacinth
#

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 ?

sturdy anvil
#

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?

nimble jacinth
#

Toby yes

#

thats correct

#

I've also just updated to 1.7.12

#

just to be sure

#

getting the same results

sturdy anvil
#

What did you update?

nimble jacinth
#

stripe CLI

sturdy anvil
#

Ah gotcha

nimble jacinth
#
⢿ 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

sturdy anvil
#

Can you restart the listen command, but this time include http:// at the beginning of the --forward-connect-to value?

nimble jacinth
#

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

sturdy anvil
#

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

nimble jacinth
#

hmm

#

Not sure what you mean

#

explain again please

sturdy anvil
#

Sure

nimble jacinth
#

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 ?

sturdy anvil
#

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

nimble jacinth
#

Ok just a sec

#

There we go !!

#

So this has been changed

#

because 2 it used to work on its own before

sturdy anvil
#

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.

nimble jacinth
#

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

sturdy anvil
#

Happy to help!