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

public class DefaultAdyenGatewayWebhookHandler extends Object implements AdyenGatewayWebhookHandler
  • Field Details

    • EVENTS_TO_HANDLE

      protected static final List<String> EVENTS_TO_HANDLE
    • BROADLEAF_METADATA_APPLICATION_ID

      protected static final String BROADLEAF_METADATA_APPLICATION_ID
      See Also:
    • BROADLEAF_METADATA_TENANT_ID

      protected static final String 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 interface com.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 interface com.broadleafcommerce.paymentgateway.service.PaymentGatewayWebhookHandler
    • isZeroAmountAuthorization

      protected boolean isZeroAmountAuthorization(@NonNull @NonNull NotificationRequestItem item)
    • 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 interface com.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 interface com.broadleafcommerce.paymentgateway.service.PaymentGatewayWebhookHandler
    • getSupportedWebhookNotificationTypes

      public List<String> getSupportedWebhookNotificationTypes()
      Specified by:
      getSupportedWebhookNotificationTypes in interface com.broadleafcommerce.paymentgateway.service.PaymentGatewayWebhookHandler
    • buildSuccessfulWebhookResponse

      public org.springframework.http.ResponseEntity<?> buildSuccessfulWebhookResponse()
      Specified by:
      buildSuccessfulWebhookResponse in interface com.broadleafcommerce.paymentgateway.service.PaymentGatewayWebhookHandler
    • getGatewayType

      public String getGatewayType()
      Specified by:
      getGatewayType in interface com.broadleafcommerce.paymentgateway.service.PaymentGatewayTypeAware
    • getNotificationRequestItem

      protected NotificationRequestItem getNotificationRequestItem(@NonNull @NonNull String requestBody)
    • 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

      protected String identifyDeclineType(NotificationRequestItem notification)
    • getAmountInMajorUnits

      @Nullable protected javax.money.MonetaryAmount getAmountInMajorUnits(@Nullable AdyenAmount adyenAmount)
    • getTransactionIdentifier

      protected com.broadleafcommerce.paymentgateway.domain.TransactionIdentifier getTransactionIdentifier(NotificationRequestItem notificationRequest)
    • buildRawResponse

      protected String buildRawResponse(NotificationRequestItem notificationRequestItem)
    • getApplicationId

      @Nullable protected String getApplicationId(NotificationRequestItem requestItem)
    • getTenantId

      @Nullable protected String getTenantId(NotificationRequestItem requestItem)
    • getConfigProperties

      protected AdyenConfigurationProperties getConfigProperties()
    • getHmacValidator

      protected AdyenHMACValidator getHmacValidator()
    • getAdyenProvider

      protected AdyenProvider getAdyenProvider()
    • getObjectMapper

      protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
    • getTypeFactory

      protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()