Class DefaultChaseOrbitalGatewayPaymentModificationService

java.lang.Object
com.broadleafcommerce.payment.service.gateway.DefaultChaseOrbitalGatewayPaymentModificationService
All Implemented Interfaces:
ChaseOrbitalGatewayPaymentModificationService, com.broadleafcommerce.paymentgateway.service.PaymentGatewayPaymentModificationService, com.broadleafcommerce.paymentgateway.service.PaymentGatewayTypeAware

public class DefaultChaseOrbitalGatewayPaymentModificationService extends Object implements ChaseOrbitalGatewayPaymentModificationService
  • Constructor Details

  • Method Details

    • getGatewayType

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

      public void modifyFullPaymentForCreate(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentInfo paymentInfo, @Nullable String applicationId, @Nullable String tenantId)
      This method is called before ChaseOrbitalGatewayPaymentValidator is invoked. As a result, this method itself has to do a lot of the primary validation, and will throw InvalidPaymentConfigurationException if an error is detected.
      Specified by:
      modifyFullPaymentForCreate in interface com.broadleafcommerce.paymentgateway.service.PaymentGatewayPaymentModificationService
      Parameters:
      paymentInfo - the object containing payment details which should be directly mutated. All fields from this instance will be mapped back onto the ultimate payment object. Note - unlike PaymentGatewayPaymentModificationService.modifyPaymentMethodProperties(PaymentInfo, String, String), the PaymentInfo.getAttributes() in the input will not contain system-provided extra entries for PaymentInfoAttributes, as the goal is to keep the input/output as pure as possible. Thus, the recommendation is to pre-process those extras in the other method if needed.
      applicationId - the application id
      tenantId - the tenant id
      Throws:
      com.broadleafcommerce.paymentgateway.service.exception.PaymentMethodPropertiesModificationException - if an error occurred during the modification of the payment method properties
      com.broadleafcommerce.paymentgateway.service.exception.InvalidPaymentConfigurationException - if the provided details are somehow invalid and payment creation should be rejected
      UnexpectedHPSFailureException - if there is some error when communicating with HPS
    • getRequiredPaymentMethodPropertyOrThrow

      protected String getRequiredPaymentMethodPropertyOrThrow(String propertyKey, com.broadleafcommerce.paymentgateway.domain.PaymentInfo paymentInfo)
    • handleCreditCardOnModifyFullPaymentForCreate

      protected void handleCreditCardOnModifyFullPaymentForCreate(com.broadleafcommerce.paymentgateway.domain.PaymentInfo paymentInfo, @Nullable String applicationId, @Nullable String tenantId)
    • buildMinimalContextInfo

      protected com.broadleafcommerce.data.tracking.core.context.ContextInfo buildMinimalContextInfo(com.broadleafcommerce.data.tracking.core.type.OperationType operationType, @Nullable String applicationId, @Nullable String tenantId)
    • validateUidQueryResponse

      protected void validateUidQueryResponse(HPSOrderAbstractionQueryResponse uidResponse, @Nullable String applicationId, @Nullable String tenantId, Supplier<? extends RuntimeException> exceptionSupplier)
    • validateHpsProfileContext

      protected void validateHpsProfileContext(HPSOrderAbstractionQueryResponse uidResponse, @Nullable String applicationId, @Nullable String tenantId, com.broadleafcommerce.paymentgateway.domain.PaymentInfo paymentInfo, Supplier<? extends RuntimeException> exceptionSupplierOnError)
    • resolveContextDetails

      @Nullable protected com.broadleafcommerce.data.tracking.core.context.ContextRequest resolveContextDetails(HPSOrderAbstractionQueryResponse uidResponse)
    • validateHpsProfileOwner

      protected void validateHpsProfileOwner(HPSOrderAbstractionQueryResponse uidResponse, @Nullable String applicationId, @Nullable String tenantId, com.broadleafcommerce.paymentgateway.domain.PaymentInfo paymentInfo, Supplier<? extends RuntimeException> exceptionSupplierOnError)
    • resolvePaymentOwnerInformation

      @Nullable protected org.apache.commons.lang3.tuple.Pair<String,String> resolvePaymentOwnerInformation(HPSOrderAbstractionQueryResponse uidResponse)
    • mapPaymentMethodProperties

      protected void mapPaymentMethodProperties(com.broadleafcommerce.paymentgateway.domain.PaymentInfo paymentInfo, HPSOrderAbstractionQueryResponse uidResponse)

      Update PaymentInfo.getPaymentMethodProperties() with key information harvested from HPSOrderAbstractionQueryResponse.

      This implementation intentionally clears and replaces whatever the caller has provided in PaymentInfo.getPaymentMethodProperties() with only the entries expected by the system. This ensures the caller cannot themselves provide arbitrary properties that we only expect the system to calculate/set.

      Parameters:
      paymentInfo - the payment info object on which to mutate PaymentInfo.getPaymentMethodProperties()
      uidResponse - the already-validated HPS query response from which to source relevant information
    • getHpsProfileReferenceNumber

      protected String getHpsProfileReferenceNumber(HPSOrderAbstractionQueryResponse uidResponse)
    • getCtiCommercialCardValue

      protected String getCtiCommercialCardValue(HPSOrderAbstractionQueryResponse uidResponse)
    • mapDisplayAttributes

      protected void mapDisplayAttributes(com.broadleafcommerce.paymentgateway.domain.PaymentInfo paymentInfo, HPSOrderAbstractionQueryResponse uidResponse)
    • getCreditCardType

      protected String getCreditCardType(HPSOrderAbstractionQueryResponse uidResponse)
    • getCardBrand

      protected String getCardBrand(HPSOrderAbstractionQueryResponse uidResponse)
    • getMaskedCardNumber

      protected String getMaskedCardNumber(HPSOrderAbstractionQueryResponse uidResponse)
    • getExpDateMonth

      protected String getExpDateMonth(HPSOrderAbstractionQueryResponse uidResponse)
    • getExpDateYear

      protected String getExpDateYear(HPSOrderAbstractionQueryResponse uidResponse)
    • mapBillingAddress

      protected void mapBillingAddress(com.broadleafcommerce.paymentgateway.domain.PaymentInfo paymentInfo, HPSOrderAbstractionQueryResponse uidResponse)
    • handleApplePayOnModifyFullPaymentForCreate

      protected void handleApplePayOnModifyFullPaymentForCreate(com.broadleafcommerce.paymentgateway.domain.PaymentInfo paymentInfo, @Nullable String applicationId, @Nullable String tenantId)
      By default, this doesn't do anything since the Apple Pay flow doesn't require any transformation before it's used. Thus, the logic around validation is entirely located in DefaultChaseOrbitalGatewayPaymentValidator.
      Parameters:
      paymentInfo - payment information to handle
      applicationId - the application ID of the current context
      tenantId - the tenant ID of the current context
    • handleUnknownPaymentTypeOnModifyFullPaymentForCreate

      protected void handleUnknownPaymentTypeOnModifyFullPaymentForCreate(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentInfo paymentInfo, @Nullable String applicationId, @Nullable String tenantId)
      Hook point for clients to extend and handle PaymentInfo.getType() values not handled by default.
      Parameters:
      paymentInfo - the information about payment
      applicationId - the application id
      tenantId - the tenant id
    • getIso3CountryToIso2CountryMap

      protected static Map<String,String> getIso3CountryToIso2CountryMap()
    • getTypeFactory

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

      protected HPSOrderAbstractionService getHpsOrderAbstractionService()
    • getHpsResponseCodeEvaluator

      protected HPSResponseCodeEvaluator getHpsResponseCodeEvaluator()
    • getHpsValidationDiscriminatedProperties

      protected HPSValidationDiscriminatedProperties getHpsValidationDiscriminatedProperties()
    • getHpsCustomMerchantDataMapper

      protected HPSCustomMerchantDataMapper getHpsCustomMerchantDataMapper()
    • getCardBrandMappingProperties

      protected OrbitalGatewayCardBrandMappingProperties getCardBrandMappingProperties()
    • getChaseIdGenerator

      protected ChaseIdGenerator getChaseIdGenerator()