Interface PaymentTransactionExecutionProvider

All Known Implementing Classes:
ExternalPaymentTransactionExecutionProvider

public interface PaymentTransactionExecutionProvider
Provider for interfacing with a PaymentTransactionService's APIs to execute payment transactions.
Author:
Chris Kittrell (ckittrell)
  • Method Details

    • authorizeAndCapture

      TransactionExecutionResponse authorizeAndCapture(String savedPaymentMethodId, SavedPaymentMethodTransactionExecutionRequest request, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Authorize and Captures an amount described by the SavedPaymentMethodTransactionExecutionRequest against the saved payment method described by the provided savedPaymentMethodId.

      Note: The combination of savedPaymentMethodId & SavedPaymentMethodTransactionExecutionRequest.getRequestId() are used to describe the uniqueness of the attempted interaction. This combination must be unique, or the request will be rejected.

      Parameters:
      savedPaymentMethodId - The id of a saved payment method stored in PaymentTransactionServices
      request - The request payload describing the transaction that is to be executed
      contextInfo - context information around the multi-tenant state
      Returns:
      the TransactionExecutionResponse for the AuthorizeAndCapture transaction
    • refund

      TransactionExecutionResponse refund(String paymentId, TransactionExecutionRequest request, String paymentVersion, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Refunds an amount for the given payment.

      This method assumes that the parent transaction of this execution belongs to the same source entity, hence using sourceEntityType as parentSourceEntityType.

      Parameters:
      paymentId - the id of the PaymentTransactionServices Payment that was created as part of the AuthorizeAndCapture transaction using a saved payment method
      request - the TransactionExecutionRequest to execute
      paymentVersion - the known version of the PaymentTransactionServices Payment. Note: If this value is out-of-date (i.e. the Payment has since been updated or a transaction has been executed), then the BillingService could be making an incorrect decision about executing a refund.
      contextInfo - context information around the multi-tenant state
      Returns:
      the TransactionExecutionResponse for the Refund transaction
    • lookupAuthAndCaptureTransactionResults

      Optional<TransactionExecutionResponse> lookupAuthAndCaptureTransactionResults(String savedPaymentMethodId, String requestId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Using the provided savedPaymentMethodId & requestId (must match the requestId provided in the attempted AuthorizeAndCapture transaction) to lookup transaction results for the transaction.
      Parameters:
      savedPaymentMethodId - The id of a saved payment method stored in PaymentTransactionServices
      requestId - The request id provided via SavedPaymentMethodTransactionExecutionRequest.getRequestId() with the attempted AuthorizeAndCapture transaction
      contextInfo - context information around the multi-tenant state
      Returns:
      an optional containing the results of the AuthorizeAndCapture transaction, if they can be found
    • lookupRefundTransactionResults

      Optional<TransactionExecutionResponse> lookupRefundTransactionResults(String paymentId, String requestId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Using the provided paymentId & requestId (must match the requestId provided in the attempted Refund transaction) to lookup transaction results for the transaction.
      Parameters:
      paymentId - The id of a Payment in PaymentTransactionServices
      requestId - The request id provided via SavedPaymentMethodTransactionExecutionRequest.getRequestId() with the attempted Refund transaction
      contextInfo - context information around the multi-tenant state
      Returns:
      an optional containing the results of the Refund transaction, if they can be found