Class DefaultPaymentGatewayCheckoutService

java.lang.Object
org.broadleafcommerce.core.payment.service.DefaultPaymentGatewayCheckoutService
All Implemented Interfaces:
PaymentGatewayCheckoutService

@Service("blPaymentGatewayCheckoutService") public class DefaultPaymentGatewayCheckoutService extends Object implements PaymentGatewayCheckoutService
Core framework implementation of the PaymentGatewayCheckoutService.
Author:
Phillip Verheyden (phillipuniverse)
  • Field Details

    • orderService

      protected OrderService orderService
    • orderPaymentService

      protected OrderPaymentService orderPaymentService
    • checkoutService

      protected CheckoutService checkoutService
    • dtoToEntityService

      protected PaymentResponseDTOToEntityService dtoToEntityService
    • useBillingAddressFromGateway

      @Value("${default.payment.gateway.checkout.useGatewayBillingAddress}") protected boolean useBillingAddressFromGateway
  • Constructor Details

    • DefaultPaymentGatewayCheckoutService

      public DefaultPaymentGatewayCheckoutService()
  • Method Details

    • applyPaymentToOrder

      public Long applyPaymentToOrder(PaymentResponseDTO responseDTO, PaymentGatewayConfiguration config)
      Specified by:
      applyPaymentToOrder in interface PaymentGatewayCheckoutService
    • handleUnsuccessfulTransaction

      protected void handleUnsuccessfulTransaction(OrderPayment payment)
      This default implementation will mark the entire payment as invalid and boot the user to re-enter their billing info and payment information as there may be an error with either the billing address or credit card. This is the safest method, because depending on the implementation of the Gateway, we may not know exactly where the error occurred (e.g. Address Verification enabled, etc...) So, we will assume that the error invalidates the entire Order Payment, and the customer will have to re-enter their billing and credit card information to be processed again.
      Parameters:
      payment -
    • markPaymentAsInvalid

      public void markPaymentAsInvalid(Long orderPaymentId)
      Specified by:
      markPaymentAsInvalid in interface PaymentGatewayCheckoutService
    • initiateCheckout

      public String initiateCheckout(Long orderId) throws Exception
      Specified by:
      initiateCheckout in interface PaymentGatewayCheckoutService
      Throws:
      Exception
    • lookupOrderNumberFromOrderId

      public String lookupOrderNumberFromOrderId(PaymentResponseDTO responseDTO)
      Specified by:
      lookupOrderNumberFromOrderId in interface PaymentGatewayCheckoutService
    • isUseBillingAddressFromGateway

      public boolean isUseBillingAddressFromGateway()
    • setUseBillingAddressFromGateway

      public void setUseBillingAddressFromGateway(boolean useBillingAddressFromGateway)