Class BroadleafPayPalCheckoutController
java.lang.Object
org.broadleafcommerce.common.web.controller.BroadleafAbstractController
org.broadleafcommerce.common.web.payment.controller.PaymentGatewayAbstractController
org.broadleafcommerce.vendor.paypal.web.controller.BroadleafPayPalCheckoutController
@Controller("blPayPalCheckoutController")
@RequestMapping("/paypal-checkout")
public class BroadleafPayPalCheckoutController
extends org.broadleafcommerce.common.web.payment.controller.PaymentGatewayAbstractController
- Author:
- Elbert Bautista (elbertbautista)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected org.broadleafcommerce.common.payment.service.PaymentGatewayConfigurationprotected org.broadleafcommerce.common.payment.service.PaymentGatewayHostedServiceprotected org.broadleafcommerce.common.payment.service.PaymentGatewayWebResponseServiceprotected PayPalPaymentServiceFields inherited from class org.broadleafcommerce.common.web.payment.controller.PaymentGatewayAbstractController
baseCartRedirect, baseConfirmationRedirect, baseErrorView, baseOrderReviewRedirect, baseRedirect, cartReqAttributeNotProvidedMessage, PAYMENT_PROCESSING_ERROR, paymentGatewayCheckoutService, processingErrorMessage, webResponsePrintService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncancelEndpoint(org.springframework.ui.Model model, jakarta.servlet.http.HttpServletRequest request, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes, Map<String, String> pathVars) Completes checkout for a PayPalOrder.createOrder(Boolean performCheckout) createOrderHostedJson(jakarta.servlet.http.HttpServletRequest request, Boolean performCheckout) errorEndpoint(org.springframework.ui.Model model, jakarta.servlet.http.HttpServletRequest request, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes, Map<String, String> pathVars) protected StringgetApprovalLink(com.paypal.orders.Order order) org.broadleafcommerce.common.payment.service.PaymentGatewayConfigurationorg.broadleafcommerce.common.payment.service.PaymentGatewayWebResponseServicevoidhandleProcessingException(Exception e, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) voidhandleUnsuccessfulTransaction(org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes, org.broadleafcommerce.common.payment.dto.PaymentResponseDTO responseDTO) returnEndpoint(org.springframework.ui.Model model, jakarta.servlet.http.HttpServletRequest request, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes, Map<String, String> pathVars) Methods inherited from class org.broadleafcommerce.common.web.payment.controller.PaymentGatewayAbstractController
applyPaymentToOrder, getBaseConfirmationRedirect, getCartReqAttributeNotProvidedMessage, getCartViewRedirect, getConfirmationViewRedirect, getErrorViewRedirect, getOrderReviewRedirect, getProcessingErrorMessage, initiateCheckout, lookupOrderNumberFromOrderId, processMethods inherited from class org.broadleafcommerce.common.web.controller.BroadleafAbstractController
addDeepLink, getContextPath, isAjaxRequest, jsonResponse
-
Field Details
-
GATEWAY_CONTEXT_KEY
- See Also:
-
paymentGatewayWebResponseService
protected org.broadleafcommerce.common.payment.service.PaymentGatewayWebResponseService paymentGatewayWebResponseService -
paymentGatewayHostedService
protected org.broadleafcommerce.common.payment.service.PaymentGatewayHostedService paymentGatewayHostedService -
paymentGatewayConfiguration
protected org.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration paymentGatewayConfiguration -
paymentService
-
-
Constructor Details
-
BroadleafPayPalCheckoutController
public BroadleafPayPalCheckoutController()
-
-
Method Details
-
handleProcessingException
public void handleProcessingException(Exception e, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) throws org.broadleafcommerce.common.vendor.service.exception.PaymentException - Specified by:
handleProcessingExceptionin classorg.broadleafcommerce.common.web.payment.controller.PaymentGatewayAbstractController- Throws:
org.broadleafcommerce.common.vendor.service.exception.PaymentException
-
handleUnsuccessfulTransaction
public void handleUnsuccessfulTransaction(org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes, org.broadleafcommerce.common.payment.dto.PaymentResponseDTO responseDTO) throws org.broadleafcommerce.common.vendor.service.exception.PaymentException - Specified by:
handleUnsuccessfulTransactionin classorg.broadleafcommerce.common.web.payment.controller.PaymentGatewayAbstractController- Throws:
org.broadleafcommerce.common.vendor.service.exception.PaymentException
-
getGatewayContextKey
- Specified by:
getGatewayContextKeyin classorg.broadleafcommerce.common.web.payment.controller.PaymentGatewayAbstractController
-
getWebResponseService
public org.broadleafcommerce.common.payment.service.PaymentGatewayWebResponseService getWebResponseService()- Specified by:
getWebResponseServicein classorg.broadleafcommerce.common.web.payment.controller.PaymentGatewayAbstractController
-
getConfiguration
public org.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration getConfiguration()- Specified by:
getConfigurationin classorg.broadleafcommerce.common.web.payment.controller.PaymentGatewayAbstractController
-
returnEndpoint
@RequestMapping(value="/return", method=GET) public String returnEndpoint(org.springframework.ui.Model model, jakarta.servlet.http.HttpServletRequest request, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes, @PathVariable Map<String, String> pathVars) throws org.broadleafcommerce.common.vendor.service.exception.PaymentException- Specified by:
returnEndpointin classorg.broadleafcommerce.common.web.payment.controller.PaymentGatewayAbstractController- Throws:
org.broadleafcommerce.common.vendor.service.exception.PaymentException
-
errorEndpoint
@RequestMapping(value="/error", method=GET) public String errorEndpoint(org.springframework.ui.Model model, jakarta.servlet.http.HttpServletRequest request, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes, @PathVariable Map<String, String> pathVars) throws org.broadleafcommerce.common.vendor.service.exception.PaymentException- Specified by:
errorEndpointin classorg.broadleafcommerce.common.web.payment.controller.PaymentGatewayAbstractController- Throws:
org.broadleafcommerce.common.vendor.service.exception.PaymentException
-
cancelEndpoint
@RequestMapping(value="/cancel", method=GET) public String cancelEndpoint(org.springframework.ui.Model model, jakarta.servlet.http.HttpServletRequest request, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes, @PathVariable Map<String, String> pathVars) throws org.broadleafcommerce.common.vendor.service.exception.PaymentException- Throws:
org.broadleafcommerce.common.vendor.service.exception.PaymentException
-
completeCheckout
@RequestMapping(value="/checkout/complete", method=POST) public String completeCheckout() throws org.broadleafcommerce.common.vendor.service.exception.PaymentExceptionCompletes checkout for a PayPalOrder. If there's already a PayPalOrderwe go ahead and make sure the details of theOrderare updated to all of the forms filled out by the customer since they could've updated shipping information, added a promotion, or other various things to the order.- Returns:
- Redirect URL to either add the order and checkout or just checkout
- Throws:
org.broadleafcommerce.common.vendor.service.exception.PaymentException
-
createOrder
@RequestMapping(value="/create-order", method=POST) @ResponseBody public Map<String,String> createOrder(@RequestParam("performCheckout") Boolean performCheckout) throws org.broadleafcommerce.common.vendor.service.exception.PaymentException - Throws:
org.broadleafcommerce.common.vendor.service.exception.PaymentException
-
createOrderHostedJson
@RequestMapping(value="/hosted/create-order", method=POST) public String createOrderHostedJson(jakarta.servlet.http.HttpServletRequest request, @RequestParam("performCheckout") Boolean performCheckout) throws org.broadleafcommerce.common.vendor.service.exception.PaymentException - Throws:
org.broadleafcommerce.common.vendor.service.exception.PaymentException
-
getApprovalLink
-