Interface ExternalTransactionResultService

All Known Implementing Classes:
DefaultExternalTransactionResultService

public interface ExternalTransactionResultService
The service to check the external payment transaction result.
Author:
Sgupta
  • Method Details

    • identifyTransactionRequiringExternalInteraction

      PaymentTransaction identifyTransactionRequiringExternalInteraction(@NonNull @NonNull Payment payment, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Finds the transaction that required external results.
      Parameters:
      payment - the payment object that contains a reference to the required transaction
      context - context information related to multitenancy
      Returns:
      the transaction that required external results
      Throws:
      TransactionIdentificationException - if a transaction requiring external interaction cannot be found
    • lookupAndRecordExternalTransactionResult

      TransactionExecutionResponse lookupAndRecordExternalTransactionResult(@NonNull @NonNull Payment payment, @NonNull @NonNull PaymentTransaction transactionRequiringExternal, @Nullable String lockToken, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Reads the transaction result using PaymentGatewayTransactionLookupService, records the result to the appropriate transaction and payment.

      This can be used, for example, to verify that a customer has approved a payment for transactions that requires to add bank details.

      Parameters:
      payment - the payment gateway type that is used to identify the appropriate PaymentGatewayTransactionLookupService
      transactionRequiringExternal - the transaction that requires external results
      lockToken - Token granted to resource that owns the payment lock.
      context - context information related to multitenancy
      Returns:
      the TransactionExecutionResponse describing the resulting transaction and PaymentSummary
      Throws:
      UnsupportedOperationException - when looking up transaction results is not supported for the related payment gateway
      com.broadleafcommerce.paymentgateway.service.exception.InvalidGatewayConfigurationException - when the integration is not sufficiently configured to look up transaction results
      com.broadleafcommerce.paymentgateway.service.exception.InvalidFetchPaymentDetailsParamsException - when insufficient data is provided to look up transaction results
      com.broadleafcommerce.paymentgateway.service.exception.FetchTransactionResultsException - when an error occurred while looking up transaction results
      com.broadleafcommerce.paymentgateway.service.exception.TransactionNotFoundException - when a transaction cannot be found, based on the provided data
      com.broadleafcommerce.paymentgateway.service.exception.TransactionResultsNotAvailableException - when the external transaction results are not yet available
      com.broadleafcommerce.common.messaging.exception.ResourceLockException - when a payment lock cannot be obtained to record 3DS transaction results
    • validatePaymentCallbackToken

      PaymentCallbackValidationResponse validatePaymentCallbackToken(org.springframework.data.domain.Page<Payment> payments, PaymentCallbackValidationRequest validationRequest, @Nullable PaymentLockTokens paymentLockTokens, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Validates the callback request and returns the result of that validation.
      Parameters:
      payments - the page of payments for the request
      validationRequest - the callback validation request
      paymentLockTokens - the PaymentLockTokens, if any
      contextInfo - context information related to multitenancy.
      Returns:
      the payment callback validation response
    • handleTransactionResult

      TransactionExecutionResponse handleTransactionResult(@NonNull @NonNull String gatewayType, @NonNull @NonNull Map<String,String> requestParams, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Reads the transaction result using PaymentGatewayTransactionLookupService, records the result to the appropriate transaction and payment.

      This can be used, for example, to verify that a customer has approved a payment for transactions that require to add bank details.

      Parameters:
      gatewayType - the payment gateway type that is used to identify the appropriate PaymentGatewayTransactionLookupService
      requestParams - the parameters for request
      context - context information related to multitenancy
      Returns:
      the TransactionExecutionDetail describing the resulting transaction and PaymentSummary
      Throws:
      UnsupportedOperationException - when looking up transaction results is not supported for the related payment gateway
      com.broadleafcommerce.paymentgateway.service.exception.InvalidGatewayConfigurationException - when the integration is not sufficiently configured to look up transaction results
      com.broadleafcommerce.paymentgateway.service.exception.InvalidFetchPaymentDetailsParamsException - when insufficient data is provided to look up transaction results
      com.broadleafcommerce.paymentgateway.service.exception.FetchTransactionResultsException - when an error occurred while looking up transaction results
      com.broadleafcommerce.paymentgateway.service.exception.TransactionNotFoundException - when a transaction cannot be found, based on the provided data
      com.broadleafcommerce.paymentgateway.service.exception.TransactionResultsNotAvailableException - when the external transaction results are not yet available
      com.broadleafcommerce.common.messaging.exception.ResourceLockException - when a payment lock cannot be obtained to record external transaction results