public abstract class PaymentGatewayAbstractController extends BroadleafAbstractController
Abstract controller that provides convenience methods and resource declarations for Payment Gateway Operations that are shared between all gateway controllers belong here.
The Core Framework should have an implementation of a "blPaymentGatewayCheckoutService" bean defined. If you are using the common jars without the framework dependency, you will either have to implement the blPaymentGatewayCheckoutService yourself, or override the applyPaymentToOrder and the markPaymentAsInvalid methods accordingly.
Modifier and Type | Field and Description |
---|---|
protected static String |
baseCartRedirect |
protected static String |
baseConfirmationRedirect |
protected static String |
baseErrorView |
protected static String |
baseOrderReviewRedirect |
protected static String |
baseRedirect |
protected static org.apache.commons.logging.Log |
LOG |
static String |
PAYMENT_PROCESSING_ERROR |
protected PaymentGatewayCheckoutService |
paymentGatewayCheckoutService |
protected static String |
processingErrorMessage |
protected PaymentGatewayWebResponsePrintService |
webResponsePrintService |
Constructor and Description |
---|
PaymentGatewayAbstractController() |
Modifier and Type | Method and Description |
---|---|
Long |
applyPaymentToOrder(PaymentResponseDTO responseDTO) |
abstract String |
errorEndpoint(org.springframework.ui.Model model,
javax.servlet.http.HttpServletRequest request,
org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes,
Map<String,String> pathVars) |
String |
getBaseConfirmationRedirect() |
protected String |
getCartViewRedirect() |
abstract PaymentGatewayConfiguration |
getConfiguration() |
protected String |
getConfirmationViewRedirect(String orderNumber) |
protected String |
getErrorViewRedirect() |
abstract String |
getGatewayContextKey() |
String |
getOrderReviewRedirect() |
static String |
getProcessingErrorMessage() |
abstract PaymentGatewayWebResponseService |
getWebResponseService() |
abstract void |
handleProcessingException(Exception e,
org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) |
abstract void |
handleUnsuccessfulTransaction(org.springframework.ui.Model model,
org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes,
PaymentResponseDTO responseDTO) |
String |
initiateCheckout(Long orderId) |
String |
lookupOrderNumberFromOrderId(PaymentResponseDTO responseDTO) |
String |
process(org.springframework.ui.Model model,
javax.servlet.http.HttpServletRequest request,
org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
try {
translate http request to DTO
apply payment to order
check success and validity of response
if (complete checkout on callback == true)
initiateCheckout(order id);
else
show review page;
} catch (Exception e) {
notify admin user of failure
handle processing exception
}
|
abstract String |
returnEndpoint(org.springframework.ui.Model model,
javax.servlet.http.HttpServletRequest request,
org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes,
Map<String,String> pathVars) |
addDeepLink, getContextPath, isAjaxRequest, jsonResponse
protected static final org.apache.commons.logging.Log LOG
public static final String PAYMENT_PROCESSING_ERROR
protected static String baseRedirect
protected static String baseErrorView
protected static String baseOrderReviewRedirect
protected static String baseConfirmationRedirect
protected static String baseCartRedirect
protected static String processingErrorMessage
@Autowired(required=false) @Qualifier(value="blPaymentGatewayCheckoutService") protected PaymentGatewayCheckoutService paymentGatewayCheckoutService
protected PaymentGatewayWebResponsePrintService webResponsePrintService
public Long applyPaymentToOrder(PaymentResponseDTO responseDTO) throws IllegalArgumentException
IllegalArgumentException
public String lookupOrderNumberFromOrderId(PaymentResponseDTO responseDTO)
public String process(org.springframework.ui.Model model, javax.servlet.http.HttpServletRequest request, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) throws PaymentException
PaymentException
public abstract void handleProcessingException(Exception e, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) throws PaymentException
PaymentException
public abstract void handleUnsuccessfulTransaction(org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes, PaymentResponseDTO responseDTO) throws PaymentException
PaymentException
public abstract String getGatewayContextKey()
public abstract PaymentGatewayWebResponseService getWebResponseService()
public abstract PaymentGatewayConfiguration getConfiguration()
public abstract String returnEndpoint(org.springframework.ui.Model model, javax.servlet.http.HttpServletRequest request, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes, Map<String,String> pathVars) throws PaymentException
PaymentException
public abstract String errorEndpoint(org.springframework.ui.Model model, javax.servlet.http.HttpServletRequest request, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes, Map<String,String> pathVars) throws PaymentException
PaymentException
protected String getErrorViewRedirect()
protected String getCartViewRedirect()
public String getOrderReviewRedirect()
public String getBaseConfirmationRedirect()
public static String getProcessingErrorMessage()
Copyright © 2017. All rights reserved.