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 Summary
Modifier and TypeMethodDescriptionvoid
validateVersionForArchival
(@NonNull SavedPaymentMethod savedPaymentMethod, Integer versionToTest) Determines if the providedversionToTest
is valid for an archival of theSavedPaymentMethod
.void
validateVersionForUpdate
(@NonNull SavedPaymentMethod savedPaymentMethod, Integer versionToTest) Determines if the providedversionToTest
is valid for an update of theSavedPaymentMethod
.boolean
versionIsStale
(@NonNull SavedPaymentMethod savedPaymentMethod, @NonNull Integer versionToTest) Determines if the providedversionToTest
is valid for theSavedPaymentMethod
.
-
Method Details
-
versionIsStale
boolean versionIsStale(@NonNull @NonNull SavedPaymentMethod savedPaymentMethod, @NonNull @NonNull Integer versionToTest) Determines if the providedversionToTest
is valid for theSavedPaymentMethod
.- Parameters:
savedPaymentMethod
- TheSavedPaymentMethod
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 theSavedPaymentMethod
.
-
validateVersionForUpdate
void validateVersionForUpdate(@NonNull @NonNull SavedPaymentMethod savedPaymentMethod, @Nullable Integer versionToTest) Determines if the providedversionToTest
is valid for an update of theSavedPaymentMethod
.- Parameters:
savedPaymentMethod
- TheSavedPaymentMethod
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 providedversionToTest
is valid for an archival of theSavedPaymentMethod
.- Parameters:
savedPaymentMethod
- TheSavedPaymentMethod
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.
-