Class DefaultAdyenTransactionLookupService

java.lang.Object
com.broadleafcommerce.adyen.service.DefaultAdyenTransactionLookupService
All Implemented Interfaces:
AdyenTransactionLookupService, com.broadleafcommerce.paymentgateway.service.PaymentGatewayTransactionLookupService, com.broadleafcommerce.paymentgateway.service.PaymentGatewayTypeAware

public class DefaultAdyenTransactionLookupService extends Object implements AdyenTransactionLookupService
Default implementation for AdyenTransactionLookupService.

This service is used to submit the transaction result using submitPaymentDetails. This step is only needed when no final state has been reached on the /payments request, for example when the shopper was redirected to another page to complete the payment.

Author:
Dima Myroniuk (dmyroniuk)
  • Constructor Details

    • DefaultAdyenTransactionLookupService

      public DefaultAdyenTransactionLookupService(AdyenProvider adyenProvider, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
  • Method Details

    • validateRequestParams

      public void validateRequestParams(Map<String,String> requestParams, @Nullable String tenantId, @Nullable String applicationId)
      Validates that the request parameters contain "redirectResult".
      Specified by:
      validateRequestParams in interface com.broadleafcommerce.paymentgateway.service.PaymentGatewayTransactionLookupService
      Parameters:
      requestParams - the parameters to validate
      tenantId - the id for the current tenant
      applicationId - the id for the current application
    • getTransactionDetails

      public org.apache.commons.lang3.tuple.Pair<com.broadleafcommerce.paymentgateway.domain.TransactionIdentifier,com.broadleafcommerce.paymentgateway.domain.PaymentResponse> getTransactionDetails(Map<String,String> requestParams, @Nullable String tenantId, @Nullable String applicationId)
      Submits the authentication result via AdyenProvider.submitPaymentDetails(AdyenPaymentDetailsRequest, String, String) and returns the payment result.
      Specified by:
      getTransactionDetails in interface com.broadleafcommerce.paymentgateway.service.PaymentGatewayTransactionLookupService
      Parameters:
      requestParams - the gateway-specific parameters on the request.
      tenantId - the id for the current tenant
      applicationId - the id for the current application
      Returns:
      the payment details
    • lookupTransactionDetails

      public com.broadleafcommerce.paymentgateway.domain.PaymentResponse lookupTransactionDetails(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.TransactionLookupRequest transactionLookupRequest, @Nullable String tenantId, @Nullable String applicationId)
      Specified by:
      lookupTransactionDetails in interface com.broadleafcommerce.paymentgateway.service.PaymentGatewayTransactionLookupService
    • buildTransactionIdentifier

      protected com.broadleafcommerce.paymentgateway.domain.TransactionIdentifier buildTransactionIdentifier(AdyenResponse adyenResponse, @Nullable String tenantId, @Nullable String applicationId)
    • buildPaymentResponse

      protected com.broadleafcommerce.paymentgateway.domain.PaymentResponse buildPaymentResponse(@NonNull @NonNull AdyenResponse adyenResponse)
    • buildRawResponse

      protected String buildRawResponse(@NonNull @NonNull AdyenResponse adyenResponse)
    • getGatewayType

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

      protected AdyenProvider getAdyenProvider()
    • getObjectMapper

      protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
    • getTypeFactory

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