๐ Code of Conduct
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold it. Please report unacceptable behavior to [email protected].๐งญ Ways to Contribute
- ๐ Report bugs - open a clear, reproducible issue.
- ๐ก Suggest features - start a discussion or feature request.
- ๐ Build a gateway/plugin - add a payment gateway or add-on (see below).
- ๐ Translate - add or improve a language catalog (see TRANSLATIONS.md).
- ๐ Improve docs - fix typos, clarify guides, expand examples.
- ๐งน Improve code - fix bugs, add tests, refactor with care.
Not sure where to start? Look for issues labelledgood first issueorhelp wanted.
๐ Getting Set Up
- Fork the repository and clone your fork.
- Follow LOCAL_SETUP.md to get a local instance running (~2 minutes).
-
Create a feature branch from
dev(the integration branch PRs target):
bcmath, json, mbstring, openssl, pdo_mysql, curl), Composer 2, MySQL 8 / MariaDB 10.4+.
๐ Development Workflow
- Make your changes in a focused branch (one logical change per PR).
- Add or update tests for any behavior you change.
-
Run the full local check suite (this is what CI runs):
- Commit with a clear message and a DCO sign-off (see below).
-
Push to your fork and open a Pull Request against
dev.
โ PRs must passcomposer test,composer analyse, andcomposer lintbefore review. Green checks get reviewed faster.
๐ฏ Coding Standards
OwnPay maintains a high quality bar. Please match the existing code and these rules:- Strict types everywhere. Every PHP file starts with
declare(strict_types=1);as its first statement (no BOM). - PHPStan level 9 must stay green. Donโt suppress errors with baselines,
@phpstan-ignore, or needless casts - fix the root cause. - Money is always bcmath strings, never floats. Financial correctness is non-negotiable.
- Tenant scoping is mandatory. Never run a scoped query without
forTenant()/*Scoped(); useforAllTenants()only for deliberate owner-level views. - Build URLs via
DomainUrlService(buildCheckoutUrl(),buildCallbackUrl()) - never hardcode a host (white-label domains depend on this). - CSRF tokens via
SecurityHelpers::csrfToken()- never read$_SESSIONdirectly. - Prepared statements only. No string-interpolated SQL, ever.
- Escape output. Twig autoescaping stays on; never
|rawuntrusted data. - Keep it lean. No new heavyweight dependencies without discussion; prefer the existing first-party utilities.
- Comments explain why, not what. Document non-obvious decisions.
๐ Contributing a Payment Gateway or Plugin
Gateways and add-ons are plugins undermodules/:
- Create
modules/gateways/<slug>/with amanifest.json(metadata, capabilities, CSP origins, icon). - Add an adapter class implementing
OwnPay\Gateway\GatewayAdapterInterface(use theGatewayDefaultstrait for no-op defaults). - Declare
supportedCurrencies()accurately (return[]for โany currencyโ). - Keep the plugin within the sandbox rules - no
exec,shell_exec,eval, raw PDO, etc. - Test the full flow (initiate โ callback โ verify โ refund) locally.
๐ Contributing Translations
OwnPay has full i18n for both the admin panel and customer checkout. To add or update a language, follow docs/TRANSLATIONS.md - create a dot-notation JSON catalog (keep:placeholders intact) and place core languages in config/languages/.
โ๏ธ Commit Messages & DCO Sign-Off
We use the Developer Certificate of Origin (DCO). By signing off, you certify you have the right to submit the contribution under the projectโs license. Add a sign-off line to every commit by using the-s flag:
feat:, fix:, docs:, refactor:, test:, chore:), though it isnโt strictly enforced.
๐ฅ Pull Request Guidelines
- Keep PRs focused - one logical change each. Split large work into reviewable pieces.
- Fill out the PR description: what changed, why, and how to test it.
- Link the related issue (e.g.
Closes #123). - Update documentation and tests alongside code.
- Be responsive to review feedback - we review with care because this is payment software.
- Ensure all CI checks are green.
โ๏ธ Licensing of Contributions
OwnPay is licensed under the GNU AGPL-3.0. By submitting a contribution, you agree that your work is licensed under the same AGPL-3.0 license as the project (inbound = outbound), and you certify its origin via your DCO sign-off. No separate CLA is required.๐ Thank You
Every issue, PR, translation, and idea moves OwnPay forward. Weโre building this in the open, for the community - and weโre glad youโre here. Questions about contributing? Reach out at [email protected] or open a discussion.โค๏ธ Built by the Community, for the Community.