Class DefaultTabbyWebhookHandler

java.lang.Object
com.broadleafcommerce.tabby.service.webhook.DefaultTabbyWebhookHandler
All Implemented Interfaces:
com.broadleafcommerce.paymentgateway.service.PaymentGatewayTypeAware, com.broadleafcommerce.paymentgateway.service.PaymentGatewayWebhookHandler, TabbyWebhookHandler

public class DefaultTabbyWebhookHandler extends Object implements TabbyWebhookHandler
  • Field Details

  • Constructor Details

    • DefaultTabbyWebhookHandler

      public DefaultTabbyWebhookHandler(TabbyConfigurationProperties configurationProperties, com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
  • 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
    • 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
    • getSupportedWebhookNotificationTypes

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

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

      @Nullable protected String getApplicationId(@NonNull @NonNull Map<String,String> parameters)
    • getTenantId

      @Nullable protected String getTenantId(@NonNull @NonNull Map<String,String> parameters)
    • isSignatureValid

      protected boolean isSignatureValid(@NonNull @NonNull org.springframework.http.HttpHeaders headers, @NonNull @NonNull Map<String,String> parameters)
    • convertRequestBody

      protected TabbyWebhookEvent convertRequestBody(@NonNull @NonNull String requestBody)
    • isSupportedEvent

      protected boolean isSupportedEvent(@NonNull @NonNull TabbyWebhookEvent webhookEvent)
    • getTransactionIdentifier

      protected com.broadleafcommerce.paymentgateway.domain.TransactionIdentifier getTransactionIdentifier(@NonNull @NonNull TabbyWebhookEvent tabbyWebhookEvent, @NonNull @NonNull Map<String,String> parameters)
    • convertToPaymentResponse

      protected com.broadleafcommerce.paymentgateway.domain.PaymentResponse convertToPaymentResponse(@NonNull @NonNull TabbyWebhookEvent tabbyWebhookEvent, @NonNull @NonNull String requestBody)
    • getTransactionAmount

      protected javax.money.MonetaryAmount getTransactionAmount(@NonNull @NonNull TabbyWebhookEvent tabbyWebhookEvent)
    • getTransactionType

      protected com.broadleafcommerce.paymentgateway.domain.enums.TransactionType getTransactionType(@NonNull @NonNull TabbyWebhookEvent tabbyWebhookEvent)
    • getGatewayTransactionType

      protected String getGatewayTransactionType(@NonNull @NonNull TabbyWebhookEvent tabbyWebhookEvent)
    • getGatewayTransactionId

      protected String getGatewayTransactionId(@NonNull @NonNull TabbyWebhookEvent tabbyWebhookEvent)
    • getWebhookType

      protected String getWebhookType(@NonNull @NonNull TabbyWebhookEvent tabbyWebhookEvent)
    • buildGatewayTransactionId

      protected String buildGatewayTransactionId(@NonNull @NonNull String tabbyPaymentId, @NonNull @NonNull TabbyPaymentStatus targetPaymentStatus)
    • getConfigurationProperties

      protected TabbyConfigurationProperties getConfigurationProperties()
    • getTypeFactory

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

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