Class DefaultAdyenExternalCallService
java.lang.Object
com.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall<AdyenPaymentRequest,com.broadleafcommerce.paymentgateway.domain.PaymentResponse>
com.broadleafcommerce.adyen.service.DefaultAdyenExternalCallService
- All Implemented Interfaces:
AdyenExternalCallService
,com.broadleafcommerce.paymentgateway.service.FailureCountExposable
,com.broadleafcommerce.paymentgateway.vendor.service.monitor.ServiceStatusDetectable<AdyenPaymentRequest>
public class DefaultAdyenExternalCallService
extends com.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall<AdyenPaymentRequest,com.broadleafcommerce.paymentgateway.domain.PaymentResponse>
implements AdyenExternalCallService
The default implementation for
AdyenExternalCallService
.-
Field Summary
Fields inherited from class com.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall
failureCount, isUp
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultAdyenExternalCallService
(com.broadleafcommerce.paymentgateway.util.PaymentResponseUtil paymentResponseUtil, AdyenProvider adyenProvider, List<RequestResponseTransformer> requestResponseTransformers, com.fasterxml.jackson.databind.ObjectMapper mapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, ExternalAdyenProviderProperties properties, AdyenConfigurationProperties adyenConfigurationProperties) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.broadleafcommerce.paymentgateway.domain.PaymentResponse
buildPaymentResponse
(@NonNull AdyenPaymentRequest adyenPaymentRequest) com.broadleafcommerce.paymentgateway.domain.PaymentResponse
call
(@NonNull AdyenPaymentRequest adyenPaymentRequest) Executes the payment request to the Adyen API.com.broadleafcommerce.paymentgateway.domain.PaymentResponse
communicateWithVendor
(@NonNull AdyenPaymentRequest adyenPaymentRequest) protected AdyenErrorResponse
convertFromErrorJson
(@NonNull org.springframework.web.reactive.function.client.WebClientResponseException receivedException, @NonNull String transactionReferenceId) protected AdyenResponse
executeAuthorize
(@NonNull AdyenPaymentRequest adyenPaymentRequest, @NonNull String currencyCode, @NonNull RequestResponseTransformer requestResponseTransformer, String applicationId, String tenantId) protected AdyenResponse
executeAuthorizeAndCapture
(@NonNull AdyenPaymentRequest adyenPaymentRequest, @NonNull String currencyCode, @NonNull RequestResponseTransformer requestResponseTransformer, String applicationId, String tenantId) protected AdyenResponse
executeCapture
(@NonNull AdyenPaymentRequest adyenPaymentRequest, @NonNull String currencyCode, @NonNull RequestResponseTransformer requestResponseTransformer, String applicationId, String tenantId) protected AdyenResponse
executeRefund
(@NonNull AdyenPaymentRequest adyenPaymentRequest, @NonNull String currencyCode, @NonNull RequestResponseTransformer requestResponseTransformer, String applicationId, String tenantId) protected AdyenResponse
executeRequest
(@NonNull AdyenPaymentRequest adyenPaymentRequest) protected AdyenResponse
executeReverseAuth
(@NonNull AdyenPaymentRequest adyenPaymentRequest, @NonNull String currencyCode, @NonNull RequestResponseTransformer requestResponseTransformer, String applicationId, String tenantId) protected AdyenConfigurationProperties
protected AdyenProvider
protected String
getGatewayTransactionType
(@NonNull AdyenPaymentRequest adyenPaymentRequest) protected com.fasterxml.jackson.databind.ObjectMapper
getPaymentData
(@NonNull AdyenPaymentRequest adyenPaymentRequest) protected com.broadleafcommerce.paymentgateway.util.PaymentResponseUtil
protected ExternalAdyenProviderProperties
protected List<RequestResponseTransformer>
protected com.broadleafcommerce.common.extension.TypeFactory
protected AdyenResponse
handleExecuteCustomRequest
(@NonNull AdyenPaymentRequest adyenPaymentRequest) protected RequestResponseTransformer
identifyRequestResponseTransformer
(@NonNull String transactionType) protected AdyenPaymentDetailsRequest
populateDetailsRequestFromDetails
(AdyenPaymentDetailsRequest request, Map<String, Object> paymentData) protected com.broadleafcommerce.paymentgateway.domain.PaymentResponse
processProviderApiException
(@NonNull AdyenPaymentRequest adyenPaymentRequest, @NonNull ProviderApiException apiException, @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse) protected <T> T
Methods inherited from class com.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall
clearStatus, getServiceStatus, incrementFailure, process
-
Constructor Details
-
DefaultAdyenExternalCallService
public DefaultAdyenExternalCallService(com.broadleafcommerce.paymentgateway.util.PaymentResponseUtil paymentResponseUtil, AdyenProvider adyenProvider, List<RequestResponseTransformer> requestResponseTransformers, com.fasterxml.jackson.databind.ObjectMapper mapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, ExternalAdyenProviderProperties properties, AdyenConfigurationProperties adyenConfigurationProperties)
-
-
Method Details
-
call
public com.broadleafcommerce.paymentgateway.domain.PaymentResponse call(@NonNull @NonNull AdyenPaymentRequest adyenPaymentRequest) Description copied from interface:AdyenExternalCallService
Executes the payment request to the Adyen API.- Specified by:
call
in interfaceAdyenExternalCallService
- Parameters:
adyenPaymentRequest
- the payment request that should be executed for the specifiedtransaction type
.- Returns:
- the payment response
-
getServiceName
- Specified by:
getServiceName
in interfacecom.broadleafcommerce.paymentgateway.vendor.service.monitor.ServiceStatusDetectable<AdyenPaymentRequest>
-
communicateWithVendor
public com.broadleafcommerce.paymentgateway.domain.PaymentResponse communicateWithVendor(@NonNull @NonNull AdyenPaymentRequest adyenPaymentRequest) - Specified by:
communicateWithVendor
in classcom.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall<AdyenPaymentRequest,
com.broadleafcommerce.paymentgateway.domain.PaymentResponse>
-
getFailureReportingThreshold
- Specified by:
getFailureReportingThreshold
in interfacecom.broadleafcommerce.paymentgateway.service.FailureCountExposable
- Specified by:
getFailureReportingThreshold
in classcom.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall<AdyenPaymentRequest,
com.broadleafcommerce.paymentgateway.domain.PaymentResponse>
-
buildPaymentResponse
protected com.broadleafcommerce.paymentgateway.domain.PaymentResponse buildPaymentResponse(@NonNull @NonNull AdyenPaymentRequest adyenPaymentRequest) -
getGatewayTransactionType
protected String getGatewayTransactionType(@NonNull @NonNull AdyenPaymentRequest adyenPaymentRequest) -
identifyRequestResponseTransformer
protected RequestResponseTransformer identifyRequestResponseTransformer(@NonNull @NonNull String transactionType) -
executeRequest
-
executeAuthorize
protected AdyenResponse executeAuthorize(@NonNull @NonNull AdyenPaymentRequest adyenPaymentRequest, @NonNull @NonNull String currencyCode, @NonNull @NonNull RequestResponseTransformer requestResponseTransformer, @Nullable String applicationId, @Nullable String tenantId) -
executeAuthorizeAndCapture
protected AdyenResponse executeAuthorizeAndCapture(@NonNull @NonNull AdyenPaymentRequest adyenPaymentRequest, @NonNull @NonNull String currencyCode, @NonNull @NonNull RequestResponseTransformer requestResponseTransformer, @Nullable String applicationId, @Nullable String tenantId) -
executeReverseAuth
protected AdyenResponse executeReverseAuth(@NonNull @NonNull AdyenPaymentRequest adyenPaymentRequest, @NonNull @NonNull String currencyCode, @NonNull @NonNull RequestResponseTransformer requestResponseTransformer, @Nullable String applicationId, @Nullable String tenantId) -
executeCapture
protected AdyenResponse executeCapture(@NonNull @NonNull AdyenPaymentRequest adyenPaymentRequest, @NonNull @NonNull String currencyCode, @NonNull @NonNull RequestResponseTransformer requestResponseTransformer, @Nullable String applicationId, @Nullable String tenantId) -
executeRefund
protected AdyenResponse executeRefund(@NonNull @NonNull AdyenPaymentRequest adyenPaymentRequest, @NonNull @NonNull String currencyCode, @NonNull @NonNull RequestResponseTransformer requestResponseTransformer, @Nullable String applicationId, @Nullable String tenantId) -
getPaymentData
@Nullable protected Map<String,Object> getPaymentData(@NonNull @NonNull AdyenPaymentRequest adyenPaymentRequest) -
populateDetailsRequestFromDetails
protected AdyenPaymentDetailsRequest populateDetailsRequestFromDetails(AdyenPaymentDetailsRequest request, @Nullable Map<String, Object> paymentData) -
processProviderApiException
protected com.broadleafcommerce.paymentgateway.domain.PaymentResponse processProviderApiException(@NonNull @NonNull AdyenPaymentRequest adyenPaymentRequest, @NonNull @NonNull ProviderApiException apiException, @NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse) -
convertFromErrorJson
protected AdyenErrorResponse convertFromErrorJson(@NonNull @NonNull org.springframework.web.reactive.function.client.WebClientResponseException receivedException, @NonNull @NonNull String transactionReferenceId) -
handleExecuteCustomRequest
protected AdyenResponse handleExecuteCustomRequest(@NonNull @NonNull AdyenPaymentRequest adyenPaymentRequest) -
readValue
protected <T> T readValue(String fromValue, com.fasterxml.jackson.core.type.TypeReference<T> toValueTypeRef) throws com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
getPaymentResponseUtil
protected com.broadleafcommerce.paymentgateway.util.PaymentResponseUtil getPaymentResponseUtil() -
getAdyenProvider
-
getRequestResponseTransformers
-
getMapper
protected com.fasterxml.jackson.databind.ObjectMapper getMapper() -
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getProperties
-
getAdyenConfigurationProperties
-