A comprehensive service for processing, managing, and tracking refunds across diverse payment methods and workflows within the Brik platform.
The Refunds Service is a critical component of the Brik payment ecosystem, supporting flexible and reliable refund processing for merchants across different payment methods, approval workflows, and compliance requirements.
- End-to-end refund lifecycle management
- Support for multiple refund methods (original payment, balance, other)
- Configurable approval workflows
- Card network rule enforcement
- Multi-level parameter configuration
- Comprehensive reporting and analytics
- Secure bank account management
- Multi-channel notifications
The Refunds Service follows a microservices architecture with modular components:
- Refund API Service: Exposes RESTful endpoints for client applications
- Refund Request Manager: Orchestrates the refund lifecycle
- Payment Method Handler: Provides method-specific refund processing logic
- Approval Workflow Engine: Manages configurable approval flows
- Compliance Engine: Enforces card network rules and merchant policies
- Gateway Integration Service: Manages communication with payment gateways
- Parameter Resolution Service: Resolves hierarchical configuration parameters
- Bank Account Manager: Securely stores and verifies bank account information
- Notification Service: Delivers multi-channel notifications
- Reporting & Analytics Engine: Provides insights and metrics on refund activity
- Language: Python 3.11+
- Database: MongoDB 6.0+
- Caching: Redis 7.0+
- Message Queue: AWS SQS
- Authentication: JWT with OAuth 2.0/Auth0
- Framework: React 18.2+ with TypeScript 5.0+
- State Management: Redux 4.2+
- UI Framework: TailwindCSS 3.3+
- API Integration: React Query 4.0+
- Cloud Provider: AWS
- Containerization: Docker 24.0+
- Orchestration: AWS ECS Fargate
- IaC: Terraform 1.5+
- CI/CD: GitHub Actions
./
├── src/
│ ├── backend/ # Backend service implementation
│ └── web/ # Frontend web application
├── infrastructure/ # Infrastructure configuration
├── .github/ # GitHub workflows and templates
└── docs/ # Project documentation
- Node.js 16+
- Python 3.11+
- Docker and Docker Compose
- AWS CLI
- Terraform 1.5+
- Clone the repository:
git clone https://github.com/your-org/refunds-service.git
cd refunds-service
- Set up the backend:
cd src/backend
cp .env.example .env
# Update .env with your local configuration
pip install -r requirements.txt
python -m pytest # Run tests to verify setup
python -m src.backend.bin.www # Start the backend server
- Set up the frontend:
cd src/web
cp .env.example .env
# Update .env with your local configuration
npm install
npm start # Start the development server
- Access the applications:
- Backend API: http://localhost:3000
- Frontend: http://localhost:8000
- API Documentation: http://localhost:3000/api-docs
The project includes comprehensive test suites for both backend and frontend:
cd src/backend
python -m pytest # Run all tests
python -m pytest tests/unit # Run unit tests only
python -m pytest tests/integration # Run integration tests only
cd src/web
npm test # Run all tests
npm run test:coverage # Run tests with coverage report
The project uses GitHub Actions workflows for CI/CD:
.github/workflows/build-and-test.yml
- Runs on all PRs to verify code quality.github/workflows/deploy-dev.yml
- Deploys to development environment on main branch merges.github/workflows/deploy-staging.yml
- Deploys to staging after development tests pass.github/workflows/deploy-prod.yml
- Deploys to production after manual approval
For manual deployment, see the infrastructure documentation.
- Create a feature branch from
main
- Implement changes with appropriate tests
- Ensure all tests pass and code quality checks succeed
- Submit a pull request with a detailed description of changes
- Obtain code review approval
Copyright (c) 2023 Brik. All rights reserved.