Skip to content

Commit

Permalink
Merge pull request #43 from adyen-examples/rename-event-handler
Browse files Browse the repository at this point in the history
Rename EventHandler
  • Loading branch information
gcatanese authored Jan 18, 2024
2 parents 038b844 + a6a412d commit 77a7e0c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ tasks:
before: |
sdk install java 17.0.4.1-tem < /dev/null
command: |
./mvnw spring-boot:run
./mvnw clean spring-boot:run
echo Backend running
- name: frontend
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/adyen/controller/WebhookController.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import com.adyen.model.configurationwebhooks.BalanceAccountNotificationRequest;
import com.adyen.model.configurationwebhooks.PaymentNotificationRequest;
import com.adyen.notification.BankingWebhookHandler;
import com.adyen.util.EventHandler;
import com.adyen.util.AfpEventHandler;
import com.adyen.util.HMACValidator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -56,11 +56,11 @@ public ResponseEntity<String> webhooks(@RequestHeader Map<String, String> header
// }

// Deserialise json payload
EventHandler eventHandler = new EventHandler();
AfpEventHandler afpEventHandler = new AfpEventHandler();
BankingWebhookHandler webhookHandler = new BankingWebhookHandler(json);

String type = eventHandler.getEventType(json);
String environment = eventHandler.getEventEnvironment(json);
String type = afpEventHandler.getEventType(json);
String environment = afpEventHandler.getEventEnvironment(json);

log.info("Event " + type + " on " + environment);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Helper class to process AfP events
*/
@Service
public class EventHandler {
public class AfpEventHandler {

public String getEventType(String json) throws JsonProcessingException {
ObjectMapper objectMapper = new ObjectMapper();
Expand Down

0 comments on commit 77a7e0c

Please sign in to comment.