Class ExternalPaymentTransactionCallbackEndpoint
java.lang.Object
com.broadleafcommerce.cartoperation.web.endpoint.ExternalPaymentTransactionCallbackEndpoint
@FrameworkRestController
@FrameworkMapping("/checkout/{cartId}/payment-callback/{gatewayType}")
@DataRouteByKey("cartoperation")
@ConditionalOnProperty(value="broadleaf.payment.legacy-external-payment-pattern-enabled",
havingValue="false",
matchIfMissing=true)
public class ExternalPaymentTransactionCallbackEndpoint
extends Object
- Author:
- Dima Myroniuk (dmyroniuk)
-
Field Summary
-
Constructor Summary
ConstructorDescriptionExternalPaymentTransactionCallbackEndpoint
(ExternalPaymentTransactionCallbackService externalPaymentTransactionCallbackService, ExternalPaymentTransactionCallbackRedirectionProperties callbackRedirectionProperties, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addValidationErrorRedirectAttribute
(org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) protected ExternalPaymentTransactionCallbackDTO
buildCallbackDTO
(@NonNull String cartId, @NonNull String gatewayType, @NonNull Map<String, Object> requestBody, @NonNull Map<String, String> requestParams) protected com.broadleafcommerce.data.tracking.core.context.ContextInfo
buildContextInfo
(@NonNull com.broadleafcommerce.data.tracking.core.type.OperationType operationType, @NonNull Map<String, Object> requestBody, @NonNull Map<String, String> requestParams) protected org.springframework.web.servlet.ModelAndView
externalPaymentTransactionCallbackGet
(String cartId, String gatewayType, Map<String, String> requestParams, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) protected org.springframework.web.servlet.ModelAndView
externalPaymentTransactionCallbackPost
(String cartId, String gatewayType, Map<String, String> requestParams, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) protected String
protected String
getApplicationIdFromContext
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected com.fasterxml.jackson.databind.ObjectMapper
protected String
getRedirectUri
(@NonNull ExternalPaymentTransactionCallbackDTO callbackDTO, String applicationId, String tenantId) protected String
getRedirectUrl
(@NonNull ExternalPaymentTransactionCallbackDTO callbackDTO, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) getRequestBody
(@NonNull jakarta.servlet.http.HttpServletRequest request) protected String
getStorefrontBaseUrl
(@NonNull ExternalPaymentTransactionCallbackDTO callbackDTO, String applicationId, String tenantId) protected String
protected String
getTenantIdFromContext
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected com.broadleafcommerce.common.extension.TypeFactory
protected void
hydrateRedirectAttributes
(@NonNull org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes, @NonNull ExternalPaymentTransactionCallbackDTO callbackDTO) Hook point to hydrate any additional attributes before redirecting to the frontend.
-
Field Details
-
BASE_URI
- See Also:
-
STOREFRONT_REDIRECT_PARAM
- See Also:
-
TENANT_ID
- See Also:
-
APPLICATION_ID
- See Also:
-
INVALID_CALLBACK_REQUEST
- See Also:
-
ERROR_ATTR
- See Also:
-
-
Constructor Details
-
ExternalPaymentTransactionCallbackEndpoint
public ExternalPaymentTransactionCallbackEndpoint(ExternalPaymentTransactionCallbackService externalPaymentTransactionCallbackService, ExternalPaymentTransactionCallbackRedirectionProperties callbackRedirectionProperties, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
Method Details
-
externalPaymentTransactionCallbackGet
@FrameworkGetMapping protected org.springframework.web.servlet.ModelAndView externalPaymentTransactionCallbackGet(@PathVariable String cartId, @PathVariable String gatewayType, @RequestParam(required=false) Map<String, String> requestParams, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) -
externalPaymentTransactionCallbackPost
@FrameworkPostMapping protected org.springframework.web.servlet.ModelAndView externalPaymentTransactionCallbackPost(@PathVariable String cartId, @PathVariable String gatewayType, @RequestParam(required=false) Map<String, String> requestParams, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) -
buildCallbackDTO
-
buildContextInfo
-
getTenantId
-
getApplicationId
-
getRequestBody
-
hydrateRedirectAttributes
protected void hydrateRedirectAttributes(@NonNull @NonNull org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes, @NonNull @NonNull ExternalPaymentTransactionCallbackDTO callbackDTO) Hook point to hydrate any additional attributes before redirecting to the frontend.- Parameters:
redirectAttributes
- The redirect attributes of this requestcallbackDTO
- Additional attributes to add to the redirect attributes
-
addValidationErrorRedirectAttribute
protected void addValidationErrorRedirectAttribute(org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) -
getRedirectUrl
protected String getRedirectUrl(@NonNull @NonNull ExternalPaymentTransactionCallbackDTO callbackDTO, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
getStorefrontBaseUrl
protected String getStorefrontBaseUrl(@NonNull @NonNull ExternalPaymentTransactionCallbackDTO callbackDTO, @Nullable String applicationId, @Nullable String tenantId) -
getRedirectUri
protected String getRedirectUri(@NonNull @NonNull ExternalPaymentTransactionCallbackDTO callbackDTO, @Nullable String applicationId, @Nullable String tenantId) -
getApplicationIdFromContext
@Nullable protected String getApplicationIdFromContext(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
getTenantIdFromContext
@Nullable protected String getTenantIdFromContext(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
getExternalPaymentTransactionCallbackService
-
getCallbackRedirectionProperties
protected ExternalPaymentTransactionCallbackRedirectionProperties getCallbackRedirectionProperties() -
getObjectMapper
protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper() -
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
-