Bump stripe-php from 19.0.0 to 19.4.1

This commit is contained in:
johnnyq
2026-03-07 17:19:48 -05:00
parent 11ba077726
commit 526fa1aff5
228 changed files with 3494 additions and 1049 deletions

View File

@@ -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,