Class OrbitalGatewayBillingValidationUtil
- Since:
- Chase Payment Integration 1.0.1
- Author:
- Julia Lopez-Pozas (jlopezpozas)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionOrbitalGatewayBillingValidationUtil(OrbitalGatewayBillingValidationProperties orbitalGatewayBillingValidationProperties) -
Method Summary
Modifier and TypeMethodDescriptionvoidvalidateBillingAddressParameters(com.broadleafcommerce.paymentgateway.domain.PaymentValidationRequest paymentValidationRequest) The Orbital Gateway itself has strict field length limitations that it enforces at transaction time.protected voidvalidateBillingInfoAddressLine1(com.broadleafcommerce.paymentgateway.domain.Address<com.broadleafcommerce.paymentgateway.domain.PaymentValidationRequest> billingInfo, List<String> billingInfoValidationErrors) Validates that the address line 1 of the billing address is within the maximum length allowed by the Orbital gateway.protected voidvalidateBillingInfoAddressLine2(com.broadleafcommerce.paymentgateway.domain.Address<com.broadleafcommerce.paymentgateway.domain.PaymentValidationRequest> billingInfo, List<String> billingInfoValidationErrors) Validates that the address line 2 of the billing address is within the maximum length allowed by the Orbital gateway.protected voidvalidateBillingInfoCity(com.broadleafcommerce.paymentgateway.domain.Address<com.broadleafcommerce.paymentgateway.domain.PaymentValidationRequest> billingInfo, List<String> billingInfoValidationErrors) Validates that the city of the billing address is within the maximum length allowed by the Orbital gateway.protected voidvalidateBillingInfoFullName(com.broadleafcommerce.paymentgateway.domain.Address<com.broadleafcommerce.paymentgateway.domain.PaymentValidationRequest> billingInfo, List<String> billingInfoValidationErrors) Validates that the full name of the billing payment information is within the maximum length allowed by the Orbital gateway.protected voidvalidateBillingInfoZipCode(com.broadleafcommerce.paymentgateway.domain.Address<com.broadleafcommerce.paymentgateway.domain.PaymentValidationRequest> billingInfo, List<String> billingInfoValidationErrors) Validates that the zip code (postal code) of the billing address is within the maximum length allowed by the Orbital gateway.
-
Constructor Details
-
OrbitalGatewayBillingValidationUtil
public OrbitalGatewayBillingValidationUtil(OrbitalGatewayBillingValidationProperties orbitalGatewayBillingValidationProperties)
-
-
Method Details
-
validateBillingAddressParameters
public void validateBillingAddressParameters(com.broadleafcommerce.paymentgateway.domain.PaymentValidationRequest paymentValidationRequest) The Orbital Gateway itself has strict field length limitations that it enforces at transaction time. Normally, we would not expect to run into those errors, since systems like Chase HPS have documentation indicating they will also enforce a maximum length on the same fields. This means the user's input should be rejected well before it reached Broadleaf PTS in a create-payment request. In practice, however, the enforcement is not present at the HPS layer and seemingly invalid inputs are allowed through by their system. Thus, as a protective measure to prevent late failures all the way at checkout, we validate here.
This covers both invalid inputs submitted via Chase HPS, and invalid inputs that may be passed along from saved digital wallets like Apple Pay.
- Parameters:
paymentValidationRequest- The payment information to be validated- Throws:
com.broadleafcommerce.paymentgateway.service.exception.InvalidPaymentConfigurationException- when there are validation errors such as fields exceeding their maximum lengths.
-
validateBillingInfoFullName
protected void validateBillingInfoFullName(com.broadleafcommerce.paymentgateway.domain.Address<com.broadleafcommerce.paymentgateway.domain.PaymentValidationRequest> billingInfo, List<String> billingInfoValidationErrors) Validates that the full name of the billing payment information is within the maximum length allowed by the Orbital gateway. If the full name field value exceeds the maximum length, an error message for this field is added to the list of validation error messages that will be thrown as part of anInvalidPaymentConfigurationException.- Parameters:
billingInfo- the billing address information containing the full name to validate
-
validateBillingInfoAddressLine1
protected void validateBillingInfoAddressLine1(com.broadleafcommerce.paymentgateway.domain.Address<com.broadleafcommerce.paymentgateway.domain.PaymentValidationRequest> billingInfo, List<String> billingInfoValidationErrors) Validates that the address line 1 of the billing address is within the maximum length allowed by the Orbital gateway. If the address line 1 field value exceeds the maximum length, an error message for this field is added to the list of validation error messages that will be thrown as part of anInvalidPaymentConfigurationException.- Parameters:
billingInfo- the billing address information containing the address line 1 to validate
-
validateBillingInfoAddressLine2
protected void validateBillingInfoAddressLine2(com.broadleafcommerce.paymentgateway.domain.Address<com.broadleafcommerce.paymentgateway.domain.PaymentValidationRequest> billingInfo, List<String> billingInfoValidationErrors) Validates that the address line 2 of the billing address is within the maximum length allowed by the Orbital gateway. If the address line 2 field value exceeds the maximum length, an error message for this field is added to the list of validation error messages that will be thrown as part of anInvalidPaymentConfigurationException.- Parameters:
billingInfo- the billing address information containing the address line 2 to validate
-
validateBillingInfoCity
protected void validateBillingInfoCity(com.broadleafcommerce.paymentgateway.domain.Address<com.broadleafcommerce.paymentgateway.domain.PaymentValidationRequest> billingInfo, List<String> billingInfoValidationErrors) Validates that the city of the billing address is within the maximum length allowed by the Orbital gateway. If the city field value exceeds the maximum length, an error message for this field is added to the list of validation error messages that will be thrown as part of anInvalidPaymentConfigurationException.- Parameters:
billingInfo- the billing address information containing the city to validate
-
validateBillingInfoZipCode
protected void validateBillingInfoZipCode(com.broadleafcommerce.paymentgateway.domain.Address<com.broadleafcommerce.paymentgateway.domain.PaymentValidationRequest> billingInfo, List<String> billingInfoValidationErrors) Validates that the zip code (postal code) of the billing address is within the maximum length allowed by the Orbital gateway. If the zip code field value exceeds the maximum length, an error message for this field is added to the list of validation error messages that will be thrown as part of anInvalidPaymentConfigurationException.- Parameters:
billingInfo- the billing address information containing the postal code to validate
-
getOrbitalGatewayBillingValidationProperties
-