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 StringbuildRawResponse(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 AdyenProviderprotected javax.money.MonetaryAmountgetAmountInMajorUnits(AdyenAmount adyenAmount) protected StringgetApplicationId(NotificationRequestItem requestItem) protected AdyenConfigurationPropertiesgetEventId(@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 AdyenHMACValidatorprotected NotificationRequestItemgetNotificationRequestItem(@NonNull String requestBody) protected com.fasterxml.jackson.databind.ObjectMapperprotected StringgetTenantId(NotificationRequestItem requestItem) protected com.broadleafcommerce.paymentgateway.domain.TransactionIdentifiergetTransactionIdentifier(NotificationRequestItem notificationRequest) protected com.broadleafcommerce.common.extension.TypeFactoryprotected StringidentifyDeclineType(NotificationRequestItem notification) protected StringidentifyFailureType(NotificationRequestItem notification, String transactionReferenceId) booleanisSupportedTransactionUpdateType(@NonNull String transactionType, @NonNull String updatedGatewayTransactionType) protected booleanisZeroAmountAuthorization(@NonNull NotificationRequestItem item) protected voidparseWebhookRequest(NotificationRequestItem notification, com.broadleafcommerce.paymentgateway.domain.enums.TransactionType transactionType, com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse) protected voidparseWebhookRequest(NotificationRequestItem notification, com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse) booleanshouldHandleRequest(@NonNull org.springframework.http.HttpHeaders headers, @NonNull String requestBody, @NonNull Map<String, String> parameters) voidvalidate(@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, waitMethods 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:
validatein 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:
shouldHandleRequestin 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:
convertToPaymentResponsein 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:
getEventIdin interfacecom.broadleafcommerce.paymentgateway.service.PaymentGatewayWebhookHandler
-
isSupportedTransactionUpdateType
public boolean isSupportedTransactionUpdateType(@NonNull @NonNull String transactionType, @NonNull @NonNull String updatedGatewayTransactionType) - Specified by:
isSupportedTransactionUpdateTypein interfacecom.broadleafcommerce.paymentgateway.service.PaymentGatewayWebhookHandler
-
getSupportedWebhookNotificationTypes
- Specified by:
getSupportedWebhookNotificationTypesin interfacecom.broadleafcommerce.paymentgateway.service.PaymentGatewayWebhookHandler
-
buildSuccessfulWebhookResponse
public org.springframework.http.ResponseEntity<?> buildSuccessfulWebhookResponse()- Specified by:
buildSuccessfulWebhookResponsein interfacecom.broadleafcommerce.paymentgateway.service.PaymentGatewayWebhookHandler
-
getGatewayType
- Specified by:
getGatewayTypein 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()
-