feat: add PHP, .NET, and Java language support to Lego system builder#3
Open
theCreedo wants to merge 22 commits into
Open
feat: add PHP, .NET, and Java language support to Lego system builder#3theCreedo wants to merge 22 commits into
theCreedo wants to merge 22 commits into
Conversation
…arsing - Remove Node-only guard; supported languages are now node and php - Add resolveForLanguage() helper: flat arrays/maps treated as node-only shorthand; language-keyed objects select by spec.language - Add .php and .sh to textExtensions so PHP scaffold files get slot-rendered
- router.php: static file serving from public/ + route dispatch to index.php
modeled on dispute-management/php/router.php
- index.php: generated entry point with {{ SLOT }} markers mirroring index.js
- core/config.php: GpApiConfig setup from env, ServicesContainer registration
modeled on dispute-management/php/sdk-config.php
- core/error-handler.php: sendError() normalizes SDK exceptions to JSON
- composer.json: globalpayments/php-sdk ^13.4, vlucas/phpdotenv ^5.5, phpunit ^11
- run.sh: composer install + php -S built-in server
- README.md: gold-standard per-language format with {{ SLOT }} markers
- tests/ProjectTest.php: PHPUnit smoke test, skips without credentials
- public/: shared branded assets copied from scaffold/node/public/
- token-helper.php: generateAccessToken() via direct cURL + SHA-512 (per AGENTS.md from online-card-payments — not PHP SDK method) - studs/fragments/token-helper-route.php: GET /api/access-token handler - bricks/payments.php: charge(), authorize(), capture() using PHP SDK CreditCardData->charge()->withCurrency()->execute() - bricks/fragments/charge-route.php: POST /api/charge handler - bricks/fragments/authorize-route.php: POST /api/authorize handler - bricks/fragments/capture-route.php: POST /api/capture/:id handler - All manifests updated with language-keyed files/inserts (node + php) - builder: skip core/ vendoring for PHP (baked into scaffold); apply resolveForLanguage to test_fragments; language-aware next-steps output - specs/simple-checkout-php.yaml: first PHP spec (tiles: hosted-fields, bricks: charge) - Verified: two builds produce byte-identical output
ASP.NET Core Minimal API shell (net9.0) with named slot markers, ServicesContainer baseplate config, and static-file serving from public/.
Jakarta EE Servlet dispatching on method+URI (mirrors PHP routing pattern), embedded Tomcat 10.x via Cargo Maven plugin, mvn integration-test to build and start in one step.
Direct REST call to /ucp/accesstoken with SHA-512(nonce+appKey) secret,
scoped to PMT_POST_Create_Single permission. Returns { accessToken, environment }.
Stateless Payments class wrapping CreditCardData SDK calls. Amount parsed from string to handle JSON string values from the frontend.
Adds files/inserts entries for dotnet and java to token-helper, charge, authorize, capture, and hosted-fields manifests.
Adds dotnet/java to SUPPORTED_LANGUAGES, nextSteps, and textExtensions. Java component files are vendored to src/main/java/com/globalpayments/sample/ instead of components/ to satisfy Maven package structure requirements.
simple-checkout and delayed-capture variants for both languages. All four generate and build verified clean.
Drops "Node vertical slice" title, adds language support matrix, updates layout section and quick start for all 4 languages, marks Phase 1-2 complete in roadmap.
slogsdon
requested changes
Jun 24, 2026
… files Replace the single payments.* file (containing all three methods) with per-operation charge/authorize/capture files across all four languages, so each generated project includes only the operations it needs.
…k imports Each route fragment now requires its own per-operation module instead of the shared payments file. C# fragments include a requires comment listing the using directives needed to make the fragment self-contained.
Each language now calls the SDK's token generation method directly, matching the pattern already used in the Node implementation.
Conditionally render the authorization code result row so capture responses (which don't include an auth code) don't show a blank value.
Drop ./run.sh from PHP next steps in favor of the direct php -S command. Add dotnet restore and dotnet test for .NET. Add mvn dependency:resolve and mvn test for Java so all languages show consistent install/run/test steps.
…age suffix Rename simple-checkout.yaml and delayed-capture.yaml to include the -node suffix, matching the PHP, .NET, and Java spec naming convention. Rename golden/simple-checkout to golden/simple-checkout-node and update the snapshot harness to match.
Add quick start commands for all four languages under the delayed-capture section. Replace ./run.sh with the direct php -S command for PHP to match the builder output and keep all languages consistent.
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.
No description provided.