Closed yched closed 2 months ago
Hi @yched, sorry for the delay in response. This has been fixed on the latest release, v3.28.0. You'll be able to access headers in the following manner. Please give it a try and let us know if you face any issues.
catch (APIError $e) {
$errorHeaders = $e->getHeaders();
$retryAfterHeaders = $errorHeaders['Retry-After'][0];
echo $retryAfterHeaders . "\n";
}
Tnanjs @cb-alish , this works great ! :+1:
Thanks for the confirmation @yched 👍
From the "Error handling" section of the API docs :
But on a HTTP 429 error, trhe Chargebee-php library throws an OperationFailedException, and offers no way to access the response headers, and thus no way to read the "Retry-After" value sent by Chargbee API.