Class HPSCustomMerchantDataMapper

java.lang.Object
com.broadleafcommerce.vendor.chasepayment.service.hps.support.HPSCustomMerchantDataMapper

public class HPSCustomMerchantDataMapper extends Object
Component capable of mapping custom merchant data fields in HPSOrderAbstractionInitRequest and HPSOrderAbstractionQueryResponse.
  • Constructor Details

    • HPSCustomMerchantDataMapper

      public HPSCustomMerchantDataMapper(com.broadleafcommerce.common.extension.TypeFactory typeFactory)
  • Method Details

    • resolveContextDetails

      @Nullable public com.broadleafcommerce.data.tracking.core.context.ContextRequest resolveContextDetails(HPSOrderAbstractionQueryResponse uidResponse)
      From the given HPSOrderAbstractionQueryResponse, extract Broadleaf context information that may have been previously recorded in HPS custom merchant fields.
      Parameters:
      uidResponse - the UID query response from which to resolve the context details
      Returns:
      a minimal ContextRequest with the resolved details, or null if no details could be resolved
      Throws:
      IllegalArgumentException - if there was an error parsing the input
      See Also:
    • getContextRequestString

      protected String getContextRequestString(HPSOrderAbstractionQueryResponse uidResponse)
    • parsePropertyValueMapFromStringRepresentation

      protected Map<String,String> parsePropertyValueMapFromStringRepresentation(String propertyValuesStringRepresentation)
      Parameters:
      propertyValuesStringRepresentation - the specially formatting string that needs to be parsed
      Returns:
      the map representation of the property-values
      Throws:
      IllegalArgumentException - if there is a parsing issue
    • resolvePaymentOwnerInformation

      @Nullable public org.apache.commons.lang3.tuple.Pair<String,String> resolvePaymentOwnerInformation(HPSOrderAbstractionQueryResponse uidResponse)
      From the given HPSOrderAbstractionQueryResponse, extract Broadleaf payment owner information that may have been previously recorded in HPS custom merchant fields.
      Parameters:
      uidResponse - the UID query response from which to resolve the payment owner details
      Returns:
      a Pair of the resolved payment owner type and payment owner ID, or null if no details could be resolved
      Throws:
      IllegalArgumentException - if there was an error parsing the input
      See Also:
    • getPaymentOwnerInformationString

      protected String getPaymentOwnerInformationString(HPSOrderAbstractionQueryResponse uidResponse)
    • populateContextDetails

      @Nullable public void populateContextDetails(HPSOrderAbstractionInitRequest payloadToPopulate, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)

      On the given HPSOrderAbstractionInitRequest, populate Broadleaf context information in HPS custom merchant fields.

      By default, the result will be a minimal, specially formatted string that contains the basic context information that this HPS submission is intended for. Should be as short as possible to reduce the likelihood of running into Chase field size limitations

      Parameters:
      payloadToPopulate - the target instance to populate the context information on
      contextInfo - the context details to populate on the payload
      Throws:
      IllegalArgumentException - if there was an error processing the input
      See Also:
    • convertPropertyValueMapRepresentationToString

      protected String convertPropertyValueMapRepresentationToString(Map<String,String> mapRepresentation)
      Parameters:
      mapRepresentation - the map representation of properties and values
      Returns:
      a specially formatted string that represents the contents of the map
    • setContextRequestString

      protected void setContextRequestString(HPSOrderAbstractionInitRequest payloadToPopulate, String contextRequestString)
    • getTenantId

      @Nullable protected String getTenantId(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    • getApplicationId

      @Nullable protected String getApplicationId(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    • populatePaymentOwnerInformation

      @Nullable public void populatePaymentOwnerInformation(HPSOrderAbstractionInitRequest payloadToPopulate, @Nullable String paymentOwnerType, @Nullable String paymentOwnerId)

      On the given HPSOrderAbstractionInitRequest, populate Broadleaf payment owner information in HPS custom merchant fields.

      By default, the result will be a minimal, specially formatted string that contains the basic payment owner information that this HPS submission is intended for. Should be as short as possible to reduce the likelihood of running into Chase field size limitations

      Parameters:
      payloadToPopulate - the target instance to populate the payment owner information on
      paymentOwnerType - the payment owner type to populate
      paymentOwnerId - the payment owner ID to populate
      Throws:
      IllegalArgumentException - if there was an error processing the input
      See Also:
    • setPaymentOwnerInformationString

      protected void setPaymentOwnerInformationString(HPSOrderAbstractionInitRequest payloadToPopulate, String paymentOwnerInformationString)
    • getTypeFactory

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