Interface PaymentTransactionExecutionService<P extends BillingProcessingRequest>
- All Known Implementing Classes:
DefaultPaymentTransactionExecutionService
public interface PaymentTransactionExecutionService<P extends BillingProcessingRequest>
Simple abstraction for executing payment transactions based on a provided
BillingProcessingRequest. The expectation is that the implementation executes the
necessary transaction & populates the relevant fields on the
BillingProcessingRequest.currentAccountProcessingRequest() to communicate the result of
the interaction.- Author:
- Chris Kittrell (ckittrell)
-
Method Summary
Modifier and TypeMethodDescriptionauthorizeAndCapture(P request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Executes an AuthorizeAndCapture (aka Charge) transaction based on the providedBillingProcessingRequestlookupAndRecordTransactionResults(PaymentTransactionDetail paymentTransactionDetail, P request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Looks up transaction results for the providedPaymentTransactionDetail, & if present, stores the transaction results on theBillingProcessingRequest.currentAccountProcessingRequest()Executes a Refund transaction based on the providedBillingProcessingRequest
-
Method Details
-
authorizeAndCapture
P authorizeAndCapture(P request, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Executes an AuthorizeAndCapture (aka Charge) transaction based on the providedBillingProcessingRequest- Parameters:
request- theBillingProcessingRequestdescribing the payment method & amount to be chargedcontextInfo- context information around multi-tenant state- Returns:
- The
BillingProcessingRequestthat includes details about the transaction result populated in the fields ofBillingProcessingRequest.currentAccountProcessingRequest() - Throws:
DuplicateTransactionAttemptException- if the requested transaction has already been executed
-
refund
P refund(P request, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Executes a Refund transaction based on the providedBillingProcessingRequest- Parameters:
request- theBillingProcessingRequestdescribing the payment method & amount to be refundedcontextInfo- context information around multi-tenant state- Returns:
- The
BillingProcessingRequestthat includes details about the transaction result populated in the fields ofBillingProcessingRequest.currentAccountProcessingRequest() - Throws:
DuplicateTransactionAttemptException- if the requested transaction has already been executed
-
lookupAndRecordTransactionResults
P lookupAndRecordTransactionResults(PaymentTransactionDetail paymentTransactionDetail, P request, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Looks up transaction results for the providedPaymentTransactionDetail, & if present, stores the transaction results on theBillingProcessingRequest.currentAccountProcessingRequest()- Parameters:
paymentTransactionDetail- The transaction whose result is unknown, & therefore needs to be looked uprequest- theBillingProcessingRequestdescribing the payment method & amount that was expected to be charged or refundedcontextInfo- context information around multi-tenant state- Returns:
- The
BillingProcessingRequestthat includes details about the transaction result populated in the fields ofBillingProcessingRequest.currentAccountProcessingRequest(), if the transaction results are found
-