#DanTheGoodman - go sdk

1 messages Β· Page 1 of 1 (latest)

valid merlin
#

Hi there. One moment

#

So you are seeing this in webhoks?

#

Can you send event ID's where you are seeing this?

hardy ether
#

yes, getting the webhooks, but curious why I can see all of these objects in there as well when they aren't in the event info

#

yeah one sec

#

evt_1LK4YLCyQAg6NyoSqDTqbEzx

#

I can dump the struct of a request in go too in a bit

valid merlin
#

Like what you see in Go is different than what you see on the Dashboard?

hardy ether
#

so looking at the docs, the webhook should send me just what is shown in the event. But I can also access things like checkout.PaymentIntent.Charges.Data which is checkout->payment_intent->charges

#

which assumes that the api has then looked up the payment intent and the charges

valid merlin
#

@hardy ether Let's just handle all the question in this thread

hardy ether
#

ill dump a struct real quick

#

ok sound sgood

valid merlin
#

I'm the only one on Discord rn

hardy ether
#

XD no problem

valid merlin
#

Can you share your webhook handler code?

#

Want to see what you're doing

hardy ether
#

ok so the charges aren't there, but the payment intent is. This is a CheckoutSession object

#
case "checkout.session.completed":
        var checkout stripe.CheckoutSession
        err := json.Unmarshal(event.Data.Raw, &checkout)
        if err != nil {
            logger.Error().Err(err).Msg("error unmarshalling checkout session")
            return c.String(http.StatusInternalServerError, http.StatusText(http.StatusInternalServerError))
        }
#

and then simply checkout.PaymentIntent

#

basically it automatically expanded the customer and payment intent

valid merlin
#

It looks like it's just placeholder data right?

#

I don't think it retrieved the info

#

A bunch of empty strings and "0"s

hardy ether
#

oh yeah wow that's very deceiving haha

#

so i need to get the payment intent, then the invoice to see what they got? Seems like the shortest path?

edgy shadow
#

πŸ‘‹ I'm hopping in since @valid merlin has to head out - are you just trying to see what line items were included in a Checkout Session?

hardy ether
#

yep πŸ™‚

#

sorry was driving πŸ˜›

#

I think I got it now if that's what I need to do. The bigger ocncern i have is the message under this thread where I am not seeing webhooks for events

edgy shadow
#

Copying that message here so it's all in one place:
Another thread πŸ˜› Having some issues with webhooks with stripe, it seems like they are sending but not being shown under the Events tab in developers. I know the account ones are because it's for another account it doesn't show in my events, but for example the setupintent events were never sent to the webhook

#

Do you have an event ID example I can look at?

hardy ether
#

yes sorry again >.< in YC call

#

evt_1LKipSCyQAg6NyoSeykTt7hj

#

evt_1LKkpvCyQAg6NyoSIeIwHHUP

edgy shadow
#

I'm only seeing connect-type webhooks on that account - is your expectation that this event (that's happening for the platform) would also be sent to your connect-type webhook endpoint?

hardy ether
#

I would expect that when someone sets up an account to connect to mine, that I would be able to get a webhook about it

#

how can I know when people successfully setup their connect payout account?

edgy shadow
#

Those events would go through your connect webhook, but the events you sent over are Setup Intents created directly on the Platform - connect isn't involved in those events at all

edgy shadow
#

@hardy ether Does that make sense?

hardy ether
#

yeah I think so, sorry again YC call with the twitch founders XD. So I need a connect webhook to get events when the setup is finished?

#

i.e. a valid connect account is established

#

I guess I will need to listen for the updated or created and see if there is valid properties

edgy shadow
#

Sorry I think there's still a bit of a misunderstanding - you already have a connect webhook, which is working as expected. It's expected that the events you listed aren't coming through on the connect webhook because those events are happening on the platform account itself. Only events that are happening directly on the Connected accounts will come through on your connect webhook.

If you have an account type webhook, that would get these events because account webhooks get events that are happening only on that account

hardy ether
#

That was both a platform and connect hook

#

or can they not be the same?

halcyon magnet
#

Hi there πŸ‘‹ taking over

Give me a few minutes to get caught up.

#

That was both a platform and connect hook
It depends on what you mean. There are webhooks that live on your platform (e.g. events that happen on the platform) and webhooks that live on each of your individual connected accounts (e.g. events that occur due to events triggered on behalf of the connected accounts)

#

Those two are separate. They can both go to the same webhook endpoint if you set it up that way, but Stripe treats them differently

hardy ether
#

Ah ok maybe that’s it, so I’d have to set it up twice?

halcyon magnet
#

Essentially yes. You would set it up once for platform events and once for that platform's connected account events.