#tymm
1 messages · Page 1 of 1 (latest)
Hi there, can you do a System.out.println(event) and see that it prints out?
im using 22.3.0
"account": null,
"api_version": "2020-08-27",
"created": 1671427731,
"data": {
"previous_attributes": null,
"object": {
"id": "seti_1MGbu3LK0bfo5HSbVWme8cYX",
"object": "setup_intent",
"application": null,
"cancellation_reason": null,
"client_secret": "seti_1MGbu3LK0bfo5HSbVWme8cYX_secret_N0dAUZIZiodor0dQzeV8rgtKcZ0dDeU",
"created": 1671427723,
"customer": "cus_N0dA6PaiTQKa6z",
"description": null,
"flow_directions": null,
"last_setup_error": null,
"latest_attempt": "setatt_1MGbuALK0bfo5HSbGZWWliPK",
"livemode": false,
"mandate": null,
"metadata": {},
"next_action": null,
"on_behalf_of": null,
"payment_method": "pm_1MGbuALK0bfo5HSbZ7zhM33u",
"payment_method_options": {
"card": {
"mandate_options": null,
"network": null,
"request_three_d_secure": "automatic"
}
},
"payment_method_types": [
"card"
],
"single_use_mandate": null,
"status": "succeeded",
"usage": "off_session"
}
},
"id": "evt_1MGbuBLK0bfo5HSbZ107KPyr",
"livemode": false,
"object": "event",
"pending_webhooks": 2,
"request": {
"id": "req_CDtDC3yJcOGAyK",
"idempotency_key": "b2a2b6e7-319f-4e2f-a765-8347fbcf6f29"
},
"type": "setup_intent.succeeded"
}
And what are you trying to achieve ?
it was a callback that i use to insert data into my db when customer has added a payment method
it was working fine previously
what data are you inserting to your db?
And did you update your Stripe API recently?
yes
OK, did dataObjectDeserializer.getObject().isPresent() return false?
i have updated stripe cli to latest version
Can you check if dataObjectDeserializer.getObject().isPresent() return false?
yes, it returns false
OK, did you pass a --latest flag when running stripe listen ?
You don't need to pass the this flag, it tells Stripe to receive events used in the latest API version
Since isPresent() return false, it means that the Stripe SDK is unable to deserialize this object, mostly due to version conflict.
i think that somehow fixed it
Ah, did you also update your Java SDK recently?
I see. you are using SDK 23.3.0, which is compatible to the latest API version 2022-11-15. And setting --latest flag in Stripe CLI allows the webhook event to be constructed in the latest API version so that your code is able to deserialize.
However, I'd recommend you only update the Java SDK if you also have plan to upgrade your Stripe API version, or webhook endpoint API version.
what do u mean
Now you are forcing the webhook events to be constructed in the latest version by using the --latest flag. In production, the webhook events are still constructed based your account's default API version (i.e., 2020-08-27), or webhook endpoint's API version if there's one.
how do i update the api version in my account?
You can update it from Dashboard. Here are the details https://stripe.com/docs/upgrades#how-can-i-upgrade-my-api
I'd also recommend you to follow this guide to test out the new API version before committing an upgrade.
got it, thanks