Class DefaultAdyenGatewayWebhookHandler
java.lang.Object
com.broadleafcommerce.adyen.service.webhook.DefaultAdyenGatewayWebhookHandler
- All Implemented Interfaces:
AdyenGatewayWebhookHandler
,com.broadleafcommerce.paymentgateway.service.PaymentGatewayTypeAware
,com.broadleafcommerce.paymentgateway.service.PaymentGatewayWebhookHandler
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultAdyenGatewayWebhookHandler
(AdyenConfigurationProperties configProperties, AdyenHMACValidator hmacValidator, AdyenProvider adyenProvider, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
buildRawResponse
(NotificationRequestItem notificationRequestItem) org.springframework.http.ResponseEntity<?>
org.apache.commons.lang3.tuple.Pair<com.broadleafcommerce.paymentgateway.domain.TransactionIdentifier,
com.broadleafcommerce.paymentgateway.domain.PaymentResponse> convertToPaymentResponse
(@NonNull org.springframework.http.HttpHeaders headers, @NonNull String requestBody, @NonNull Map<String, String> parameters) protected AdyenProvider
protected javax.money.MonetaryAmount
getAmountInMajorUnits
(AdyenAmount adyenAmount) protected String
getApplicationId
(NotificationRequestItem requestItem) protected AdyenConfigurationProperties
getEventId
(@NonNull org.springframework.http.HttpHeaders headers, @NonNull String requestBody, @NonNull Map<String, String> parameters) Hook point that can be overridden with additional Webhook event types to handle.protected AdyenHMACValidator
protected NotificationRequestItem
getNotificationRequestItem
(@NonNull String requestBody) protected com.fasterxml.jackson.databind.ObjectMapper
protected String
getTenantId
(NotificationRequestItem requestItem) protected com.broadleafcommerce.paymentgateway.domain.TransactionIdentifier
getTransactionIdentifier
(NotificationRequestItem notificationRequest) protected com.broadleafcommerce.common.extension.TypeFactory
protected String
identifyDeclineType
(NotificationRequestItem notification) protected String
identifyFailureType
(NotificationRequestItem notification, String transactionReferenceId) boolean
isSupportedTransactionUpdateType
(@NonNull String transactionType, @NonNull String updatedGatewayTransactionType) protected boolean
isZeroAmountAuthorization
(@NonNull NotificationRequestItem item) protected void
parseWebhookRequest
(NotificationRequestItem notification, com.broadleafcommerce.paymentgateway.domain.enums.TransactionType transactionType, com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse) protected void
parseWebhookRequest
(NotificationRequestItem notification, com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse) boolean
shouldHandleRequest
(@NonNull org.springframework.http.HttpHeaders headers, @NonNull String requestBody, @NonNull Map<String, String> parameters) void
validate
(@NonNull org.springframework.http.HttpHeaders headers, @NonNull String requestBody, @NonNull Map<String, String> parameters) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.broadleafcommerce.paymentgateway.service.PaymentGatewayWebhookHandler
buildFailedWebhookResponse, convertToPaymentResponse, shouldHandleRequest, validate
-
Field Details
-
EVENTS_TO_HANDLE
-
BROADLEAF_METADATA_APPLICATION_ID
- See Also:
-
BROADLEAF_METADATA_TENANT_ID
- See Also:
-
-
Constructor Details
-
DefaultAdyenGatewayWebhookHandler
public DefaultAdyenGatewayWebhookHandler(AdyenConfigurationProperties configProperties, AdyenHMACValidator hmacValidator, AdyenProvider adyenProvider, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
Method Details
-
validate
public void validate(@NonNull @NonNull org.springframework.http.HttpHeaders headers, @NonNull @NonNull String requestBody, @NonNull @NonNull Map<String, String> parameters) - Specified by:
validate
in interfacecom.broadleafcommerce.paymentgateway.service.PaymentGatewayWebhookHandler
-
shouldHandleRequest
public boolean shouldHandleRequest(@NonNull @NonNull org.springframework.http.HttpHeaders headers, @NonNull @NonNull String requestBody, @NonNull @NonNull Map<String, String> parameters) - Specified by:
shouldHandleRequest
in interfacecom.broadleafcommerce.paymentgateway.service.PaymentGatewayWebhookHandler
-
isZeroAmountAuthorization
-
convertToPaymentResponse
public org.apache.commons.lang3.tuple.Pair<com.broadleafcommerce.paymentgateway.domain.TransactionIdentifier,com.broadleafcommerce.paymentgateway.domain.PaymentResponse> convertToPaymentResponse(@NonNull @NonNull org.springframework.http.HttpHeaders headers, @NonNull @NonNull String requestBody, @NonNull @NonNull Map<String, String> parameters) - Specified by:
convertToPaymentResponse
in interfacecom.broadleafcommerce.paymentgateway.service.PaymentGatewayWebhookHandler
-
getEventId
public String getEventId(@NonNull @NonNull org.springframework.http.HttpHeaders headers, @NonNull @NonNull String requestBody, @NonNull @NonNull Map<String, String> parameters) - Specified by:
getEventId
in interfacecom.broadleafcommerce.paymentgateway.service.PaymentGatewayWebhookHandler
-
isSupportedTransactionUpdateType
public boolean isSupportedTransactionUpdateType(@NonNull @NonNull String transactionType, @NonNull @NonNull String updatedGatewayTransactionType) - Specified by:
isSupportedTransactionUpdateType
in interfacecom.broadleafcommerce.paymentgateway.service.PaymentGatewayWebhookHandler
-
getSupportedWebhookNotificationTypes
- Specified by:
getSupportedWebhookNotificationTypes
in interfacecom.broadleafcommerce.paymentgateway.service.PaymentGatewayWebhookHandler
-
buildSuccessfulWebhookResponse
public org.springframework.http.ResponseEntity<?> buildSuccessfulWebhookResponse()- Specified by:
buildSuccessfulWebhookResponse
in interfacecom.broadleafcommerce.paymentgateway.service.PaymentGatewayWebhookHandler
-
getGatewayType
- Specified by:
getGatewayType
in interfacecom.broadleafcommerce.paymentgateway.service.PaymentGatewayTypeAware
-
getNotificationRequestItem
-
parseWebhookRequest
protected void parseWebhookRequest(NotificationRequestItem notification, com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse) -
parseWebhookRequest
protected void parseWebhookRequest(NotificationRequestItem notification, com.broadleafcommerce.paymentgateway.domain.enums.TransactionType transactionType, com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse) -
identifyFailureType
protected String identifyFailureType(NotificationRequestItem notification, String transactionReferenceId) -
identifyDeclineType
-
getAmountInMajorUnits
@Nullable protected javax.money.MonetaryAmount getAmountInMajorUnits(@Nullable AdyenAmount adyenAmount) -
getTransactionIdentifier
protected com.broadleafcommerce.paymentgateway.domain.TransactionIdentifier getTransactionIdentifier(NotificationRequestItem notificationRequest) -
buildRawResponse
-
getEventsToHandle
Hook point that can be overridden with additional Webhook event types to handle.- Returns:
- list of Webhook events that should be handled
-
getApplicationId
-
getTenantId
-
getConfigProperties
-
getHmacValidator
-
getAdyenProvider
-
getObjectMapper
protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper() -
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
-