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)
-
Field Summary
Fields inherited from class com.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall
failureCount, isUp
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultStoreCreditExternalCallService
(StoreCreditTransactionExecutionProvider storeCreditTransactionExecutionProvider, StoreCreditConfiguration configuration, com.broadleafcommerce.paymentgateway.util.PaymentResponseUtil paymentResponseUtil, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected StoreCreditTransactionExecutionRequest
buildStoreCreditTransactionExecutionRequest
(@NonNull StoreCreditPaymentRequest creditAccountPaymentRequest) com.broadleafcommerce.paymentgateway.domain.PaymentResponse
call
(@NonNull StoreCreditPaymentRequest paymentRequest) Method to process and call the external gateway service.com.broadleafcommerce.paymentgateway.domain.PaymentResponse
communicateWithVendor
(@NonNull StoreCreditPaymentRequest creditAccountPaymentRequest) protected StoreCreditTransactionExecutionResponse
executeCreditTransaction
(@NonNull StoreCreditTransactionExecutionRequest request, @NonNull String creditAccountNumber, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected StoreCreditTransactionExecutionResponse
executeDebitTransaction
(@NonNull StoreCreditTransactionExecutionRequest request, @NonNull String creditAccountNumber, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected StoreCreditConfiguration
protected com.broadleafcommerce.data.tracking.core.context.ContextInfo
getContextInfo
(@NonNull com.broadleafcommerce.data.tracking.core.type.OperationType operationType, @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected String
getCreditAccountNumber
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected com.broadleafcommerce.paymentgateway.util.PaymentResponseUtil
protected String
getRequestId
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected String
getSource
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected String
getSourceEntityId
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected String
getSourceEntityType
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected StoreCreditTransactionExecutionProvider
protected com.broadleafcommerce.common.extension.TypeFactory
Methods inherited from class com.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall
clearStatus, getServiceStatus, incrementFailure, process
-
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 classcom.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall<StoreCreditPaymentRequest,
com.broadleafcommerce.paymentgateway.domain.PaymentResponse>
-
getFailureReportingThreshold
- Specified by:
getFailureReportingThreshold
in interfacecom.broadleafcommerce.paymentgateway.service.FailureCountExposable
- Specified by:
getFailureReportingThreshold
in classcom.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall<StoreCreditPaymentRequest,
com.broadleafcommerce.paymentgateway.domain.PaymentResponse>
-
getServiceName
- Specified by:
getServiceName
in interfacecom.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 interfaceStoreCreditExternalCallService
- 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
-
getConfiguration
-
getPaymentResponseUtil
protected com.broadleafcommerce.paymentgateway.util.PaymentResponseUtil getPaymentResponseUtil() -
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
-