Merge branch 'main' into fix-pipeline2
Some checks failed
CI / Get Changed Files (pull_request) Successful in 8s
CI / prettier (pull_request) Successful in 28s
CI / Checkstyle Main (pull_request) Successful in 48s
CI / test-build (pull_request) Successful in 36s
CI / eslint (pull_request) Failing after 37s

This commit is contained in:
Jan K9f 2025-04-23 07:16:50 +00:00
commit f6dd50dc44
No known key found for this signature in database
GPG key ID: 944223E4D46B7412

View file

@ -46,14 +46,10 @@ public class WebhookController {
public ResponseEntity<String> webhook(@RequestBody String payload, @RequestHeader("Stripe-Signature") String sigHeader) throws StripeException {
Event event = Webhook.constructEvent(payload, sigHeader, webhookSecret);
switch (event.getType()) {
case "checkout.session.completed":
case "checkout.session.async_payment_succeeded":
if (Objects.equals(event.getType(), "checkout.session.completed") || Objects.equals(event.getType(), "checkout.session.async_payment_succeeded")) {
Session session = (Session) event.getData().getObject();
this.transactionService.fulfillCheckout(session.getId());
break;
default:
}
return ResponseEntity.ok().body(null);