Class AbstractExternalProvider

java.lang.Object
com.broadleafcommerce.payment.service.gateway.provider.external.AbstractExternalProvider
Direct Known Subclasses:
ExternalStoreCreditAccountProvider, ExternalStoreCreditTransactionExecutionProvider

public abstract class AbstractExternalProvider extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractExternalProvider(org.springframework.web.reactive.function.client.WebClient webClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected <T> T
    Executes a request with default Web Client error handling.
    protected org.springframework.http.HttpHeaders
    getHeaders(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Sets the CONTENT_TYPE and ACCEPT headers.
    protected com.fasterxml.jackson.databind.ObjectMapper
     
    protected org.springframework.web.reactive.function.client.WebClient
     
    protected Map<String,Object>
    uriVars(Object... keysAndValues)
    Convenience method to generate a map of variables.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AbstractExternalProvider

      public AbstractExternalProvider(org.springframework.web.reactive.function.client.WebClient webClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
  • Method Details

    • executeRequest

      protected <T> T executeRequest(Supplier<T> request)
      Executes a request with default Web Client error handling.
      Type Parameters:
      T - the return type of the request operation
      Parameters:
      request - the request to execute
      Returns:
      the value generated by the supplier
    • getHeaders

      protected org.springframework.http.HttpHeaders getHeaders(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Sets the CONTENT_TYPE and ACCEPT headers. Also, serializes the ContextInfo, if available, into HTTP a header.
      Parameters:
      contextInfo -
      Returns:
      headers
    • uriVars

      protected Map<String,Object> uriVars(Object... keysAndValues)
      Convenience method to generate a map of variables.
      Parameters:
      keysAndValues - the keys and values (in pairs, alternating) to transform into a map
      Returns:
      the keys and values as a map
    • getWebClient

      protected org.springframework.web.reactive.function.client.WebClient getWebClient()
    • getObjectMapper

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