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
Default implementation of
ChaseOrbitalGatewayPaymentModificationService-
Constructor Summary
ConstructorsConstructorDescriptionDefaultChaseOrbitalGatewayPaymentModificationService(com.broadleafcommerce.common.extension.TypeFactory typeFactory, HPSOrderAbstractionService hpsOrderAbstractionService, HPSResponseCodeEvaluator hpsResponseCodeEvaluator, HPSValidationDiscriminatedProperties hpsValidationDiscriminatedProperties, HPSCustomMerchantDataMapper hpsCustomMerchantDataMapper, OrbitalGatewayCardBrandMappingProperties cardBrandMappingProperties, ChaseIdGenerator chaseIdGenerator) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.broadleafcommerce.data.tracking.core.context.ContextInfobuildMinimalContextInfo(com.broadleafcommerce.data.tracking.core.type.OperationType operationType, String applicationId, String tenantId) protected StringgetCardBrand(HPSOrderAbstractionQueryResponse uidResponse) protected OrbitalGatewayCardBrandMappingPropertiesprotected ChaseIdGeneratorprotected StringgetCreditCardType(HPSOrderAbstractionQueryResponse uidResponse) protected Stringprotected StringgetExpDateMonth(HPSOrderAbstractionQueryResponse uidResponse) protected StringgetExpDateYear(HPSOrderAbstractionQueryResponse uidResponse) protected HPSCustomMerchantDataMapperprotected HPSOrderAbstractionServiceprotected Stringprotected HPSResponseCodeEvaluatorprotected HPSValidationDiscriminatedPropertiesprotected StringgetMaskedCardNumber(HPSOrderAbstractionQueryResponse uidResponse) protected StringgetRequiredPaymentMethodPropertyOrThrow(String propertyKey, com.broadleafcommerce.paymentgateway.domain.PaymentInfo paymentInfo) protected com.broadleafcommerce.common.extension.TypeFactoryprotected voidhandleApplePayOnModifyFullPaymentForCreate(com.broadleafcommerce.paymentgateway.domain.PaymentInfo paymentInfo, String applicationId, String tenantId) By default, this doesn't do anything since the Apple Pay flow doesn't require any transformation before it's used.protected voidhandleCreditCardOnModifyFullPaymentForCreate(com.broadleafcommerce.paymentgateway.domain.PaymentInfo paymentInfo, String applicationId, String tenantId) protected voidhandleUnknownPaymentTypeOnModifyFullPaymentForCreate(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentInfo paymentInfo, String applicationId, String tenantId) Hook point for clients to extend and handlePaymentInfo.getType()values not handled by default.protected voidmapBillingAddress(com.broadleafcommerce.paymentgateway.domain.PaymentInfo paymentInfo, HPSOrderAbstractionQueryResponse uidResponse) protected voidmapDisplayAttributes(com.broadleafcommerce.paymentgateway.domain.PaymentInfo paymentInfo, HPSOrderAbstractionQueryResponse uidResponse) protected voidmapPaymentMethodProperties(com.broadleafcommerce.paymentgateway.domain.PaymentInfo paymentInfo, HPSOrderAbstractionQueryResponse uidResponse) UpdatePaymentInfo.getPaymentMethodProperties()with key information harvested fromHPSOrderAbstractionQueryResponse.voidmodifyFullPaymentForCreate(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentInfo paymentInfo, String applicationId, String tenantId) This method is called beforeChaseOrbitalGatewayPaymentValidatoris invoked.protected com.broadleafcommerce.data.tracking.core.context.ContextRequestresolveContextDetails(HPSOrderAbstractionQueryResponse uidResponse) protected voidvalidateHpsProfileContext(HPSOrderAbstractionQueryResponse uidResponse, String applicationId, String tenantId, com.broadleafcommerce.paymentgateway.domain.PaymentInfo paymentInfo, Supplier<? extends RuntimeException> exceptionSupplierOnError) protected voidvalidateHpsProfileOwner(HPSOrderAbstractionQueryResponse uidResponse, String applicationId, String tenantId, com.broadleafcommerce.paymentgateway.domain.PaymentInfo paymentInfo, Supplier<? extends RuntimeException> exceptionSupplierOnError) protected voidvalidateUidQueryResponse(HPSOrderAbstractionQueryResponse uidResponse, String applicationId, String tenantId, Supplier<? extends RuntimeException> exceptionSupplier) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.paymentgateway.service.PaymentGatewayPaymentModificationService
getCallbackUrlKeys, modifyPaymentMethodProperties, modifyPaymentMethodProperties, updateGatewayPayment
-
Constructor Details
-
DefaultChaseOrbitalGatewayPaymentModificationService
public DefaultChaseOrbitalGatewayPaymentModificationService(com.broadleafcommerce.common.extension.TypeFactory typeFactory, HPSOrderAbstractionService hpsOrderAbstractionService, HPSResponseCodeEvaluator hpsResponseCodeEvaluator, HPSValidationDiscriminatedProperties hpsValidationDiscriminatedProperties, HPSCustomMerchantDataMapper hpsCustomMerchantDataMapper, OrbitalGatewayCardBrandMappingProperties cardBrandMappingProperties, ChaseIdGenerator chaseIdGenerator)
-
-
Method Details
-
getGatewayType
- Specified by:
getGatewayTypein interfacecom.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 beforeChaseOrbitalGatewayPaymentValidatoris invoked. As a result, this method itself has to do a lot of the primary validation, and will throwInvalidPaymentConfigurationExceptionif an error is detected.- Specified by:
modifyFullPaymentForCreatein interfacecom.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 - unlikePaymentGatewayPaymentModificationService.modifyPaymentMethodProperties(PaymentInfo, String, String), thePaymentInfo.getAttributes()in the input will not contain system-provided extra entries forPaymentInfoAttributes, 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 idtenantId- the tenant id- Throws:
com.broadleafcommerce.paymentgateway.service.exception.PaymentMethodPropertiesModificationException- if an error occurred during the modification of the payment method propertiescom.broadleafcommerce.paymentgateway.service.exception.InvalidPaymentConfigurationException- if the provided details are somehow invalid and payment creation should be rejectedUnexpectedHPSFailureException- if there is some error when communicating with HPS
-
getRequiredPaymentMethodPropertyOrThrow
-
handleCreditCardOnModifyFullPaymentForCreate
-
buildMinimalContextInfo
-
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 fromHPSOrderAbstractionQueryResponse.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 mutatePaymentInfo.getPaymentMethodProperties()uidResponse- the already-validated HPS query response from which to source relevant information
-
getHpsProfileReferenceNumber
-
getCtiCommercialCardValue
-
mapDisplayAttributes
protected void mapDisplayAttributes(com.broadleafcommerce.paymentgateway.domain.PaymentInfo paymentInfo, HPSOrderAbstractionQueryResponse uidResponse) -
getCreditCardType
-
getCardBrand
-
getMaskedCardNumber
-
getExpDateMonth
-
getExpDateYear
-
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 inDefaultChaseOrbitalGatewayPaymentValidator.- Parameters:
paymentInfo- payment information to handleapplicationId- the application ID of the current contexttenantId- 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 handlePaymentInfo.getType()values not handled by default.- Parameters:
paymentInfo- the information about paymentapplicationId- the application idtenantId- the tenant id
-
getIso3CountryToIso2CountryMap
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getHpsOrderAbstractionService
-
getHpsResponseCodeEvaluator
-
getHpsValidationDiscriminatedProperties
-
getHpsCustomMerchantDataMapper
-
getCardBrandMappingProperties
-
getChaseIdGenerator
-