Vonage / vonage-php-sdk-core

Vonage REST API client for PHP. API support for SMS, Voice, Text-to-Speech, Numbers, Verify (2FA) and more.
https://developer.vonage.com/
Apache License 2.0
908 stars 181 forks source link

Fix insight to return data when it is chargeable #466

Closed SecondeJK closed 6 months ago

SecondeJK commented 6 months ago

Number Insight API Handling currently throws exceptions when it shouldn't.

Description

Due to the design of NIv1, 43, 44 and 45 status codes are chargeable and therefore the client should return the partial data that has been returned.

Motivation and Context

Arose from #463

How Has This Been Tested?

Complete tests were not available for NI. I have added suitable API call mocks.

Example Output or Screenshots (if appropriate):

Types of changes

Checklist:

codecov-commenter commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (2b0306e) 79.12% compared to head (76a6559) 79.18%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #466 +/- ## ============================================ + Coverage 79.12% 79.18% +0.05% Complexity 2371 2371 ============================================ Files 218 218 Lines 6353 6356 +3 ============================================ + Hits 5027 5033 +6 + Misses 1326 1323 -3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.