Download the PHP package decodeblock/laravel-ercaspay without Composer
On this page you can find all versions of the php package decodeblock/laravel-ercaspay. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download decodeblock/laravel-ercaspay
More information about decodeblock/laravel-ercaspay
Files in decodeblock/laravel-ercaspay
Package laravel-ercaspay
Short Description A Laravel Package for working with Ercaspay API seamlessly
License MIT
Homepage https://github.com/decodeblock/laravel-ercaspay
Informations about the package laravel-ercaspay
Laravel Ercaspay
A Laravel package for seamless integration with the Ercaspay payment gateway API.
Features
- Easy integration with Ercaspay payment gateway API
- Support for multiple payment methods
- Payment verification
- Comprehensive error handling
Requirements
- PHP 8.3 or higher
- Laravel 9.0 or higher
- You need to reference the Ercaspay API documentation. Click here for the documentation
Installation
Install the package via composer:
Configuration
-
Publish the config file:
- Add your Ercaspay credentials to your .env file:
Usage Example
Here are some examples of how to use this package:
Generate Payment Reference UUID
Initiate a Transaction
Verify a Transaction
Initiate a Bank Transfer
Initiate a Card Transaction
Available Methods
Below are all the methods available in the package:
To provide clear and helpful information about the exceptions in your README, you can include a dedicated section about error handling and exception types. This section should describe the different exceptions that developers may encounter while using your package, their causes, and how to handle them.
Here's a sample section you can include in your README.md
:
Error Handling and Exceptions
Your package may throw different types of exceptions based on the outcomes of HTTP requests made to the Ercaspay API. Below is a list of the key exceptions you should be aware of when integrating and working with this package:
1. ErcaspayRequestException
Thrown when:
- There is an issue with the request, such as a failure in communication or missing parameters.
- The error message is user-defined and includes detailed context from the API.
Usage Example:
What You Can Expect:
getMessage()
– Returns a description of the error (e.g., "Request failed").getCode()
– Provides the error code (could be an HTTP status code or0
for network-related errors).getResponse()
– Returns additional data provided by the API or error context.
2. ErcaspayClientErrorException
Thrown when:
- The API responds with a client-side error (HTTP status code 4xx).
- This exception is thrown when a request is malformed or contains invalid parameters.
Usage Example:
What You Can Expect:
- Contains the same methods as
ErcaspayRequestException
. - Additional information about client-side issues, such as invalid parameters or incorrect input.
3. ErcaspayServerErrorException
Thrown when:
- The API responds with a server-side error (HTTP status code 5xx).
- This exception is used when something goes wrong on the server, such as a server crash or unavailable service.
Usage Example:
What You Can Expect:
- Same structure as the other exceptions but specifically for server-related issues.
- Contains error data related to server failures.
Logging
This package provides logging capabilities to help you monitor and troubleshoot API interactions and errors. By default, important information about API requests, responses, and exceptions is logged, which can be useful for debugging and keeping track of system behavior.
What is Logged?
The package logs the following information:
1. API Request Details:
- URL of the API endpoint
- HTTP method (GET, POST, etc.)
2. API Response Details:
- HTTP status code of the response
- Response body (if available)
- Error messages (for failed requests)
3. Exceptions:
- Details of exceptions, including client and server errors
- Stack trace and error context for easier debugging
Changelog
Detailed changes for each release are documented in the CHANGELOG.
Contributing
We welcome contributions! Please see the CONTRIBUTING guide for details.
Credits
- Gabriel Ibenye
- All Contributors
License
This package is licensed under the MIT License.
All versions of laravel-ercaspay with dependencies
guzzlehttp/guzzle Version ^7.9
illuminate/contracts Version ^10.0||^11.0
spatie/laravel-package-tools Version ^1.16