Add Lists, Privacy and Webhook verification APIs#52
Closed
bartes wants to merge 5 commits into
Closed
Conversation
- Lists API: createList, getAllLists, getList, updateList, deleteList, queryList - List Items API: createListItem, createListItems, getListItem, updateListItem, queryListItems, countListItems, archiveListItem, unarchiveListItem - Privacy API: requestUserData, deleteUserData - Webhook signature verification via Castle_Webhook::verify and the Castle_WebhookVerificationError exception - Attach the request context automatically to risk, filter and log requests - Harden API error handling against empty error response bodies
Avoids the dynamic-property deprecation (which becomes a fatal error in PHP 9).
- Replace CircleCI with GitHub Actions: a Specs workflow with a PHP version matrix (7.2-8.4) and a Lint workflow (composer validate + php -l) - Pin phpunit to ^8.5 || ^9.6 and drop the unused php-coveralls dependency - Declare the curl/json extension requirements in composer.json - Simplify phpunit.xml to the modern schema - Update the README to install via Composer and document supported versions
1242e74 to
457129a
Compare
Add an ISO8601 millisecond-precision sent_at timestamp automatically to risk, filter and log requests, matching the behaviour of the other Castle SDKs (closes #23). Default Castle_ApiError's message to an empty string and coalesce null to avoid the PHP 8.1+ deprecation when an error body is empty.
This was referenced Jun 8, 2026
Contributor
Author
|
Consolidated into #53, which now targets |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR brings the PHP SDK in line with the broader Castle API surface by adding the Lists, List Items and Privacy APIs, along with webhook signature verification, and modernizes the project tooling.
It adds the Lists API (
createList,getAllLists,getList,updateList,deleteList,queryList) and the List Items API (createListItem,createListItems,getListItem,updateListItem,queryListItems,countListItems,archiveListItem,unarchiveListItem), each returning the decoded API response.It adds the Privacy API (
requestUserData,deleteUserData) for requesting and deleting the data Castle stores for a user.It adds webhook signature verification through
Castle_Webhook::verify, which validates the raw request body against theX-Castle-Signatureheader (reading both from the request by default) and raises the newCastle_WebhookVerificationErroron a mismatch.The request context is now attached automatically to
risk,filterandlogrequests, matching the existing behaviour oftrack. API error handling is hardened against empty error response bodies, and theCastle_ApiErrorproperties are declared for PHP 8/9 compatibility.Tooling is modernized: CI moves from CircleCI to GitHub Actions with a
Specsworkflow that runs the suite across PHP 7.2 through 8.4 and aLintworkflow (composer validate+php -l). PHPUnit is pinned to^8.5 || ^9.6, the unusedphp-coverallsdev dependency is dropped, thecurl/jsonextensions are declared, andphpunit.xmlis simplified to the modern schema.The README now installs via Composer and documents supported versions; the README and CHANGELOG document the new methods.