const STORAGE_KEY = 'stb:last-payment-link'; type StorageLike = Pick; export function readCachedPaymentLink(storage: StorageLike): string | null { return storage.getItem(STORAGE_KEY) || null; } export function writeCachedPaymentLink( storage: StorageLike, link: string, ): void { storage.setItem(STORAGE_KEY, link); }