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 Summary
FieldsModifier and TypeFieldDescriptionprotected CheckoutServiceprotected PaymentResponseDTOToEntityServiceprotected OrderPaymentServiceprotected OrderServiceprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapplyPaymentToOrder(PaymentResponseDTO responseDTO, PaymentGatewayConfiguration config) protected voidThis 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.initiateCheckout(Long orderId) booleanlookupOrderNumberFromOrderId(PaymentResponseDTO responseDTO) voidmarkPaymentAsInvalid(Long orderPaymentId) voidsetUseBillingAddressFromGateway(boolean useBillingAddressFromGateway)
-
Field Details
-
orderService
-
orderPaymentService
-
checkoutService
-
dtoToEntityService
-
useBillingAddressFromGateway
@Value("${default.payment.gateway.checkout.useGatewayBillingAddress}") protected boolean useBillingAddressFromGateway
-
-
Constructor Details
-
DefaultPaymentGatewayCheckoutService
public DefaultPaymentGatewayCheckoutService()
-
-
Method Details
-
applyPaymentToOrder
- Specified by:
applyPaymentToOrderin interfacePaymentGatewayCheckoutService
-
handleUnsuccessfulTransaction
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
- Specified by:
markPaymentAsInvalidin interfacePaymentGatewayCheckoutService
-
initiateCheckout
- Specified by:
initiateCheckoutin interfacePaymentGatewayCheckoutService- Throws:
Exception
-
lookupOrderNumberFromOrderId
- Specified by:
lookupOrderNumberFromOrderIdin interfacePaymentGatewayCheckoutService
-
isUseBillingAddressFromGateway
public boolean isUseBillingAddressFromGateway() -
setUseBillingAddressFromGateway
public void setUseBillingAddressFromGateway(boolean useBillingAddressFromGateway)
-