Welcome to the Payfil API Project, a robust solution designed to streamline payment processing for e-commerce platforms. Developed using the powerful Laravel framework, this API enables seamless payment transactions through multiple banks, providing a secure and efficient way to handle online sales.
To get started with the Payfil API Project, follow these steps to set up your development environment.
Ensure you have the following installed on your system:
- Docker: Used to create a consistent development environment.
- Docker Compose: To manage multi-container Docker applications.
-
Clone the Repository: Begin by cloning the repository to your local machine:
git clone https://github.com/bilalbaraz/payfil-api.git cd payfil-api
-
Install Dependencies: Install the necessary PHP dependencies using Composer:
composer install
-
Set Up Environment Variables: Copy the example environment file and update it with your local settings:
cp .env.example .env
-
Generate Application Key: Generate the Laravel application key, which is used for encryption:
php artisan key:generate
-
Start Docker Containers: Use Laravel Sail to start the Docker containers:
./vendor/bin/sail up -d
-
Run Database Migrations with Seeders: Set up your database by running the migrations:
./vendor/bin/sail artisan migrate --seed
This will create the necessary tables and seed the database with demo data.
-
Access the Application: Once everything is set up, you can access the application in your browser at:
http://localhost
Your Payfil API development environment should now be up and running. You can begin developing and testing the API according to your project's requirements.
Stop Docker Containers: Use Laravel Sail to stop the Docker containers:
./vendor/bin/sail down
Endpoint | Description |
---|---|
/orders |
Retrieves orders by authenticated user |
/orders/checkout |
Checkout order |
/tokens/create |
Creates token by authenticated user |
You can check out the full list of endpoints by visiting the endpoints page.
We welcome contributions from the community! Whether you're fixing a bug, adding a new feature, or improving documentation, your help is greatly appreciated. Please follow the guidelines below to ensure a smooth contribution process.
-
Fork the Repository: Start by forking the repository to your own GitHub account.
-
Create a Branch: Create a new branch for your feature or bug fix.
git checkout -b feature/your-feature-name
-
Make Your Changes: Make your code changes in your branch. Please ensure your code adheres to the project's coding standards and passes all tests.
-
Run Tests: Run the existing tests to ensure that your changes do not break anything.
./vendor/bin/phpunit
-
Commit Your Changes: Write clear, concise commit messages explaining your changes.
git commit -m "Add a descriptive commit message"
-
Push to GitHub: Push your changes to your forked repository.
git push origin feature/your-feature-name
-
Open a Pull Request: Open a pull request on the main repository. Provide a detailed description of your changes and any relevant issue numbers.
Thank you for contributing!
This project adheres to the PSR-12 coding standard. Laravel Pint was used for PSR-12 checks during development.
Current Status:
You can run the following command to generate and view the code coverage report in your local development environment:
./vendor/bin/sail test --coverage-html reports
This will allow you to view the report in the reports directory.
This project was made possible through the collaborative efforts of several individuals and organizations. We would like to extend our sincere gratitude to everyone who contributed to the development and success of this project.
- Bilal Baraz - Computer Engineer.
A special thank you to the open-source community and the developers behind the frameworks, libraries, and tools that made this project possible, including:
- Laravel - for providing an elegant and robust PHP framework.
- PHP - for being the backbone of our server-side development.
- MySQL - for a reliable and powerful database solution.
- Docker - for simplifying our development and deployment processes.
- GitHub - for offering an excellent platform for version control and collaboration.
If you encounter any issues while setting up or running the Payfil API Project, this section will help you diagnose and resolve common problems.
Issue: Docker containers fail to start or keep restarting.
Solution:
-
Ensure Docker is properly installed and running on your machine.
-
Check if the ports required by the containers (e.g., MySQL on port 3306) are already in use by another application. You may need to stop the other application or configure Docker to use different ports.
-
Review the Docker logs for more detailed error messages:
docker logs <container_name>
This roadmap outlines the key milestones and upcoming features planned for the Payfil API Project. Our goal is to continuously improve and expand the functionality of the API, ensuring it meets the evolving needs of our users.
-
Email Notifications
- Implement email notifications for order confirmations, payment receipts, and status updates.
- Provide customizable email templates for different types of notifications.
- Ensure email deliverability and compliance with anti-spam regulations.
-
Caching
- Implement a caching layer to improve API performance and reduce load times.
- Cache frequently accessed data such as product listings, order histories, and user sessions.
- Provide cache invalidation strategies to ensure data consistency.
-
Code Coverage
- Achieve 100% code coverage for all unit and integration tests.
- Regularly monitor and maintain code coverage to ensure all new features are fully tested.
If you need assistance with the Payfil API Project, we're here to help! Below are the various ways you can get support.
If you've found a bug or would like to request a new feature, please submit an issue on our GitHub Issues page. When reporting issues, please include as much detail as possible to help us resolve the problem quickly.
Thank you for using Payfil! We're committed to ensuring you have a smooth experience with our API.