Class DefaultTaxCalculationHandlerService<P extends BillingProcessingRequestWithBillingEventDTO>
java.lang.Object
com.broadleafcommerce.billing.job.service.impl.DefaultTaxCalculationHandlerService<P>
- All Implemented Interfaces:
TaxCalculationHandlerService<P>
public class DefaultTaxCalculationHandlerService<P extends BillingProcessingRequestWithBillingEventDTO>
extends Object
implements TaxCalculationHandlerService<P>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BillingEventAddressService<BillingEventAddress>protected BillingEventPaymentService<BillingEventPayment,BillingEventPaymentWithEvent, BillingEventDTO, BillingEventPaymentWithTransaction> protected BillingJobPropertiesprotected BillingProcessRequestService<BillingProcessingRequest,BillingProcessingRequestWithFullDetails> protected BillingTaxDetailService<BillingTaxDetail>protected DeadLetterMessageSenderprotected BillingJobMessageSenderprotected com.broadleafcommerce.common.extension.TypeFactory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected BillingEventAddresscreateBillingEventAddress(BillingEventAddress billingEventAddress, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected booleanprotected voidprotected voidvoidprocessSuccessfulTaxResults(List<P> successfulRequests, TaxCalculationProcessingResultHandlerDTO dto) Update fields onsuccessful requestsdepending onBillingJobProperties.isExecuteOnlyTaxCalculation().voidprocessTaxFailureResults(List<P> failureRequests, TaxCalculationProcessingResultHandlerDTO dto) Deprecated.voidprocessTaxGatewayErrorResults(List<P> gatewayErrors, TaxCalculationProcessingResultHandlerDTO dto) Update fields onrequests with errorsdepending on them having more retries.protected voidsendFailedRequestsToDeadLetterQueue(String billingJobId, List<BillingProcessingRequestWithBillingEventDTO> failedRequests, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected PupdateBillingDomainsAfterTaxCalculation(P successfulTaxCalculationRequests, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected voidupdateBillingEventItemsWithTaxDetails(List<BillingEventItemWithTaxDetails> billingEventItemWithTaxDetails, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected voidupdateBillingEventItemWithTaxDetails(BillingEventItemWithTaxDetails billingEventItemWithTaxDetails, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected voidupdateBillingEventPayment(BillingEventPaymentWithTransaction billingEventPaymentWithTransaction, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected voidupdateBillingEventPayments(List<BillingEventPaymentWithTransaction> billingEventPaymentWithTransactions, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected BillingProcessingRequestupdateBillingProcessingRequest(BillingProcessingRequest billingProcessingRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected List<BillingTaxDetail>updateBillingTaxDetails(List<BillingTaxDetail> billingTaxDetails, BillingEventItem billingEventItem, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) voidupdateEntitiesAndSendMessages(TaxCalculationProcessingResultHandlerDTO dto, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) This method updates Billing Job entities and sends messages for next steps after results are finalized by theresult handler.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.billing.job.service.TaxCalculationHandlerService
updateRecordsAndSendMessageForTaxCalculationHandler
-
Field Details
-
sender
-
deadLetterMessageSender
-
billingJobProperties
-
typeFactory
@Autowired protected com.broadleafcommerce.common.extension.TypeFactory typeFactory -
billingEventService
@Autowired protected BillingEventService<BillingEvent,BillingEventDTO, billingEventServiceCreateBillingEventRequest> -
billingEventPaymentService
@Autowired protected BillingEventPaymentService<BillingEventPayment,BillingEventPaymentWithEvent, billingEventPaymentServiceBillingEventDTO, BillingEventPaymentWithTransaction> -
billingEventItemService
@Autowired protected BillingEventItemService<BillingEventItem,BillingEventItemWithTaxDetails> billingEventItemService -
billingTaxDetailService
-
billingEventAddressService
-
billingProcessRequestService
@Autowired protected BillingProcessRequestService<BillingProcessingRequest,BillingProcessingRequestWithFullDetails> billingProcessRequestService
-
-
Constructor Details
-
DefaultTaxCalculationHandlerService
public DefaultTaxCalculationHandlerService()
-
-
Method Details
-
updateEntitiesAndSendMessages
@Transactional public void updateEntitiesAndSendMessages(TaxCalculationProcessingResultHandlerDTO dto, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:TaxCalculationHandlerServiceThis method updates Billing Job entities and sends messages for next steps after results are finalized by theresult handler. It discriminates its behavior depending on a request'sresult. For successful requests, all Billing entities are updated, whereas requests that sustained exceptions may be retried or sent to the DeadLetter queue.- Specified by:
updateEntitiesAndSendMessagesin interfaceTaxCalculationHandlerService<P extends BillingProcessingRequestWithBillingEventDTO>
-
processSuccessfulTaxResults
public void processSuccessfulTaxResults(List<P> successfulRequests, TaxCalculationProcessingResultHandlerDTO dto) Description copied from interface:TaxCalculationHandlerServiceUpdate fields onsuccessful requestsdepending onBillingJobProperties.isExecuteOnlyTaxCalculation(). Then, add requests to a respective list on theDTO- Specified by:
processSuccessfulTaxResultsin interfaceTaxCalculationHandlerService<P extends BillingProcessingRequestWithBillingEventDTO>
-
processTaxFailureResults
@Deprecated(since="1.0.0") public void processTaxFailureResults(List<P> failureRequests, TaxCalculationProcessingResultHandlerDTO dto) Deprecated.- Specified by:
processTaxFailureResultsin interfaceTaxCalculationHandlerService<P extends BillingProcessingRequestWithBillingEventDTO>
-
processTaxGatewayErrorResults
public void processTaxGatewayErrorResults(List<P> gatewayErrors, TaxCalculationProcessingResultHandlerDTO dto) Description copied from interface:TaxCalculationHandlerServiceUpdate fields onrequests with errorsdepending on them having more retries. Then, add requests to a respective list on theDTO.- Specified by:
processTaxGatewayErrorResultsin interfaceTaxCalculationHandlerService<P extends BillingProcessingRequestWithBillingEventDTO>
-
updateBillingDomainsAfterTaxCalculation
-
updateBillingEventPayments
protected void updateBillingEventPayments(List<BillingEventPaymentWithTransaction> billingEventPaymentWithTransactions, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
updateBillingEventPayment
protected void updateBillingEventPayment(BillingEventPaymentWithTransaction billingEventPaymentWithTransaction, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
updateBillingEventItemsWithTaxDetails
protected void updateBillingEventItemsWithTaxDetails(List<BillingEventItemWithTaxDetails> billingEventItemWithTaxDetails, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
updateBillingEventItemWithTaxDetails
protected void updateBillingEventItemWithTaxDetails(BillingEventItemWithTaxDetails billingEventItemWithTaxDetails, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
updateBillingTaxDetails
protected List<BillingTaxDetail> updateBillingTaxDetails(List<BillingTaxDetail> billingTaxDetails, BillingEventItem billingEventItem, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
createBillingEventAddress
protected BillingEventAddress createBillingEventAddress(BillingEventAddress billingEventAddress, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
updateBillingProcessingRequest
protected BillingProcessingRequest updateBillingProcessingRequest(BillingProcessingRequest billingProcessingRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
sendFailedRequestsToDeadLetterQueue
protected void sendFailedRequestsToDeadLetterQueue(String billingJobId, List<BillingProcessingRequestWithBillingEventDTO> failedRequests, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
hasMoreGatewayRetries
-
prepareStatusForOnlyTaxCalculationModules
-
prepareStatusForNonTaxCalculationModules
-