Releases: CHIPAsia/chip-php-sdk
Releases · CHIPAsia/chip-php-sdk
Release list
v2.0.2
Added
- Expand
PurchaseBuilderfluent API with all missing CHIP Collect fields - Add top-level Purchase builder methods:
clientId,sendReceipt,skipCapture,forceRecurring,reference,issued,due,creatorAgent,platform,tags - Add
PurchaseDetailsbuilder methods:notes,debt,subtotalOverride,totalTaxOverride,totalDiscountOverride,totalOverride,requestClientDetails,timezone,dueStrict,emailMessage,shippingOptions,paymentMethodDetails,hasUpsellProducts,singleAttempt,metadata - Add
ClientDetailsbuilder methods:clientPersonalCode,clientStreetAddress,clientCountry,clientCity,clientZipCode,clientState,clientShippingStreetAddress,clientShippingCountry,clientShippingCity,clientShippingZipCode,clientShippingState,clientCc,clientBcc,clientLegalName,clientBrandName,clientRegistrationNumber,clientTaxNumber,clientBankAccount,clientBankCode - Extend
addProduct()with optional$discount,$taxPercent,$category,$totalPriceOverrideparameters
v2.0.1
Fixed
- Fix v2.0.0 examples to use resource-based API (
$chip->purchases->create()instead of$chip->createPurchase()) - Exclude non-production files from Composer dist via
.gitattributes(/examples,/tests, CI configs, dev tooling)
v2.0.0
Added
- Add custom exception hierarchy for API error handling (
ChipApiException,AuthenticationException,NotFoundException,ValidationException,ClientException,ServerException) - Add PSR-3 logger injection support for request/response observability
- Add configurable request timeout via constructor
$configarray - Add
PurchaseBuilderfluent API for constructing purchase objects - Add PHPStan (level 8) and PHP-CS-Fixer configuration
- Add GitHub Actions CI workflow (tests on PHP 8.1–8.3, static analysis, code style)
- Add GitHub Actions PR summary automation via Ollama Cloud
- Add GitHub Actions changelog validation and release automation
- Expand test coverage: model mapping tests, exception handling tests, logger integration, timeout configuration, billing API tests, webhook verification tests
- Add new endpoints and models: Account (balance, turnover), PublicKey, Statements, Client CRUD, Webhook list/update, Purchase resend invoice
- Add
ClientRecurringToken,ClientRecurringTokenList,CompanyStatement,CompanyStatementList,WebhookListmodels - Add
Chip\Http\ClientInterfaceinternal HTTP abstraction withGuzzleClientimplementation - Add
RetryClientdecorator with exponential backoff for 429/5xx responses - Add resource classes:
PurchasesResource,ClientsResource,WebhooksResource,PaymentMethodsResource,AccountResource,StatementsResource,PublicKeyResource,BillingResource - Add
fromArray()static factory methods to all models replacing JsonMapper - Add pagination iterators (
iterate(),iterateTemplates(),iterateClients()) for list endpoints
Changed
- Bump PHP requirement from
>=7.2.0to^8.1 - Rewrite
ChipApifrom trait-based architecture to resource-based architecture ($chip->purchases->create()instead of$chip->createPurchase()) - Replace JsonMapper with typed
fromArray()static factory methods on all models - Add automatic retry with exponential backoff for 429 and 5xx responses
- Rewrite
ChipApi::request()to catch Guzzle HTTP exceptions and throw domain-specific exceptions - Upgrade PHPUnit to ^10.5, PHPStan to ^2.1, PHP-CS-Fixer to ^3.95
- Rewrite README with badges, quick-start, API reference, error handling docs
- Rewrite MIGRATION.md with resource API migration guide and pagination docs
- Add CONTRIBUTING.md with development workflow guidelines
- Update CLAUDE.md with new commands and architecture details
Removed
- Remove
netresearch/jsonmapperdependency - Remove
Chip\Traits\Api\*traits (Purchase,PaymentMethod,Client,Webhook,Billing,PublicKey,Account,Statements)
Fixed
- Fix implicitly nullable parameter warnings in
Purchasetrait by using explicit nullable types (?int) - Fix existing tests to pass correct types (string IDs,
Purchaseobjects) - Add property and return types to billing models and traits for PHPStan level 8 compliance
- Fix composer.json missing required
descriptionfield for strict validation - Fix model properties to match OpenAPI spec:
Product::quantity,Product::tax_percentare nowstring|null;Purchase::issuedis nowstring|null;Purchase::status_historyis nowarray