Class DefaultChaseOrbitalGatewayTransactionService

java.lang.Object
com.broadleafcommerce.payment.service.gateway.DefaultChaseOrbitalGatewayTransactionService
All Implemented Interfaces:
ChaseOrbitalGatewayTransactionService, com.broadleafcommerce.paymentgateway.service.PaymentGatewayTransactionService, com.broadleafcommerce.paymentgateway.service.PaymentGatewayTypeAware

public class DefaultChaseOrbitalGatewayTransactionService extends Object implements ChaseOrbitalGatewayTransactionService
Default implementation of ChaseOrbitalGatewayTransactionService.
  • Constructor Details

    • DefaultChaseOrbitalGatewayTransactionService

      public DefaultChaseOrbitalGatewayTransactionService(OrbitalGatewayExternalCallService orbitalGatewayExternalCallService, com.broadleafcommerce.paymentgateway.util.PaymentResponseUtil paymentResponseUtil, com.broadleafcommerce.common.extension.TypeFactory typeFactory, ChaseIdGenerator chaseIdGenerator)
  • Method Details

    • getGatewayType

      public String getGatewayType()
      Specified by:
      getGatewayType in interface com.broadleafcommerce.paymentgateway.service.PaymentGatewayTypeAware
    • identifyTransactionReferenceIdOverrideForInitialTransaction

      @Nullable public String identifyTransactionReferenceIdOverrideForInitialTransaction(com.broadleafcommerce.paymentgateway.domain.PaymentInfo paymentInfo, @Nullable String applicationId, @Nullable String tenantId)
      Specified by:
      identifyTransactionReferenceIdOverrideForInitialTransaction in interface com.broadleafcommerce.paymentgateway.service.PaymentGatewayTransactionService
    • identifyTransactionReferenceIdOverrideForSubsequentTransactions

      @Nullable public String identifyTransactionReferenceIdOverrideForSubsequentTransactions(String transactionType, com.broadleafcommerce.paymentgateway.domain.PaymentInfo paymentInfo, @Nullable String applicationId, @Nullable String tenantId)
      Specified by:
      identifyTransactionReferenceIdOverrideForSubsequentTransactions in interface com.broadleafcommerce.paymentgateway.service.PaymentGatewayTransactionService
    • authorize

      public com.broadleafcommerce.paymentgateway.domain.PaymentResponse authorize(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest)
      Specified by:
      authorize in interface com.broadleafcommerce.paymentgateway.service.PaymentGatewayTransactionService
    • validateAuthorizeRequest

      @Nullable protected com.broadleafcommerce.paymentgateway.domain.PaymentResponse validateAuthorizeRequest(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest)
      Validates the given request for an authorize(PaymentRequest) transaction.
      Parameters:
      paymentRequest - the request to validate
      Returns:
      a payment response with errors if invalid, or null if valid
    • validatePaymentInstrumentType

      protected void validatePaymentInstrumentType(com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, org.springframework.validation.Errors errors)
    • getPaymentInstrumentType

      @Nullable protected String getPaymentInstrumentType(com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest)
    • getAdditionalFieldString

      @Nullable protected String getAdditionalFieldString(com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, String fieldName)
    • validatePropertiesForCreatedHpsProfile

      protected void validatePropertiesForCreatedHpsProfile(com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, org.springframework.validation.Errors errors)
    • validatePropertiesForApplePay

      protected void validatePropertiesForApplePay(com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, org.springframework.validation.Errors errors)
    • combineAllErrorsIntoSingleMessage

      protected String combineAllErrorsIntoSingleMessage(org.springframework.validation.Errors errors)
      Takes all Errors.getAllErrors() and combines their codes and messages into a single error message.
      Parameters:
      errors - the errors object from which to source errors. This must have errors registered on it.
      Returns:
      a consolidated error message containing all the codes and messages from the provided errors object
    • buildFailureResponse

      protected com.broadleafcommerce.paymentgateway.domain.PaymentResponse buildFailureResponse(com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, com.broadleafcommerce.paymentgateway.domain.enums.TransactionType transactionType, String failureType, String errorMessage)
    • buildOrbitalPaymentRequestWrapper

      protected OrbitalPaymentRequestWrapper buildOrbitalPaymentRequestWrapper(com.broadleafcommerce.paymentgateway.domain.enums.TransactionType transactionType, com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest)
    • handleUnexpectedException

      protected com.broadleafcommerce.paymentgateway.domain.PaymentResponse handleUnexpectedException(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.enums.TransactionType transactionType, @NonNull @NonNull Exception e)
    • getErrorMessageForUnexpectedException

      protected String getErrorMessageForUnexpectedException(Exception e, com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest)
    • determineFailureTypeForUnexpectedException

      protected String determineFailureTypeForUnexpectedException(Exception e)
    • authorizeAndCapture

      public com.broadleafcommerce.paymentgateway.domain.PaymentResponse authorizeAndCapture(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest)
      Specified by:
      authorizeAndCapture in interface com.broadleafcommerce.paymentgateway.service.PaymentGatewayTransactionService
    • validateAuthorizeAndCaptureRequest

      @Nullable protected com.broadleafcommerce.paymentgateway.domain.PaymentResponse validateAuthorizeAndCaptureRequest(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest)
      Validates the given request for an authorizeAndCapture(PaymentRequest) transaction.
      Parameters:
      paymentRequest - the request to validate
      Returns:
      a payment response with errors if invalid, or null if valid
    • capture

      public com.broadleafcommerce.paymentgateway.domain.PaymentResponse capture(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest)
      Specified by:
      capture in interface com.broadleafcommerce.paymentgateway.service.PaymentGatewayTransactionService
    • validateCaptureRequest

      @Nullable protected com.broadleafcommerce.paymentgateway.domain.PaymentResponse validateCaptureRequest(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest)
      Validates the given request for a capture(PaymentRequest) transaction.
      Parameters:
      paymentRequest - the request to validate
      Returns:
      a payment response with errors if invalid, or null if valid
    • validateParentTxRefNumIsPresent

      protected void validateParentTxRefNumIsPresent(String transactionType, com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, org.springframework.validation.Errors errors)
      Validates that MessageConstants.TX_REF_NUM is available on the given paymentRequest. This validation is important for transactions that operate against a previous transaction number.
      Parameters:
      transactionType - the transaction type of the current request
      paymentRequest - the payment request details to validate
      errors - object on which any validation errors can be registered
    • refund

      public com.broadleafcommerce.paymentgateway.domain.PaymentResponse refund(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest)
      Specified by:
      refund in interface com.broadleafcommerce.paymentgateway.service.PaymentGatewayTransactionService
    • validateRefundRequest

      @Nullable protected com.broadleafcommerce.paymentgateway.domain.PaymentResponse validateRefundRequest(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest)
      Validates the given request for a refund(PaymentRequest) transaction.
      Parameters:
      paymentRequest - the request to validate
      Returns:
      a payment response with errors if invalid, or null if valid
    • reverseAuthorize

      public com.broadleafcommerce.paymentgateway.domain.PaymentResponse reverseAuthorize(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest)
      Specified by:
      reverseAuthorize in interface com.broadleafcommerce.paymentgateway.service.PaymentGatewayTransactionService
    • validateReverseAuthorizeRequest

      @Nullable protected com.broadleafcommerce.paymentgateway.domain.PaymentResponse validateReverseAuthorizeRequest(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest)
      Validates the given request for a reverseAuthorize(PaymentRequest) transaction.
      Parameters:
      paymentRequest - the request to validate
      Returns:
      a payment response with errors if invalid, or null if valid
    • getOrbitalGatewayExternalCallService

      protected OrbitalGatewayExternalCallService getOrbitalGatewayExternalCallService()
    • getPaymentResponseUtil

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

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

      protected ChaseIdGenerator getChaseIdGenerator()