#SìromØne [VG0] -webhook-empty
1 messages · Page 1 of 1 (latest)
hey there
you should be able to get the data without a signature verification, even if this is recommended
ie, if you parse the json the data is there, and that doesnt depend on the signature
That is strange then. The isObjectPresent returns false. When i log the event, the Json of the object is empty.
which language do you use on the server?
have you logged the raw object body to insptead?
Java
yes, getting now...
Received Stripe webhook event [payment_method.detached]:
<com.stripe.model.Event@366716663 id=evt_1Ja3tMROrXwizNyMqib5njWo> JSON: {
"account": "acct_1JPVnQROrXwizNyM",
"api_version": null,
"created": 1631734536,
"data": {
"previous_attributes": null,
"object": {}
},
"id": "evt_1Ja3tMROrXwizNyMqib5njWo",
"livemode": false,
"object": "event",
"pending_webhooks": null,
"request": {
"id": "req_DNgfDx8P9ZbJuN",
"idempotency_key": null
},
"type": "payment_method.detached"
}
// Deserialize the nested object inside the event
EventDataObjectDeserializer dataObjectDeserializer = event.getDataObjectDeserializer();
StripeObject stripeObject;
if (dataObjectDeserializer.getObject().isPresent()) {
stripeObject = dataObjectDeserializer.getObject().get();
} else {
logger.error("Stripe deserialization failed, raw JSON:\n{}", dataObjectDeserializer.getRawJson());
// TODO: Deserialization failed, probably due to an API version mismatch.
// Refer to the Javadoc documentation on EventDataObjectDeserializer for
// instructions on how to handle this case, or return an error here.
return ResponseEntity.unprocessableEntity().build();
}
ah
this is likely related to your stripe-java version, it needs to match the api version set on the webhook endpoint
which stripe-java version are you using?
and whats the api version of your endpoint?
hmm ok that should match
the json deserialization error is usually a mismatched api version
"id": "evt_3JXntsEnrlVgo8vJ0NvlPJLx",
"object": "event",
"api_version": "2020-08-27",
"created": 1631801223,
I am still waiting to activate it in Production, now this API goes directly to my Test environment
I will try to update the library then
it should not be needed since they already match, though
thanks synthrider, i have to go now. I will check later.