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 StoreCreditTransactionExecutionRequestbuildStoreCreditTransactionExecutionRequest(@NonNull StoreCreditPaymentRequest creditAccountPaymentRequest) com.broadleafcommerce.paymentgateway.domain.PaymentResponsecall(@NonNull StoreCreditPaymentRequest paymentRequest) Method to process and call the external gateway service.com.broadleafcommerce.paymentgateway.domain.PaymentResponsecommunicateWithVendor(@NonNull StoreCreditPaymentRequest creditAccountPaymentRequest) protected StoreCreditTransactionExecutionResponseexecuteCreditTransaction(@NonNull StoreCreditTransactionExecutionRequest request, @NonNull String creditAccountNumber, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected StoreCreditTransactionExecutionResponseexecuteDebitTransaction(@NonNull StoreCreditTransactionExecutionRequest request, @NonNull String creditAccountNumber, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected StoreCreditConfigurationprotected com.broadleafcommerce.data.tracking.core.context.ContextInfogetContextInfo(@NonNull com.broadleafcommerce.data.tracking.core.type.OperationType operationType, @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected StringgetCreditAccountNumber(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected com.broadleafcommerce.paymentgateway.util.PaymentResponseUtilprotected StringgetRequestId(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected StringgetSource(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected StringgetSourceEntityId(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected StringgetSourceEntityType(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected StoreCreditTransactionExecutionProviderprotected com.broadleafcommerce.common.extension.TypeFactoryMethods 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:
communicateWithVendorin classcom.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall<StoreCreditPaymentRequest,com.broadleafcommerce.paymentgateway.domain.PaymentResponse>
-
getFailureReportingThreshold
- Specified by:
getFailureReportingThresholdin interfacecom.broadleafcommerce.paymentgateway.service.FailureCountExposable- Specified by:
getFailureReportingThresholdin classcom.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall<StoreCreditPaymentRequest,com.broadleafcommerce.paymentgateway.domain.PaymentResponse>
-
getServiceName
- Specified by:
getServiceNamein interfacecom.broadleafcommerce.paymentgateway.vendor.service.monitor.ServiceStatusDetectable<StoreCreditPaymentRequest>
-
call
public com.broadleafcommerce.paymentgateway.domain.PaymentResponse call(@NonNull @NonNull StoreCreditPaymentRequest paymentRequest) Description copied from interface:StoreCreditExternalCallServiceMethod to process and call the external gateway service. It delegates the request to communicateWithVendor method through abstraction.- Specified by:
callin 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()
-