#basarito - payload

1 messages ยท Page 1 of 1 (latest)

mossy vault
#

Hi! What do you see when you try to print the payload?

worthy patrol
#
{
  "account": null,
  "api_version": null,
  "created": 1651233318,
  "data": {
    "previous_attributes": null,
    "object": {}
  },
  "id": "evt_3KtsPqDtE6O7fjog1HCjnuXQ",
  "livemode": false,
  "object": "event",
  "pending_webhooks": null,
  "request": {
    "id": "req_W42wzOmlmvMyMS",
    "idempotency_key": null
  },
  "type": "payment_intent.created"
}
#

It's the same for account.updated event, the data.object is still empty:

{
  "account": "acct_1KtsaHDEbXECVNZs",
  "api_version": null,
  "created": 1651233972,
  "data": {
    "previous_attributes": null,
    "object": {}
  },
  "id": "evt_1KtsaPDEbXECVNZsKIG14I0b",
  "livemode": false,
  "object": "event",
  "pending_webhooks": null,
  "request": {
    "id": "req_icl2tWiIoRvM5N",
    "idempotency_key": null
  },
  "type": "account.updated"
}
mossy vault
#

Thanks! What is the version of stripe-java that your webhook endpoint uses? And could you share your webhook code?

worthy patrol
#

stripe-java version: 20.114.0

The code itself is pretty basic, I'm just printing the event.toJson()

mossy vault
#

That's odd. Are you using the Stripe CLI to forward the events to your webhook endpoint?

worthy patrol
#

Yes. I'm using stripe listen ... and it shows live events as I trigger them via stripe trigger account.updated

mossy vault
#

Got it! And does that happens for every event? For example what do you see if you run stripe trigger payment_intent.succeeded

worthy patrol
#

Yep, same happens no matter which event I trigger:

{
  "account": null,
  "api_version": null,
  "created": 1651235149,
  "data": {
    "previous_attributes": null,
    "object": {}
  },
  "id": "evt_3KtstMDtE6O7fjog1Agkcurz",
  "livemode": false,
  "object": "event",
  "pending_webhooks": null,
  "request": {
    "id": "req_65xLnXdYEm0WHd",
    "idempotency_key": null
  },
  "type": "payment_intent.succeeded"
}
mossy vault
#

Looking into this...

worthy patrol
#

Just wanted to add, I just tried tried triggering the event "properly" by performing an actual payment in test mode and I again received an event in the webhook handler, but the data.object is still empty ๐Ÿ˜ฆ

worthy patrol
#

any ideas what else I can try?

zenith island
#

HI there ๐Ÿ‘‹ sincere apologies for the delay in me getting caught up. Please bear with me a moment while I get context on this conversation.

#

If you print the raw event (without the json conversion) is it just as empty? I'm trying to think through where the data could be falling out.

worthy patrol
#

Give me a second to try it out, but I think it was still empty when I was debugging it

uneven lily
#

basarito - payload

worthy patrol
#

oh man, looks like that seems to be it! originally I used Event directly as RequestBody argument, but now that I used HttpServletRequest instead and printed the body, it shows the data.object

zenith island
#

Awesome!

worthy patrol
#

yep, can confirm it is now working ๐Ÿ™Œ thanks so much! ๐Ÿ™‡

zenith island
#

Happy to help!

worthy patrol
#

the answer is always in one's code ๐Ÿ˜… ๐Ÿ˜‚