Skip to content

Releases: axcherednikov/cloudpayments-php-client

4.0.2: complete Throwable exception contract

Choose a tag to compare

@axcherednikov axcherednikov released this 03 Oct 19:09
5f81220

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 Throwable at all API and request boundaries and verifies original exception/error propagation for every API method.
  • make phpstan now 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

Choose a tag to compare

@axcherednikov axcherednikov released this 03 Oct 17:55
57749f8

Fixed

  • All 32 public API methods now explicitly declare GuzzleException and JsonException through @throws, including subscriptionsCreate(). Methods returning transaction DTOs also declare ResponseFormatException.
  • 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

Choose a tag to compare

@axcherednikov axcherednikov released this 03 Oct 12:33
3016430

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 (extends CloudpaymentsException) 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

  1. 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.

  2. Handle ResponseFormatException when an API response contains an invalid transaction model. Integer request DTO signatures are unchanged.

  3. Custom subclasses that redeclare a response model property must use the native mixed type, for example public 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

Choose a tag to compare

@axcherednikov axcherednikov released this 23 Jul 21:09

What's Changed

Full Changelog: 3.2.4...3.3.0

Install composer-bin

Choose a tag to compare

@axcherednikov axcherednikov released this 09 Jun 22:04
3.2.2

The cache was moved to the folder tmp