{"id":19374793,"url":"https://github.com/malwarebo/gopay","last_synced_at":"2025-02-24T15:26:50.438Z","repository":{"id":103406550,"uuid":"432388150","full_name":"malwarebo/gopay","owner":"malwarebo","description":"Payment orchestration system","archived":false,"fork":false,"pushed_at":"2025-02-23T09:46:15.000Z","size":8867,"stargazers_count":1,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-23T10:18:25.061Z","etag":null,"topics":["gateway","golang","orchestration","payments"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/malwarebo.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}},"created_at":"2021-11-27T06:38:34.000Z","updated_at":"2025-02-23T09:46:19.000Z","dependencies_parsed_at":"2023-11-25T16:22:47.232Z","dependency_job_id":"63c2e83b-5b50-492c-9d30-9956af0d8002","html_url":"https://github.com/malwarebo/gopay","commit_stats":null,"previous_names":["kbww/gopay","malwarebo/gopay"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malwarebo%2Fgopay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malwarebo%2Fgopay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malwarebo%2Fgopay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malwarebo%2Fgopay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/malwarebo","download_url":"https://codeload.github.com/malwarebo/gopay/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240502441,"owners_count":19811803,"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","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":["gateway","golang","orchestration","payments"],"created_at":"2024-11-10T08:36:09.071Z","updated_at":"2025-02-24T15:26:50.431Z","avatar_url":"https://github.com/malwarebo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gopay - Payment Orchestration System\n\n[![Go Build](https://github.com/malwarebo/gopay/actions/workflows/go-build.yml/badge.svg)](https://github.com/malwarebo/gopay/actions/workflows/go-build.yml)\n\nGopay is an open-source payment orchestration system that supports multiple payment providers (currently Stripe and Xendit) with features for payment processing, subscriptions, and dispute management. The goal is to provide a unified interface for payments when you required more than one payment provider to fulfill your business needs. The system is built with simplicity in mind, focusing on ease of use and flexibility.\n\n## Architecture\n\nArchitecture diagram and documentation is here: https://github.com/malwarebo/gopay/blob/master/docs/ARCHITECTURE.md\n\n## Features\n\n- **Multi-provider Support**\n  - Stripe and Xendit integration\n  - Automatic provider failover\n  - Easy addition of new providers\n\n- **Payment Processing**\n  - Charge processing\n  - Refund handling\n  - Transaction management\n\n- **Subscription Management**\n  - Plan creation and management\n  - Subscription lifecycle handling\n  - Trial period support\n  - Automatic billing\n\n- **Dispute Handling**\n  - Dispute creation and management\n  - Evidence submission\n  - Status tracking\n  - Dispute statistics\n\n## Installation\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/malwarebo/gopay.git\ncd gopay\n```\n\n2. Install dependencies:\n```bash\ngo mod download\n```\n\n3. Set up the database:\n```bash\n# Connect to PostgreSQL\npsql -U postgres\n\n# Create database and user\nCREATE DATABASE gopay;\nCREATE USER gopay_user WITH PASSWORD 'your_password_here';\nGRANT ALL PRIVILEGES ON DATABASE gopay TO gopay_user;\n\n# Exit psql\n\\q\n\n# Run the schema migration\npsql -U gopay_user -d gopay -f db/schema.sql\n```\n\n4. Configure the application:\n```bash\n# Copy the example config\ncp config/config.example.json config/config.json\n\n# Edit config.json with your settings:\n# - Update database credentials\n# - Add your Stripe API keys\n# - Add your Xendit API keys\n# - Adjust server settings if needed\n```\n\n## Running the Application\n\n1. Start the server:\n```bash\ngo run main.go\n```\n\n2. The API will be available at `http://localhost:8080`\n\n## Docker Deployment\n\n### Prerequisites\n- Docker\n- Docker Compose\n\n### Environment Variables (optional)\nCreate a `.env` file in the project root with the following variables:\n```\nXENDIT_API_KEY=your_xendit_api_key\nSTRIPE_API_KEY=your_stripe_api_key\n```\n\n### Running the Application\n1. Build and start the services:\n```bash\ndocker-compose up --build\n```\n\n2. Stop the services:\n```bash\ndocker-compose down\n```\n\n### Development with Docker\n- To rebuild the image: `docker-compose build`\n- To run tests in Docker: `docker-compose run --rm gopay go test ./...`\n\n### Accessing the Application\nThe application will be available at `http://localhost:8080`\n\n## API Endpoints\n\n### Payments\n- `POST /charges` - Create a new charge\n- `GET /charges/:id` - Get charge details\n- `POST /refunds` - Create a refund\n\n### Subscriptions\n- `POST /plans` - Create a subscription plan\n- `GET /plans` - List all plans\n- `GET /plans/:id` - Get plan details\n- `POST /subscriptions` - Create a subscription\n- `GET /subscriptions/:id` - Get subscription details\n- `PUT /subscriptions/:id` - Update subscription\n- `DELETE /subscriptions/:id` - Cancel subscription\n\n### Disputes\n- `POST /disputes` - Create a dispute\n- `GET /disputes/:id` - Get dispute details\n- `PUT /disputes/:id` - Update dispute\n- `POST /disputes/:id/evidence` - Submit evidence\n\n## Example Usage\n\n1. Create a charge:\n```bash\ncurl -X POST http://localhost:8080/charges \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"amount\": 1000,\n    \"currency\": \"USD\",\n    \"payment_method_id\": \"pm_card_visa\",\n    \"customer_id\": \"cust_123\",\n    \"description\": \"Test charge\"\n  }'\n```\n\n2. Create a subscription:\n```bash\ncurl -X POST http://localhost:8080/subscriptions \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"customer_id\": \"cust_123\",\n    \"plan_id\": \"plan_123\",\n    \"payment_method_id\": \"pm_card_visa\"\n  }'\n```\n\n## Project Status\n\n1. **Phase 1 (Completed)**\n   - Basic payment processing\n   - Provider orchestration\n   - Configuration management\n   - Database integration with GORM\n\n2. **Phase 2 (Current)**\n   - Subscription management\n   - Dispute handling\n   - Advanced error handling\n   - Improved logging\n\n3. **Phase 3 (Future)**\n   - Webhook handling\n   - Event system\n   - Analytics integration\n   - Advanced reporting\n\n4. **Phase 4 (Future)**\n   - Additional payment providers\n   - Advanced fraud detection\n   - Performance optimization\n\n## Future Considerations\n\n1. **Integration**\n   - Additional payment providers\n   - Third-party services\n   - Notification systems (maybe)\n\n2. **Features**\n   - Advanced reporting\n   - Fraud detection\n   - Real-time analytics\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalwarebo%2Fgopay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmalwarebo%2Fgopay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalwarebo%2Fgopay/lists"}