mirror of
https://github.com/itflow-org/itflow
synced 2026-03-12 08:44:50 +00:00
Bump stripe-php from 19.0.0 to 19.4.1
This commit is contained in:
@@ -269,7 +269,7 @@ class ApiRequestor
|
||||
case 'idempotency_error':
|
||||
return Exception\IdempotencyException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code);
|
||||
|
||||
// The beginning of the section generated from our OpenAPI spec
|
||||
// switchCases: The beginning of the section generated from our OpenAPI spec
|
||||
case 'temporary_session_expired':
|
||||
return Exception\TemporarySessionExpiredException::factory(
|
||||
$msg,
|
||||
@@ -280,7 +280,7 @@ class ApiRequestor
|
||||
$code
|
||||
);
|
||||
|
||||
// The end of the section generated from our OpenAPI spec
|
||||
// switchCases: The end of the section generated from our OpenAPI spec
|
||||
default:
|
||||
return self::_specificV1APIError($rbody, $rcode, $rheaders, $resp, $errorData);
|
||||
}
|
||||
@@ -369,6 +369,41 @@ class ApiRequestor
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @static
|
||||
*
|
||||
* @return string the detected AI agent slug, or empty string if none detected
|
||||
*/
|
||||
const AI_AGENTS = [
|
||||
// aiAgents: The beginning of the section generated from our OpenAPI spec
|
||||
['ANTIGRAVITY_CLI_ALIAS', 'antigravity'],
|
||||
['CLAUDECODE', 'claude_code'],
|
||||
['CLINE_ACTIVE', 'cline'],
|
||||
['CODEX_SANDBOX', 'codex_cli'],
|
||||
['CODEX_THREAD_ID', 'codex_cli'],
|
||||
['CODEX_SANDBOX_NETWORK_DISABLED', 'codex_cli'],
|
||||
['CODEX_CI', 'codex_cli'],
|
||||
['CURSOR_AGENT', 'cursor'],
|
||||
['GEMINI_CLI', 'gemini_cli'],
|
||||
['OPENCODE', 'open_code'],
|
||||
// aiAgents: The end of the section generated from our OpenAPI spec
|
||||
];
|
||||
|
||||
private static function _detectAIAgent($getEnv = null)
|
||||
{
|
||||
if (null === $getEnv) {
|
||||
$getEnv = '\getenv';
|
||||
}
|
||||
foreach (self::AI_AGENTS as $agent) {
|
||||
$val = $getEnv($agent[0]);
|
||||
if (false !== $val && '' !== $val) {
|
||||
return $agent[1];
|
||||
}
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @static
|
||||
*
|
||||
@@ -404,6 +439,12 @@ class ApiRequestor
|
||||
$ua['application'] = $appInfo;
|
||||
}
|
||||
|
||||
$aiAgent = self::_detectAIAgent();
|
||||
if ('' !== $aiAgent) {
|
||||
$uaString .= ' AIAgent/' . $aiAgent;
|
||||
$ua['ai_agent'] = $aiAgent;
|
||||
}
|
||||
|
||||
return [
|
||||
'X-Stripe-Client-User-Agent' => \json_encode($ua),
|
||||
'User-Agent' => $uaString,
|
||||
|
||||
Reference in New Issue
Block a user