Download the PHP package dahromy/mvola-bundle without Composer
On this page you can find all versions of the php package dahromy/mvola-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dahromy/mvola-bundle
More information about dahromy/mvola-bundle
Files in dahromy/mvola-bundle
Package mvola-bundle
Short Description Symfony bundle for MVola Merchant Pay API
License MIT
Informations about the package mvola-bundle
MVola Bundle for Symfony
The MVola Bundle is a Symfony bundle that provides integration with the MVola payment gateway. It offers a convenient way to interact with the MVola API, handle transactions, and manage callbacks.
Features
- Easy integration with Symfony projects
- Handles MVola API authentication
- Provides services for initiating transactions, checking transaction status, and retrieving transaction details
- Includes a callback handler for processing MVola notifications
- Configurable retry mechanism for API calls
- Caching support for authentication tokens
Installation
You can install the MVola Bundle using Composer:
Configuration
After installing the bundle, you need to configure it in your Symfony application. Add the following to your config/packages/mvola.yaml file:
Make sure to set the corresponding environment variables in your .env file:
Usage
Initiating a Transaction
To initiate a transaction, you can use the MVolaService:
Checking Transaction Status
To check the status of a transaction:
Retrieving Transaction Details
To get the details of a transaction:
Handling Callbacks
The MVola Bundle provides a built-in callback handler that processes incoming callbacks from MVola. To handle these callbacks in your application, follow these steps:
-
Create an event subscriber:
-
Register your event subscriber in your
services.yaml: - Configure the callback URL:
When initiating a transaction, you can include custom callback data:
The MVola Bundle will automatically handle incoming callbacks at the /mvola/callback endpoint. When a callback is received, it will:
- Log the received callback data
- Dispatch a
MVolaCallbackEvent
Your event subscriber will then be called to process the callback data according to your application's needs.
You can also customize the callback URL by setting the callbackUrl property in the TransactionRequest object:
Note: Ensure that your server is configured to accept PUT requests at the callback URL, as MVola sends callbacks using the PUT method.
Error Handling
The bundle throws specific exceptions for different error scenarios. Make sure to catch and handle these exceptions in your application:
MVolaApiException: For general API errorsMVolaAuthenticationException: For authentication-related errorsMVolaValidationException: For validation errors in the request dataMVolaNetworkException: For network-related errorsMVolaRateLimitException: For rate limit errors
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This bundle is open-sourced software licensed under the MIT license.
All versions of mvola-bundle with dependencies
symfony/framework-bundle Version ^5.0|^6.0|^7.0
guzzlehttp/guzzle Version ^7.0
symfony/cache Version ^5.0|^6.0|^7.0
symfony/monolog-bundle Version ^3.10
ext-json Version *