This adapter integrates Midtrans payment gateway into your FOSSBilling installation. It allows your customers to pay using a wide variety of payment methods supported by Midtrans, including credit/debit cards, bank transfers, e-wallets, and more, while seamlessly integrating with FOSSBilling.
Note This extension is currently in beta. While it has been tested extensively, use in production environments should be done with caution and thorough testing.
- Overview
- Table of Contents
- Features
- Installation
- Configuration
- Usage
- Troubleshooting
- Contributing
- License
- Support
-
Multiple Payment Methods: Supports various Midtrans payment options including credit/debit cards, bank transfers, e-wallets, and more.
-
Flexible Integration Options:
- Snap Popup: Displays Midtrans payment interface in a popup window.
- Embedded Snap: Integrates Midtrans payment interface directly into FOSSBilling checkout page.
-
Automatic Invoice Management:
- Updates invoice status to 'paid' automatically upon successful payment.
- Handles various payment statuses (capture, settlement, pending, deny, cancel, expire).
-
Detailed Transaction Logging: Comprehensive logging for easy tracking and debugging.
-
Secure Payment Processing:
- Supports 3D Secure transactions for card payments.
- Implements signature key verification for Midtrans notifications.
-
Sandbox Mode: Allows testing in a sandbox environment before going live.
-
Configurable Snap Token Storage:
- Ability to set custom expiration time for stored Snap tokens.
- Automatic cleanup of expired tokens to maintain system efficiency.
Not yet implemented
- Download the latest release from the GitHub repository.
- Create a new folder named Midtrans in the /library/Payment/Adapter directory of your FOSSBilling installation.
- Extract the downloaded files into this new directory.
- In your FOSSBilling admin panel, navigate to "Payment gateways" under the "System" menu.
- Find Midtrans in the "New payment gateway" tab and click the cog icon to install and configure.
- In your FOSSBilling admin panel, locate "Midtrans" under "Payment gateways".
- Enter the following Midtrans credentials:
- Merchant ID
- Client Key
- Server Key
- Configure additional settings:
- Sandbox mode (for testing)
- Payment mode (popup or embedded)
- Default country code
- Set the Snap Token Expiration time (in seconds) to control how long Snap tokens are stored.
- Save your configuration.
To set up webhooks for real-time payment notifications:
- Log in to your Midtrans dashboard.
- Navigate to Settings > Configuration.
- Set the Payment Notification URL to:
https://your-fossbilling-domain.com/ipn.php?gateway_id=payment_gateway_id
(Replaceyour-fossbilling-domain.com
with your actual domain andpayment_gateway_id
with the ID assigned by FOSSBilling)
The Snap Token Storage feature allows you to control how long Snap tokens are stored in the system:
- Navigate to the Midtrans configuration in your FOSSBilling admin panel.
- Find the "Snap Token Expiration" field.
- Enter the desired expiration time in seconds. For example:
- 3600 for 1 hour
- 86400 for 24 hours (default)
- 604800 for 1 week
- The system will automatically delete expired tokens based on this setting.
This feature helps in optimizing system resources while maintaining flexibility for different use cases.
Once installed and configured:
- Midtrans will appear as a payment option during the checkout process.
- Customers can select Midtrans and choose their preferred payment method.
- Depending on your configuration, they will either be redirected to a Midtrans popup or see an embedded payment form.
- After payment, customers are redirected back to your site, and the invoice status is updated automatically.
- Check Logs: Review logs at
library/Payment/Adapter/Midtrans/logs/midtrans.log
for transaction details and errors. - API Credentials: Ensure your Midtrans API keys are correctly entered in the FOSSBilling configuration.
- TLS Support: Verify that your server supports TLS v1.2 for Midtrans notifications.
- Webhook Issues: If payment status updates are not working, check your webhook configuration in both Midtrans and FOSSBilling.
- Payment Method Availability: Some payment methods may not be available in certain regions or for certain transaction amounts. Refer to Midtrans documentation for details.
- Token Expiration Issues: If you're experiencing issues related to Snap tokens, check the "Snap Token Expiration" setting in your Midtrans configuration. Adjust as needed based on your usage patterns.
We welcome contributions to improve this integration. To contribute:
- Fork the repository.
- Create a new branch for your feature or bugfix:
git checkout -b feature-name
. - Make your changes and commit them with a clear message.
- Push your branch and create a pull request.
Please ensure your code adheres to the existing style and include appropriate tests if applicable.
This FOSSBilling Midtrans Payment Gateway Integration is open-source software licensed under the Apache License 2.0.
- For issues related to this adapter, please open an issue in the GitHub repository.
- For Midtrans-specific issues, please contact Midtrans support.
- For FOSSBilling related questions, refer to the FOSSBilling documentation.
Note: This module is not officially affiliated with FOSSBilling or Midtrans. Please refer to their respective documentation for detailed information on their services and APIs.