setSessionToken method

void setSessionToken(
  1. String sessionToken
)

Set session token for Authorization: Bearer …. Replaces the legacy app-key header that v2 used. The session token is a per-checkout credential minted by the merchant backend via POST /api/v1/internal/sessions/create on the gateway.

Implementation

void setSessionToken(String sessionToken) {
  _dio.options.headers['Authorization'] = 'Bearer $sessionToken';
  // Defense in depth: drop the legacy header if anything ever sets it.
  _dio.options.headers.remove('app-key');
}