Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,28 @@ public Optional<CardOrderNotificationRequest> getCardOrderNotificationRequest()
return Optional.empty();
}

/**
* Attempts to deserialize the webhook payload into a MandateNotificationRequest
*
* @return an Optional containing the deserialized object, or empty if deserialization fails
*/
public Optional<MandateNotificationRequest> getMandateNotificationRequest() {

var optionalMandateNotificationRequest = getOptionalField(MandateNotificationRequest.class);

if (optionalMandateNotificationRequest.isPresent()) {
// verify event type
for (var value : MandateNotificationRequest.TypeEnum.values()) {
if (value.equals(optionalMandateNotificationRequest.get().getType())) {
// found matching event type
return optionalMandateNotificationRequest;
}
}
}

return Optional.empty();
}

/**
* Attempts to deserialize the webhook payload into a NetworkTokenNotificationRequest
*
Expand Down
Loading
Loading