{"id":28758546,"url":"https://github.com/drhdev/cppp","last_synced_at":"2025-10-26T04:39:05.628Z","repository":{"id":298011538,"uuid":"998572218","full_name":"drhdev/cppp","owner":"drhdev","description":"A simple PHP webhook to check for PayPal payments","archived":false,"fork":false,"pushed_at":"2025-06-08T22:30:43.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-17T04:08:52.538Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drhdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-08T22:25:46.000Z","updated_at":"2025-06-08T22:30:47.000Z","dependencies_parsed_at":"2025-06-08T23:25:47.205Z","dependency_job_id":"a3327c10-e8b5-4374-bbc6-11f4a4c6f718","html_url":"https://github.com/drhdev/cppp","commit_stats":null,"previous_names":["drhdev/cppp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/drhdev/cppp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drhdev%2Fcppp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drhdev%2Fcppp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drhdev%2Fcppp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drhdev%2Fcppp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drhdev","download_url":"https://codeload.github.com/drhdev/cppp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drhdev%2Fcppp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281059638,"owners_count":26437056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-26T02:00:06.575Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-17T04:08:51.517Z","updated_at":"2025-10-26T04:39:05.601Z","avatar_url":"https://github.com/drhdev.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CPPP - Check PayPal Payments\n\nA secure and robust PHP-based payment processing system that handles PayPal webhook notifications, processes payments, and sends notifications via Telegram.\n\n## Features\n\n- 🔒 Secure PayPal webhook handling with signature verification\n- 💾 SQLite database with connection pooling for payment storage\n- 📊 Comprehensive payment statistics (24h, 7d, 28d)\n- 📱 Telegram notifications for new payments\n- ⚡ Rate limiting to prevent abuse\n- 📝 Detailed logging with automatic log rotation\n- 🧪 Comprehensive test suite\n\n## Requirements\n\n- PHP 7.4 or higher\n- Python 3.9 or higher (for testing)\n- SQLite3\n- PayPal Business Account\n- Telegram Bot Token\n\n## Installation\n\n1. Clone the repository:\n```bash\ngit clone \u003crepository-url\u003e\ncd cppp\n```\n\n2. Set up the directory structure:\n```bash\nmkdir -p cppp_secure/database cppp_secure/logs\n```\n\n3. Configure the application:\n   - Copy `config.php` and update the following settings:\n     - PayPal webhook ID\n     - PayPal client ID and secret\n     - Telegram bot token and chat ID\n     - Database path\n     - Logging settings\n\n4. Set proper permissions:\n```bash\nchmod 755 cppp\nchmod 644 cppp/*.php\nchmod 755 cppp_secure\nchmod 755 cppp_secure/database\nchmod 755 cppp_secure/logs\n```\n\n## Testing\n\nThe project includes a comprehensive test suite written in Python. To run the tests:\n\n1. Create and activate a virtual environment:\n```bash\npython3 -m venv venv\nsource venv/bin/activate\n```\n\n2. Install required packages:\n```bash\npip install requests\n```\n\n3. Run the tests:\n```bash\npython -m unittest test/test_cppp.py -v\n```\n\nThe test suite covers:\n- Configuration file structure\n- Database operations\n- Rate limiting\n- Telegram notifications\n- Log rotation\n- PayPal webhook verification\n\n## Usage\n\n1. Set up a PayPal webhook in your PayPal Developer Dashboard:\n   - Event type: `PAYMENT.SALE.COMPLETED`\n   - URL: `https://your-domain.com/cppp/cppp.php`\n\n2. Configure your web server (Apache/Nginx) to point to the `cppp` directory.\n\n3. The system will automatically:\n   - Verify incoming PayPal webhook signatures\n   - Store payment information in the SQLite database\n   - Send notifications to your configured Telegram chat\n   - Maintain payment statistics\n   - Rotate logs when they exceed the size limit\n\n## Configuration\n\nThe `config.php` file contains all necessary configuration options:\n\n```php\nreturn [\n    'database' =\u003e [\n        'path' =\u003e '/path/to/cppp_secure/database/cppp.db',\n        'pool_size' =\u003e 5,\n        'cleanup_days' =\u003e 60\n    ],\n    'paypal' =\u003e [\n        'webhook_id' =\u003e 'YOUR_WEBHOOK_ID',\n        'client_id' =\u003e 'YOUR_CLIENT_ID',\n        'client_secret' =\u003e 'YOUR_CLIENT_SECRET'\n    ],\n    'telegram' =\u003e [\n        'bot_token' =\u003e 'YOUR_BOT_TOKEN',\n        'chat_id' =\u003e 'YOUR_CHAT_ID',\n        'service_name' =\u003e 'My Webservice',\n        'message_template' =\u003e '...'\n    ],\n    'logging' =\u003e [\n        'path' =\u003e '/path/to/cppp_secure/logs',\n        'filename' =\u003e 'cppp.log',\n        'max_size' =\u003e 5 * 1024 * 1024\n    ],\n    'rate_limiting' =\u003e [\n        'max_requests' =\u003e 100,\n        'time_window' =\u003e 3600\n    ]\n];\n```\n\n## Security Considerations\n\n- The `cppp_secure` directory should be placed outside the web root\n- All sensitive configuration is stored in `config.php`\n- Webhook signatures are verified for each request\n- Rate limiting prevents abuse\n- Logs are automatically rotated to prevent disk space issues\n\n## License\n\nThis project is licensed under the GNU Public License - see the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrhdev%2Fcppp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrhdev%2Fcppp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrhdev%2Fcppp/lists"}