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 Summary
ConstructorsConstructorDescriptionDefaultChaseOrbitalGatewayTransactionService(OrbitalGatewayExternalCallService orbitalGatewayExternalCallService, com.broadleafcommerce.paymentgateway.util.PaymentResponseUtil paymentResponseUtil, com.broadleafcommerce.common.extension.TypeFactory typeFactory, ChaseIdGenerator chaseIdGenerator) -
Method Summary
Modifier and TypeMethodDescriptioncom.broadleafcommerce.paymentgateway.domain.PaymentResponseauthorize(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) com.broadleafcommerce.paymentgateway.domain.PaymentResponseauthorizeAndCapture(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected com.broadleafcommerce.paymentgateway.domain.PaymentResponsebuildFailureResponse(com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, com.broadleafcommerce.paymentgateway.domain.enums.TransactionType transactionType, String failureType, String errorMessage) protected OrbitalPaymentRequestWrapperbuildOrbitalPaymentRequestWrapper(com.broadleafcommerce.paymentgateway.domain.enums.TransactionType transactionType, com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) com.broadleafcommerce.paymentgateway.domain.PaymentResponsecapture(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected StringcombineAllErrorsIntoSingleMessage(org.springframework.validation.Errors errors) Takes allErrors.getAllErrors()and combines their codes and messages into a single error message.protected Stringprotected StringgetAdditionalFieldString(com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, String fieldName) protected ChaseIdGeneratorprotected StringgetErrorMessageForUnexpectedException(Exception e, com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected OrbitalGatewayExternalCallServiceprotected StringgetPaymentInstrumentType(com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected com.broadleafcommerce.paymentgateway.util.PaymentResponseUtilprotected com.broadleafcommerce.common.extension.TypeFactoryprotected com.broadleafcommerce.paymentgateway.domain.PaymentResponsehandleUnexpectedException(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull com.broadleafcommerce.paymentgateway.domain.enums.TransactionType transactionType, @NonNull Exception e) identifyTransactionReferenceIdOverrideForInitialTransaction(com.broadleafcommerce.paymentgateway.domain.PaymentInfo paymentInfo, String applicationId, String tenantId) identifyTransactionReferenceIdOverrideForSubsequentTransactions(String transactionType, com.broadleafcommerce.paymentgateway.domain.PaymentInfo paymentInfo, String applicationId, String tenantId) com.broadleafcommerce.paymentgateway.domain.PaymentResponserefund(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) com.broadleafcommerce.paymentgateway.domain.PaymentResponsereverseAuthorize(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected com.broadleafcommerce.paymentgateway.domain.PaymentResponsevalidateAuthorizeAndCaptureRequest(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) Validates the given request for anauthorizeAndCapture(PaymentRequest)transaction.protected com.broadleafcommerce.paymentgateway.domain.PaymentResponsevalidateAuthorizeRequest(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) Validates the given request for anauthorize(PaymentRequest)transaction.protected com.broadleafcommerce.paymentgateway.domain.PaymentResponsevalidateCaptureRequest(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) Validates the given request for acapture(PaymentRequest)transaction.protected voidvalidateParentTxRefNumIsPresent(String transactionType, com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, org.springframework.validation.Errors errors) Validates thatMessageConstants.TX_REF_NUMis available on the givenpaymentRequest.protected voidvalidatePaymentInstrumentType(com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, org.springframework.validation.Errors errors) protected voidvalidatePropertiesForApplePay(com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, org.springframework.validation.Errors errors) protected voidvalidatePropertiesForCreatedHpsProfile(com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, org.springframework.validation.Errors errors) protected com.broadleafcommerce.paymentgateway.domain.PaymentResponsevalidateRefundRequest(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) Validates the given request for arefund(PaymentRequest)transaction.protected com.broadleafcommerce.paymentgateway.domain.PaymentResponsevalidateReverseAuthorizeRequest(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) Validates the given request for areverseAuthorize(PaymentRequest)transaction.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.paymentgateway.service.PaymentGatewayTransactionService
detachedCredit, identifyParentTransactionReferenceIfExists, identifyTransactionTypeFromTransactionResults
-
Constructor Details
-
DefaultChaseOrbitalGatewayTransactionService
public DefaultChaseOrbitalGatewayTransactionService(OrbitalGatewayExternalCallService orbitalGatewayExternalCallService, com.broadleafcommerce.paymentgateway.util.PaymentResponseUtil paymentResponseUtil, com.broadleafcommerce.common.extension.TypeFactory typeFactory, ChaseIdGenerator chaseIdGenerator)
-
-
Method Details
-
getGatewayType
- Specified by:
getGatewayTypein interfacecom.broadleafcommerce.paymentgateway.service.PaymentGatewayTypeAware
-
identifyTransactionReferenceIdOverrideForInitialTransaction
@Nullable public String identifyTransactionReferenceIdOverrideForInitialTransaction(com.broadleafcommerce.paymentgateway.domain.PaymentInfo paymentInfo, @Nullable String applicationId, @Nullable String tenantId) - Specified by:
identifyTransactionReferenceIdOverrideForInitialTransactionin interfacecom.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:
identifyTransactionReferenceIdOverrideForSubsequentTransactionsin interfacecom.broadleafcommerce.paymentgateway.service.PaymentGatewayTransactionService
-
authorize
public com.broadleafcommerce.paymentgateway.domain.PaymentResponse authorize(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) - Specified by:
authorizein interfacecom.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 anauthorize(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
-
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
Takes allErrors.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
-
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
-
determineFailureTypeForUnexpectedException
-
authorizeAndCapture
public com.broadleafcommerce.paymentgateway.domain.PaymentResponse authorizeAndCapture(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) - Specified by:
authorizeAndCapturein interfacecom.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 anauthorizeAndCapture(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:
capturein interfacecom.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 acapture(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 thatMessageConstants.TX_REF_NUMis available on the givenpaymentRequest. This validation is important for transactions that operate against a previous transaction number.- Parameters:
transactionType- the transaction type of the current requestpaymentRequest- the payment request details to validateerrors- 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:
refundin interfacecom.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 arefund(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:
reverseAuthorizein interfacecom.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 areverseAuthorize(PaymentRequest)transaction.- Parameters:
paymentRequest- the request to validate- Returns:
- a payment response with errors if invalid, or null if valid
-
getOrbitalGatewayExternalCallService
-
getPaymentResponseUtil
protected com.broadleafcommerce.paymentgateway.util.PaymentResponseUtil getPaymentResponseUtil() -
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getChaseIdGenerator
-