#johnm2023_webhooks
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1387435295447715930
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there ๐ can you confirm which version of stripe-java you're using?
29.2.0
Hi taking over here and looking into it
Thanks...
Hm yeah there's no api version mismatch between your account default and the sdk version you're using
That's a common cause of the error
Can you share more of your webhook endpoint code?
Are you getting an exception?
@PostMapping("/webhook/stripe")
public ResponseEntity<?> processStripeWebhook(@RequestHeader("Stripe-Signature") String signatureHeader,@RequestBody String payload) throws Exception {
Event event = null;
if (stripeWebhookSecurity) {
try {
event = Webhook.constructEvent(payload, signatureHeader, stripeSecritySecret);
} catch (SignatureVerificationException e) {
log.error("security exception processing webhook.");
}
} else {
event = ApiResource.GSON.fromJson(payload, Event.class);
}
webHookService.processWebHook(event);
return ResponseEntity.ok("success");
}
@Transactional
public void processWebHook(Event event) throws Exception {
try {
switch (event.getType()) {
case BepConstants.WEBHOOK_PAYOUT_PAID:
processPayoutPaid(event);
break;
default:
;
log.info("Un-registered Event. Event is " + event.getType());
}
}
catch (Exception e){
log.error("Error occured processing web hook " + event.getType() +". error is " + e.toString());
throw new RuntimeException(e);
}
}
public void processPayoutPaid(Event event){
log.info("Processing payout.paid webhook");
LocalDateTime dateCreated = CommonUtils.dateStampFromUnixEpoc(event.getCreated());
EventDataObjectDeserializer edo = event.getDataObjectDeserializer();
StripeObject stripeObject = edo.getObject().get();
String account = event.getAccount();
Payout payout = (Payout) stripeObject;
payoutService.processPayoutPaid(payout,account,dateCreated );
}
StripeObject stripeObject = edo.getObject().get(); is where we are getting the issue
That seems fine
You're positive you're on 29.2.0?
Object really only should be null if the version was mismatched
<dependency>
<groupId>com.stripe</groupId>
<artifactId>stripe-java</artifactId>
<version>29.2.0</version>
</dependency>
Yeah but can you check the physical library that's being used
Sometimes there can be issues where the latest wasn't installed properly from the pom
Thanks for your help...