feat: HelloAsso payment

This commit is contained in:
2025-08-14 22:45:03 +02:00
parent 0a56f8c180
commit 15f65b1014
28 changed files with 1003 additions and 31 deletions

View File

@@ -0,0 +1,28 @@
package fr.titionfire.ffsaf.domain.service;
import fr.titionfire.ffsaf.rest.client.dto.HelloassoNotification;
import io.smallrye.mutiny.Uni;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import jakarta.ws.rs.core.Response;
import org.eclipse.microprofile.config.inject.ConfigProperty;
@ApplicationScoped
public class WebhookService {
@Inject
CheckoutService checkoutService;
@ConfigProperty(name = "helloasso.organizationSlug")
String organizationSlug;
public Uni<Response> helloAssoNotification(HelloassoNotification notification) {
if (notification.getEventType().equals("Payment")){
if (notification.getData().getOrder().getOrganizationSlug().equalsIgnoreCase(organizationSlug)){
return checkoutService.paymentStatusChange(notification.getData().getState(), notification.getMetadata());
}
}
return Uni.createFrom().item(Response.ok().build());
}
}