{"id":31028218,"url":"https://github.com/classyid/payment-receipt-api","last_synced_at":"2026-02-13T02:47:01.032Z","repository":{"id":311200202,"uuid":"1042859182","full_name":"classyid/payment-receipt-api","owner":"classyid","description":"API ekstraksi data bukti pembayaran menggunakan Gemini AI. Mendukung 30+ platform seperti mobile banking, e-wallet, dan payment gateway Indonesia.","archived":false,"fork":false,"pushed_at":"2025-08-22T17:39:29.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-22T19:59:29.691Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/classyid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-08-22T17:37:32.000Z","updated_at":"2025-08-22T17:39:32.000Z","dependencies_parsed_at":"2025-08-22T19:59:30.916Z","dependency_job_id":"ab2f66a2-f840-4881-8280-a40c24a162e2","html_url":"https://github.com/classyid/payment-receipt-api","commit_stats":null,"previous_names":["classyid/payment-receipt-api"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/classyid/payment-receipt-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/classyid%2Fpayment-receipt-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/classyid%2Fpayment-receipt-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/classyid%2Fpayment-receipt-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/classyid%2Fpayment-receipt-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/classyid","download_url":"https://codeload.github.com/classyid/payment-receipt-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/classyid%2Fpayment-receipt-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275020152,"owners_count":25391651,"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-09-13T02:00:10.085Z","response_time":70,"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-09-13T20:06:42.253Z","updated_at":"2026-02-13T02:47:01.026Z","avatar_url":"https://github.com/classyid.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Payment Receipt API\n\nAPI ekstraksi data bukti pembayaran menggunakan Gemini AI dengan dukungan untuk 30+ platform payment Indonesia.\n\n## Features\n\n- **Multi-Platform Support**: BNI Mobile, BCA, DANA, Flip, BSI, Bank Jatim, dan 25+ platform lainnya\n- **Advanced OCR**: Powered by Gemini AI untuk akurasi ekstraksi data tinggi\n- **Comprehensive Data Extraction**: 40+ data points termasuk nominal, tanggal, pengirim, penerima\n- **Load Balancing**: Multi API key support dengan automatic failover\n- **RESTful API**: JSON response dengan pagination dan search capabilities\n- **Database Storage**: SQLite dengan schema komprehensif untuk audit trail\n\n## Supported Platforms\n\n### Mobile Banking\n- BNI Mobile (wondr), BCA Mobile, BRI Mobile, Mandiri (Livin')\n- Bank Syariah Indonesia (BSI), BYOND by BSI\n- Bank Jatim, Bank Muamalat\n\n### E-Wallets\n- DANA, OVO, GoPay, LinkAja, ShopeePay\n\n### Payment Gateways\n- Flip, Midtrans, Virtual Account\n\n### Physical Receipts\n- ATM Transfer receipts, SMS Banking, Bank slips\n\n## Quick Start\n\n### Prerequisites\n- Python 3.7+\n- Gemini API key\n\n### Installation\n\n1. Clone repository:\n```bash\ngit clone https://github.com/classyid/payment-receipt-api.git\ncd payment-receipt-api\n```\n\n2. Install dependencies:\n```bash\npip install flask flask-cors requests\n```\n\n3. Configure API key:\n```python\n# Edit bukti.py\nGEMINI_API_KEYS = [\n    'your-gemini-api-key-here'\n]\n```\n\n4. Run the application:\n```bash\npython bukti.py\n```\n\nAPI akan berjalan di `http://localhost:5579`\n\n## API Usage\n\n### Process Payment Receipt\n\n```bash\ncurl -X POST http://localhost:5579/api/process-payment \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"fileData\": \"base64_encoded_image_data\",\n    \"fileName\": \"receipt.jpg\",\n    \"mimeType\": \"image/jpeg\"\n  }'\n```\n\n### Response Example\n\n```json\n{\n  \"status\": \"success\",\n  \"data\": {\n    \"analysis\": {\n      \"parsed\": {\n        \"platform\": \"BNI Mobile\",\n        \"transaction\": {\n          \"status\": \"Berhasil\",\n          \"amount\": \"664025\",\n          \"date\": \"14/08/2025\",\n          \"type\": \"BI-FAST\"\n        },\n        \"sender\": {\n          \"name\": \"xy\",\n          \"bank\": \"BNI\"\n        },\n        \"receiver\": {\n          \"name\": \"xx\",\n          \"bank\": \"BSI\"\n        }\n      }\n    }\n  }\n}\n```\n\n## API Endpoints\n\n| Endpoint | Method | Description |\n|----------|---------|-------------|\n| `/api/process-payment` | POST | Process payment receipt |\n| `/api/docs` | GET | API documentation |\n| `/api/stats` | GET | Usage statistics |\n| `/api/payments/history` | GET | Payment history |\n| `/api/payments/search` | GET | Search payments |\n| `/api/health` | GET | Health check |\n\n## Data Extraction Capabilities\n\n- **Transaction Info**: Status, date, time, amount, fees, reference numbers\n- **Party Details**: Sender/receiver names, bank info, account numbers\n- **Platform Data**: App name, channel, terminal info\n- **Additional**: Description, purpose, merchant, location, balances\n\n## Configuration\n\n### Environment Variables (Optional)\n```bash\nexport GEMINI_API_KEY=\"your-api-key\"\nexport DATABASE_PATH=\"payment_receipts.db\"\nexport UPLOAD_FOLDER=\"uploads\"\n```\n\n### Multiple API Keys\n```python\nGEMINI_API_KEYS = [\n    'key1-for-load-balancing',\n    'key2-for-failover',\n    'key3-for-high-availability'\n]\n```\n\n## Performance\n\n- **Processing Time**: 2-5 seconds per document\n- **Accuracy Rate**: 95%+ for clear documents\n- **Supported File Types**: JPG, PNG, PDF, GIF, BMP, WebP\n- **Max File Size**: 16MB\n- **Concurrent Requests**: Unlimited with load balancing\n\n## Database Schema\n\n### payment_receipts\nStores extracted payment data with 40+ fields including:\n- Transaction details (status, amount, fees, dates)\n- Party information (sender/receiver details)\n- Platform-specific data (app, channel, terminal)\n- Additional metadata (merchant, location, balances)\n\n### metadata\nFile information and processing status\n\n### logs\nAPI calls, errors, and processing history\n\n## Development\n\n### Project Structure\n```\npayment-receipt-api/\n├── bukti.py              # Main application\n├── uploads/              # File storage\n├── payment_receipts.db   # SQLite database\n├── requirements.txt      # Dependencies\n└── README.md\n```\n\n### Testing\n```bash\n# Health check\ncurl http://localhost:5579/api/health\n\n# Get statistics\ncurl http://localhost:5579/api/stats\n\n# View documentation\ncurl http://localhost:5579/api/docs\n```\n\n## Error Handling\n\n- Automatic retry with multiple API keys\n- Comprehensive error logging\n- Graceful fallback for parsing failures\n- Input validation and sanitization\n\n## Security\n\n- File type validation\n- Size limits\n- SQL injection protection\n- Error message sanitization\n- No sensitive data in logs\n\n## Contributing\n\n1. Fork the repository\n2. Create feature branch (`git checkout -b feature/new-feature`)\n3. Commit changes (`git commit -am 'Add new feature'`)\n4. Push to branch (`git push origin feature/new-feature`)\n5. Create Pull Request\n\n## License\n\nMIT License - see LICENSE file for details\n\n## Support\n\n- Create an issue for bug reports\n- Feature requests welcome\n- Documentation improvements appreciated\n\n## Changelog\n\n### v3.0.0\n- Enhanced AI prompt for better recognition\n- Added 30+ platform support\n- Implemented load balancing\n- Added comprehensive database schema\n- New search and pagination features\n\n### v2.0.0\n- Added multiple platform support\n- Enhanced error handling\n- Database storage implementation\n\n### v1.0.0\n- Initial release with basic payment processing\n\n## Acknowledgments\n\n- Powered by Google Gemini AI\n- Built with Flask framework\n- Inspired by Indonesian fintech ecosystem\n\n---\n\n**Note**: This API is designed for Indonesian payment platforms. Ensure compliance with local data protection regulations when processing financial documents.\n```\n\n## Additional Files to Include\n\n### .gitignore\n```\n# Python\n__pycache__/\n*.pyc\n*.pyo\n*.pyd\n.Python\nenv/\nvenv/\n.venv/\npip-log.txt\npip-delete-this-directory.txt\n\n# Database\n*.db\n*.sqlite3\n\n# Uploads\nuploads/\n*.jpg\n*.png\n*.pdf\n\n# Environment\n.env\n.env.local\n\n# IDE\n.vscode/\n.idea/\n*.swp\n*.swo\n\n# Logs\n*.log\nlogs/\n\n# OS\n.DS_Store\nThumbs.db\n```\n\n### requirements.txt\n```\nflask==2.3.3\nflask-cors==4.0.0\nrequests==2.31.0\ngunicorn==21.2.0\npython-dotenv==1.0.0\n```\n\n### LICENSE (MIT)\n```\nMIT License\n\nCopyright (c) 2025 [Classy Indonesia]\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclassyid%2Fpayment-receipt-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclassyid%2Fpayment-receipt-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclassyid%2Fpayment-receipt-api/lists"}