Skip to content

πŸŽ‰ Digistore24 API Client v2.0.0

Choose a tag to compare

@PaulGossen PaulGossen released this 08 Nov 13:49
· 52 commits to main since this release

Major Release - Complete rewrite with PHP 8.4 property hooks, modern architecture, and extensive quality improvements.


πŸš€ Highlights

PHP 8.4 Property Hooks

Automatic validation on property assignment - no more boilerplate constructors:

$buyer = new BuyerData();
$buyer->email = 'test@example.com';  // βœ… Auto-validated
$buyer->country = 'de';              // βœ… Auto-uppercased to 'DE'

Cleaner API Calls

Methods with optional parameters no longer require explicit Request objects:

// v1.x - Always needed Request object
$products = $ds24->products->list(new ListProductsRequest());

// v2.0 - Much cleaner!
$products = $ds24->products->list();

Enterprise-Grade Quality

  • βœ… 1,130 passing unit tests (100% success rate)
  • βœ… PHPStan Level 9 (maximum strictness) - 0 errors
  • βœ… 98% code coverage (lines), 99% functions, 100% classes
  • βœ… 85%+ mutation score (test quality validation)
  • βœ… PSR-12 compliant (0 code style violations)

Complete API Coverage

  • βœ… 122 endpoints fully implemented
  • βœ… 12 resource categories (Affiliates, Products, Purchases, etc.)
  • βœ… Comprehensive documentation for every endpoint

πŸ’₯ Breaking Changes

1. Namespace Change

// OLD
use GoSuccess\Digistore24\Digistore24;

// NEW
use GoSuccess\Digistore24\Api\Digistore24;

2. Constructor Signature

// OLD
$ds24 = new Digistore24(apiKey: 'YOUR-KEY');

// NEW
$config = new Configuration(apiKey: 'YOUR-KEY');
$ds24 = new Digistore24($config);

3. PHP Version Requirement

  • Minimum PHP 8.4.0 (required for property hooks)

πŸ“– Full migration guide: See MIGRATION.md


✨ What's New

Architecture & Quality

  • πŸ—οΈ Resource-based architecture with clean separation of concerns
  • 🎯 Type-safe - Full type hints, enums, and strict typing throughout
  • πŸ”„ Automatic retry - Built-in exponential backoff for failed requests
  • 🚦 Rate limiting - Graceful handling of API rate limits
  • πŸ“ Fully documented - Comprehensive PHPDoc with examples

Developer Experience

  • βœ… GitHub Actions CI/CD - Automated testing, static analysis, code style checks
  • βœ… PHPStan Level 9 - Maximum type safety with baseline tracking
  • βœ… PHP CS Fixer - PSR-12 + PHP 8.4 rules enforced
  • βœ… Infection - Mutation testing for test quality validation
  • βœ… Dependabot - Automated dependency updates

Documentation

  • πŸ“š 122 endpoint docs organized in 29 categories
  • πŸ“– Migration guide with find-replace instructions
  • πŸ§ͺ Testing guide with coverage setup
  • πŸ› οΈ Developer setup with IDE configuration
  • πŸ“‹ Changelog with complete version history
  • πŸ”’ Security policy with vulnerability reporting

New Features

  • πŸŽ‰ Optional Request parameters - 39+ methods across 27 Resources
  • 🎨 15 typed DTOs with property hooks (BuyerData, PaymentPlanData, etc.)
  • πŸ”§ Configuration object - Centralized config with validation
  • ⚑ Lazy loading - Resources initialized on-demand

πŸ“¦ Installation

# Fresh install
composer require gosuccess/digistore24-api

# Upgrade from v1.x
composer remove gosuccess/php-ds24-api-wrapper
composer require gosuccess/digistore24-api

🎯 Quick Start

use GoSuccess\Digistore24\Api\Digistore24;
use GoSuccess\Digistore24\Api\Client\Configuration;

// Initialize
$config = new Configuration(apiKey: 'YOUR-API-KEY');
$ds24 = new Digistore24($config);

// Simple calls (no Request object needed)
$products = $ds24->products->list();
$userInfo = $ds24->users->getInfo();
$ping = $ds24->monitoring->ping();

// Advanced calls (with Request object for filters)
$purchases = $ds24->purchases->list(
    new ListPurchasesRequest(
        fromDate: new DateTime('-7 days'),
        toDate: new DateTime('now')
    )
);

πŸ“Š Quality Metrics

Metric Value Status
Unit Tests 1,130 passing βœ… 100%
Assertions 2,227 βœ…
Code Coverage Lines ~98%, Functions ~99% βœ…
Mutation Score 85%+ MSI βœ…
PHPStan Level 9 (max) βœ… 0 errors
Code Style PSR-12 βœ… 0 violations
Endpoints 122 implemented βœ… 100%

πŸ”§ Infrastructure

GitHub Actions Workflows

  • βœ… Tests - PHPUnit with coverage reporting
  • βœ… Static Analysis - PHPStan Level 9
  • βœ… Code Style - PHP CS Fixer with PSR-12

Composer Scripts

composer test              # Run all tests
composer test:coverage     # Coverage report
composer analyse           # PHPStan analysis
composer cs:check          # Code style check
composer cs:fix            # Auto-fix code style
composer check             # All quality checks

Dependency Management

  • πŸ€– Dependabot - Weekly Composer updates, monthly GitHub Actions
  • πŸ“¦ Automated PRs - Security and version updates

πŸ› οΈ API Resources

Resource Endpoints Documentation
Affiliates 8 Commission management
Billing 3 Invoicing & payments
Buyers 8 Customer information
Buy URLs 3 Order form management
Countries 2 Country & currency data
IPNs 3 Webhook management
Monitoring 1 Health checks
Products 59 Product management
Purchases 24 Order information
Rebilling 4 Subscription management
Users 3 Authentication & settings
Vouchers 6 Discount codes

Total: 122 endpoints across 12 resource categories


πŸ“š Documentation


πŸ™ Thank You

Special thanks to all contributors who helped make v2.0 possible! This release represents months of refactoring, testing, and quality improvements.


πŸ› Found a Bug?

Report issues: https://github.com/GoSuccessHQ/digistore24-api/issues


πŸ“„ License

MIT License - see LICENSE


Full Changelog: https://github.com/GoSuccessHQ/digistore24-api/blob/main/docs/CHANGELOG.md