-
Notifications
You must be signed in to change notification settings - Fork 9
Contributing
Hassaan Ali edited this page Dec 7, 2025
·
1 revision
Thank you for considering contributing to the JazzCash package! This document provides guidelines for contributing.
Please read and follow our Code of Conduct.
- Check existing issues - Search for similar issues
-
Create detailed issue - Include:
- Description of the bug
- Steps to reproduce
- Expected behavior
- Actual behavior
- Environment details (PHP version, Laravel version, etc.)
- Error messages/logs
- Check existing issues - Search for similar suggestions
-
Create feature request - Include:
- Use case description
- Proposed solution
- Benefits
- Possible implementation approach
- Fork the repository
-
Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Write/update tests
- Update documentation
- Follow coding standards (PSR-12)
-
Commit your changes:
git commit -m 'Add amazing feature' -
Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
git clone https://github.com/zfhassaan/jazzcash.git
cd jazzcashcomposer install./vendor/bin/phpunitThe package follows PSR-12 coding standards. Use PHP CS Fixer or Laravel Pint:
# Using Laravel Pint
./vendor/bin/pint
# Or using PHP CS Fixer
./vendor/bin/php-cs-fixer fix- Proper spacing and indentation
- Type declarations on all methods
- Strict types enabled (
declare(strict_types=1)) - Consistent naming conventions
- Proper visibility modifiers
- DocBlocks for all classes and methods
<?php
declare(strict_types=1);
namespace zfhassaan\JazzCash;
/**
* Service description.
*/
class MyService
{
/**
* Method description.
*
* @param string $param Parameter description
* @return array<string, mixed>
*/
public function myMethod(string $param): array
{
// Implementation
}
}All new features must include tests:
- Unit tests - For individual methods/classes
- Feature tests - For complete flows
- Edge cases - Test error conditions
<?php
namespace Tests\Unit;
use Tests\TestCase;
use zfhassaan\JazzCash\JazzCash;
class MyTest extends TestCase
{
public function test_my_method_returns_expected_result(): void
{
// Arrange
$jazzcash = new JazzCash();
// Act
$result = $jazzcash->myMethod('input');
// Assert
$this->assertNotNull($result);
}
}# All tests
./vendor/bin/phpunit
# Specific test
./vendor/bin/phpunit tests/Unit/MyTest.php
# With coverage
./vendor/bin/phpunit --coverageWhen adding features:
- Update README.md - If needed
- Update wiki - Add/update relevant wiki pages
- Add code comments - Document complex logic
- Update changelog - Add entry to changelog.md
Wiki pages are in wiki/ directory:
- Home.md - Main landing page
- Installation-Guide.md - Installation
- Configuration-Guide.md - Configuration
- Getting-Started.md - Quick start
- Understanding-Hosted-Checkout.md - Hosted checkout
- API-Reference.md - API documentation
- Payment-Flow.md - Payment flow
- Testing-Guide.md - Testing
- Troubleshooting.md - Troubleshooting
- Security-Best-Practices.md - Security
- Contributing.md - This file
Follow conventional commits:
feat: Add new payment method
fix: Fix hash generation issue
docs: Update installation guide
test: Add tests for new feature
refactor: Refactor payment service
chore: Update dependencies
- Tests pass - All tests must pass
- Code style - Follows PSR-12
- Documentation - Updated if needed
- No breaking changes - Or document them
- Changelog updated - Add entry
Include:
- Description - What and why
- Changes - List of changes
- Testing - How to test
- Screenshots - If UI changes
- Breaking changes - If any
- Automated checks - CI/CD runs tests
- Code review - Maintainers review code
- Feedback - Address any feedback
- Merge - Once approved
Follow Semantic Versioning:
- MAJOR - Breaking changes
- MINOR - New features (backward compatible)
- PATCH - Bug fixes
If you have questions:
- Check documentation - Review wiki pages
- Search issues - Look for similar questions
- Create issue - Ask in GitHub issues
- Email - zfhassaan@gmail.com
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to the JazzCash package! Your contributions help make this package better for everyone.