Skip to main content

clearPurchaseCache

SolvaPay SDK v1.0.0


SolvaPay SDK / next/src / clearPurchaseCache

Function: clearPurchaseCache()

clearPurchaseCache(userId): void

Defined in: packages/next/src/cache.ts:259

Clear purchase cache for a specific user.

Useful when you know purchase status has changed (e.g., after a successful checkout, purchase update, or cancellation). This forces the next checkPurchase() call to fetch fresh data from the backend.

Parameters

userId

string

User ID to clear cache for

Returns

void

Example

import { clearPurchaseCache } from '@solvapay/next';

// After successful payment
await processPayment(request, body);
clearPurchaseCache(userId); // Force refresh on next check

See

Since

1.0.0