Interface SavedPaymentMethodVersionValidationService

All Known Implementing Classes:
DefaultSavedPaymentMethodVersionValidationService

public interface SavedPaymentMethodVersionValidationService
Service used for validating the version of a SavedPaymentMethod for reads and updates within this service.
Author:
Chris Kittrell (ckittrell), Sunny Yu
  • Method Details

    • versionIsStale

      boolean versionIsStale(@NonNull @NonNull SavedPaymentMethod savedPaymentMethod, @NonNull @NonNull Integer versionToTest)
      Determines if the provided versionToTest is valid for the SavedPaymentMethod.
      Parameters:
      savedPaymentMethod - The SavedPaymentMethod whose version is being validated.
      versionToTest - The version provided by the request, which may or may not be out of date.
      Returns:
      Whether the provided versionToTest is valid for the SavedPaymentMethod.
    • validateVersionForUpdate

      void validateVersionForUpdate(@NonNull @NonNull SavedPaymentMethod savedPaymentMethod, @Nullable Integer versionToTest)
      Determines if the provided versionToTest is valid for an update of the SavedPaymentMethod.
      Parameters:
      savedPaymentMethod - The SavedPaymentMethod whose version is being validated.
      versionToTest - The version provided by the request, which may or may not be out of date.
      Throws:
      StaleSavedPaymentMethodVersionException - If the provided version is stale.
    • validateVersionForArchival

      void validateVersionForArchival(@NonNull @NonNull SavedPaymentMethod savedPaymentMethod, @Nullable Integer versionToTest)
      Determines if the provided versionToTest is valid for an archival of the SavedPaymentMethod.
      Parameters:
      savedPaymentMethod - The SavedPaymentMethod whose version is being validated.
      versionToTest - The version provided by the request, which may or may not be out of date.
      Throws:
      StaleSavedPaymentMethodVersionException - If the provided version is stale.