Class DefaultStoreCreditExternalCallService

java.lang.Object
com.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall<StoreCreditPaymentRequest,com.broadleafcommerce.paymentgateway.domain.PaymentResponse>
com.broadleafcommerce.payment.service.gateway.DefaultStoreCreditExternalCallService
All Implemented Interfaces:
StoreCreditExternalCallService, com.broadleafcommerce.paymentgateway.service.FailureCountExposable, com.broadleafcommerce.paymentgateway.vendor.service.monitor.ServiceStatusDetectable<StoreCreditPaymentRequest>

public class DefaultStoreCreditExternalCallService extends com.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall<StoreCreditPaymentRequest,com.broadleafcommerce.paymentgateway.domain.PaymentResponse> implements StoreCreditExternalCallService
This class communicates with the Credit Account service APIs to perform transactions.
Author:
Dima Myroniuk (dmyroniuk)
  • Constructor Details

    • DefaultStoreCreditExternalCallService

      public DefaultStoreCreditExternalCallService(StoreCreditTransactionExecutionProvider storeCreditTransactionExecutionProvider, StoreCreditConfiguration configuration, com.broadleafcommerce.paymentgateway.util.PaymentResponseUtil paymentResponseUtil, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
  • Method Details

    • communicateWithVendor

      public com.broadleafcommerce.paymentgateway.domain.PaymentResponse communicateWithVendor(@NonNull @NonNull StoreCreditPaymentRequest creditAccountPaymentRequest)
      Specified by:
      communicateWithVendor in class com.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall<StoreCreditPaymentRequest,com.broadleafcommerce.paymentgateway.domain.PaymentResponse>
    • getFailureReportingThreshold

      public Integer getFailureReportingThreshold()
      Specified by:
      getFailureReportingThreshold in interface com.broadleafcommerce.paymentgateway.service.FailureCountExposable
      Specified by:
      getFailureReportingThreshold in class com.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall<StoreCreditPaymentRequest,com.broadleafcommerce.paymentgateway.domain.PaymentResponse>
    • getServiceName

      public String getServiceName()
      Specified by:
      getServiceName in interface com.broadleafcommerce.paymentgateway.vendor.service.monitor.ServiceStatusDetectable<StoreCreditPaymentRequest>
    • call

      public com.broadleafcommerce.paymentgateway.domain.PaymentResponse call(@NonNull @NonNull StoreCreditPaymentRequest paymentRequest)
      Description copied from interface: StoreCreditExternalCallService
      Method to process and call the external gateway service. It delegates the request to communicateWithVendor method through abstraction.
      Specified by:
      call in interface StoreCreditExternalCallService
      Parameters:
      paymentRequest - The request payload that should be used to form the transaction
      Returns:
      PaymentResponse object that carries the response from the external gateway service
    • executeDebitTransaction

      protected StoreCreditTransactionExecutionResponse executeDebitTransaction(@NonNull @NonNull StoreCreditTransactionExecutionRequest request, @NonNull @NonNull String creditAccountNumber, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • executeCreditTransaction

      protected StoreCreditTransactionExecutionResponse executeCreditTransaction(@NonNull @NonNull StoreCreditTransactionExecutionRequest request, @NonNull @NonNull String creditAccountNumber, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • buildStoreCreditTransactionExecutionRequest

      protected StoreCreditTransactionExecutionRequest buildStoreCreditTransactionExecutionRequest(@NonNull @NonNull StoreCreditPaymentRequest creditAccountPaymentRequest)
    • getSource

      protected String getSource(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest)
    • getSourceEntityType

      protected String getSourceEntityType(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest)
    • getSourceEntityId

      protected String getSourceEntityId(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest)
    • getCreditAccountNumber

      protected String getCreditAccountNumber(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest)
    • getRequestId

      protected String getRequestId(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest)
    • getContextInfo

      protected com.broadleafcommerce.data.tracking.core.context.ContextInfo getContextInfo(@NonNull @NonNull com.broadleafcommerce.data.tracking.core.type.OperationType operationType, @NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest)
    • getStoreCreditTransactionExecutionProvider

      protected StoreCreditTransactionExecutionProvider getStoreCreditTransactionExecutionProvider()
    • getConfiguration

      protected StoreCreditConfiguration getConfiguration()
    • getPaymentResponseUtil

      protected com.broadleafcommerce.paymentgateway.util.PaymentResponseUtil getPaymentResponseUtil()
    • getTypeFactory

      protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()