feat: helloasso competition register

This commit is contained in:
2025-08-20 21:59:26 +02:00
parent 11dca5630c
commit 2a1bdfbdcb
6 changed files with 220 additions and 8 deletions

View File

@@ -13,13 +13,25 @@ public class WebhookService {
@Inject
CheckoutService checkoutService;
@Inject
CompetitionService competitionService;
@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());
if (notification.getEventType().equals("Payment")) {
if (notification.getData().getOrder().getFormType().equals("Checkout")) {
if (notification.getData().getOrder().getOrganizationSlug().equalsIgnoreCase(organizationSlug)) {
return checkoutService.paymentStatusChange(notification.getData().getState(),
notification.getMetadata());
}
} else if (notification.getData().getOrder().getFormType().equals("Event")) {
return competitionService.unregisterHelloAsso(notification.getData());
}
}else if (notification.getEventType().equals("Order")){
if (notification.getData().getFormType().equals("Event")) {
return competitionService.registerHelloAsso(notification.getData());
}
}