Repository navigation
Releases: axcherednikov/cloudpayments-php-client
Release list
4.0.2: complete Throwable exception contract
Fixed
All 32 public API methods, sendRequest(), and the internal request() now declare a single @throws Throwable contract. This corrects the incomplete exception lists in 4.0.1, including subscription methods.
Original exceptions and native PHP errors still reach consumers as the same objects, without wrapping. Native request and response types and runtime behavior remain unchanged. The README now includes the common boundary contract and a catch (Throwable) example.
Validation
- 330 PHPUnit tests and 751 assertions passed.
- Contract coverage enforces
@throws Throwableat all API and request boundaries and verifies original exception/error propagation for every API method. make phpstannow also checks missing exception declarations in Library.- Negative checks confirmed that removing public or internal request declarations makes the respective PHPUnit/PHPStan check fail.
- PHPStan level 8, exception analysis, Rector, PHP CS Fixer, Composer validation and diff checks passed.
4.0.1: explicit typed exception contracts
Fixed
- All 32 public API methods now explicitly declare
GuzzleExceptionandJsonExceptionthrough@throws, includingsubscriptionsCreate(). Methods returning transaction DTOs also declareResponseFormatException. - Completed exception declarations for response hydration, transaction model construction and filling, and SBP request validation.
- Expanded the error-handling documentation and corrected the example to handle DTO validation and invalid transaction responses.
This patch preserves existing method signatures, exception types and runtime behavior. PHP uses PHPDoc @throws for exception contracts; input and return DTOs retain their existing native types.
Validation
- 297 PHPUnit tests and 779 assertions passed, including 143 new checks for exception declarations and propagation, and API rejection responses.
- PHPStan level 8, Rector dry run, PHP CS Fixer dry run, Composer validation and diff checks passed.
4.0.0: exact validated transaction IDs
Exact transaction IDs
The SDK validates transaction IDs when creating response models and exposes them as exact PHP int values. Applications can pass $model->transactionId directly to existing request DTOs without repeating format validation.
- Preserve precision for large raw JSON integers without conversion through
float. - Throw
ResponseFormatException(extendsCloudpaymentsException) for missing, malformed, floating-point or out-of-range IDs in a supplied transaction model. - Validate and hydrate supplied models regardless of
Success, including declined payments and 3-D Secure challenges. - Keep successful confirm/void and other contract-valid responses without a model valid.
- Preserve optional model defaults and safely detect the absence of a 3DS challenge.
CloudPayments documents TransactionId as Long and shows it as a JSON number. Signed decimal-string normalization and the PHP_INT_MIN–PHP_INT_MAX representation limit are SDK behavior. No undocumented digit-count or leading-zero restriction is imposed.
Migration from 3.x
-
Use SDK-returned transaction models, or provide response data when constructing them manually:
use Excent\Cloudpayments\Response\Models\TransactionModel; $model = new TransactionModel((object) ['TransactionId' => 123]);
Empty construction followed by
fill()is no longer supported. -
Handle
ResponseFormatExceptionwhen an API response contains an invalid transaction model. Integer request DTO signatures are unchanged. -
Custom subclasses that redeclare a response
modelproperty must use the nativemixedtype, for examplepublic mixed $model = null;, with the appropriate PHPDoc type.
PHP requirement remains 8.1+. No new runtime dependencies.
Local validation passed: 154 PHPUnit tests / 412 assertions, PHPStan, PHP CS Fixer, Rector and Composer validation. The release is published from the merged PR after the PHP 8.1–8.5 CI matrix and quality checks succeed.
New functional
What's Changed
- Release of new payment system functionality by @axcherednikov in #4
Full Changelog: 3.2.4...3.3.0
Install composer-bin
3.2.2 The cache was moved to the folder tmp