-
Notifications
You must be signed in to change notification settings - Fork 0
CIVIMM-423: Add Payment Processing Core extension infrastructure #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…support **Critical bug fix:** - Change unique index from `event_id` alone to composite `(event_id, processor_type)` - Prevents cross-processor event ID collisions (e.g., Stripe's evt_123 vs GoCardless's evt_123) - Ensures proper webhook deduplication in multi-processor environments **Files changed:** - xml/schema/CRM/Paymentprocessingcore/PaymentWebhook.xml: Updated index definition - CRM/Paymentprocessingcore/DAO/PaymentWebhook.php: Regenerated DAO - sql/auto_install.sql: Regenerated SQL schema **Impact:** Without this fix, the second processor to emit an event with the same ID would fail to insert, breaking webhook logging and idempotency.
**Issue:** PHPStan workflow was failing with: "Path .../\$GITHUB_WORKSPACE/... does not exist" **Fix:** - Remove backslash escaping from \$GITHUB_WORKSPACE in HERE document - Allow shell variable substitution to work properly in phpstan-ci.neon **Root cause:** The escaped \$GITHUB_WORKSPACE was being written literally instead of being substituted with the actual GitHub workspace path during CI execution.
- Generated CRM/Paymentprocessingcore/Upgrader.php using civix - Updated info.xml to register upgrader class - Added composer install step to CI workflow This fixes the 'DB Error: no such table' failures by ensuring sql/auto_install.sql executes when extension is enabled.
3f4cfaf to
e8d53be
Compare
612099d to
95750fc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces the Payment Processing Core extension, a foundational infrastructure layer that centralizes common payment processing functionality for CiviCRM payment processor extensions (Stripe, GoCardless, Deluxe, etc.). The extension provides reusable database entities for tracking payment attempts and webhook events, along with a comprehensive Docker-based development environment for testing across CiviCRM versions.
Key Changes:
- Added PaymentAttempt and PaymentWebhook entities with API4 support for generic payment tracking across all processors
- Implemented Docker-based development environment with configurable CiviCRM versions and automated testing infrastructure
- Established code quality enforcement with PHPStan Level 9, PHPCS linting, and comprehensive CI workflows
Reviewed changes
Copilot reviewed 43 out of 46 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| xml/schema/CRM/Paymentprocessingcore/PaymentWebhook.xml | Database schema for webhook event logging with deduplication via unique event_id/processor_type constraint |
| xml/schema/CRM/Paymentprocessingcore/PaymentAttempt.xml | Database schema for payment attempt tracking with foreign key relationships to contributions, contacts, and payment processors |
| CRM/Paymentprocessingcore/BAO/PaymentWebhook.php | Business logic for webhook event deduplication and idempotency checks |
| CRM/Paymentprocessingcore/BAO/PaymentAttempt.php | Business logic for payment attempt CRUD operations and lookup methods |
| Civi/Paymentprocessingcore/Utils/PaymentUrlBuilder.php | Utility class for building payment processor redirect URLs (success/cancel/error) |
| tests/phpunit/*.php | Comprehensive test coverage for PaymentAttempt and PaymentWebhook entities via API4 and BAO layers |
| scripts/*.sh | Docker-based development scripts for setup, testing, linting, and static analysis |
| .github/workflows/*.yml | CI workflows for automated testing, linting, and PHPStan analysis |
| docker-compose.*.yml | Docker configurations for test, linting, and PHPStan environments |
| info.xml | Extension metadata defining CiviCRM 6.4+ compatibility and PSR-4/PSR-0 autoloading |
| CLAUDE.md | Comprehensive development guide for AI-assisted coding with project standards and workflows |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Overview
This PR introduces the Payment Processing Core extension, a foundational infrastructure layer for CiviCRM payment processors. It provides reusable database
entities and patterns that eliminate code duplication across multiple payment processor extensions (Stripe, GoCardless, Deluxe, etc.).
Before
N/A
After
The extension provides:
Payment processor extensions can now depend on this core infrastructure instead of reimplementing common functionality.