Interface SavedPaymentMethodAccessValidationService

All Known Implementing Classes:
DefaultSavedPaymentMethodAccessValidationService

public interface SavedPaymentMethodAccessValidationService
Validates access to the saved payment method based on passed in context.
  • Method Details

    • validateSavedPaymentMethodOwnership

      void validateSavedPaymentMethodOwnership(@NonNull @NonNull String savedPaymentId, @NonNull @NonNull CustomerRef customerRef, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Validates access to the saved payment method based on the passed in context.

      This ensures that the given saved payment method being accessed by the given CustomerRef has the correct ownership.

      Parameters:
      savedPaymentId - the id of the saved payment method requiring access
      customerRef - the CustomerRef to validate against
      context - context information surrounding multitenant state
      Throws:
      SavedPaymentMethodManagementAccessException - if the authenticated user does not have the ownership to manage the saved payment method
      UnsupportedOperationException - if the owning user type of saved payment method is not supported
      See Also:
    • validateOwnershipMatchWithPayment

      void validateOwnershipMatchWithPayment(@NonNull @NonNull OwnershipSummary savedPaymentOwnership, @NonNull @NonNull Payment payment)
      Validates the ownership of the saved payment method matches the ownership of the given Payment.

      This ensures the owning user of the Payment matches with the owning user of the saved payment method.

      Parameters:
      savedPaymentOwnership - the OwnershipSummary of the saved payment method
      payment - the Payment to validate the ownership against