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
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultTabbyWebhookHandler(TabbyConfigurationProperties configurationProperties, com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringbuildGatewayTransactionId(@NonNull String tabbyPaymentId, @NonNull TabbyPaymentStatus targetPaymentStatus) protected TabbyWebhookEventconvertRequestBody(@NonNull String requestBody) protected com.broadleafcommerce.paymentgateway.domain.PaymentResponseconvertToPaymentResponse(@NonNull TabbyWebhookEvent tabbyWebhookEvent, @NonNull String requestBody) 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 StringgetApplicationId(@NonNull Map<String, String> parameters) protected TabbyConfigurationPropertiesprotected StringgetGatewayTransactionId(@NonNull TabbyWebhookEvent tabbyWebhookEvent) protected StringgetGatewayTransactionType(@NonNull TabbyWebhookEvent tabbyWebhookEvent) protected com.fasterxml.jackson.databind.ObjectMapperprotected StringgetTenantId(@NonNull Map<String, String> parameters) protected javax.money.MonetaryAmountgetTransactionAmount(@NonNull TabbyWebhookEvent tabbyWebhookEvent) protected com.broadleafcommerce.paymentgateway.domain.TransactionIdentifiergetTransactionIdentifier(@NonNull TabbyWebhookEvent tabbyWebhookEvent, @NonNull Map<String, String> parameters) protected com.broadleafcommerce.paymentgateway.domain.enums.TransactionTypegetTransactionType(@NonNull TabbyWebhookEvent tabbyWebhookEvent) protected com.broadleafcommerce.common.extension.TypeFactoryprotected StringgetWebhookType(@NonNull TabbyWebhookEvent tabbyWebhookEvent) protected booleanisSignatureValid(@NonNull org.springframework.http.HttpHeaders headers, @NonNull Map<String, String> parameters) protected booleanisSupportedEvent(@NonNull TabbyWebhookEvent webhookEvent) 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, buildSuccessfulWebhookResponse, convertToPaymentResponse, getEventId, shouldHandleRequest, validate
-
Field Details
-
WEBHOOK_SIGNATURE_HEADER
- See Also:
-
-
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:
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
-
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
-
getSupportedWebhookNotificationTypes
- Specified by:
getSupportedWebhookNotificationTypesin interfacecom.broadleafcommerce.paymentgateway.service.PaymentGatewayWebhookHandler
-
getGatewayType
- Specified by:
getGatewayTypein interfacecom.broadleafcommerce.paymentgateway.service.PaymentGatewayTypeAware
-
getApplicationId
-
getTenantId
-
isSignatureValid
-
convertRequestBody
-
isSupportedEvent
-
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
-
getGatewayTransactionId
-
getWebhookType
-
buildGatewayTransactionId
protected String buildGatewayTransactionId(@NonNull @NonNull String tabbyPaymentId, @NonNull @NonNull TabbyPaymentStatus targetPaymentStatus) -
getConfigurationProperties
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getObjectMapper
protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
-