Download the PHP package alsharie/jawali-payment without Composer

On this page you can find all versions of the php package alsharie/jawali-payment. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package jawali-payment

Laravel Jawali API Client

Logo

Jawali Payment is a Laravel package for interacting with the Jawali payment gateway. It provides a simple API to perform operations like ecommerce inquiry and cash out, with automatic token management and structured responses.


Installation

  1. Require the package using Composer:

    (Replace alsharie/jawali-payment with your actual package name on Packagist if you publish it, or use a local path repository for development).

  2. Publish the configuration file (optional, but recommended):

    This will create a config/jawali.php file.

  3. Add the following environment variables to your .env file and configure them:

Configuration

The package uses Laravel's configuration system. After publishing the config file, you can find it at config/jawali.php. The configuration is structured as follows:

The disable_ssl_verification option is particularly useful when working with development environments or self-signed certificates.


Logging Configuration

The package includes built-in logging capabilities for debugging API requests and responses. To enable logging:

  1. Enable logging in your .env file:

  2. Ensure the logs directory is writable:

The package will log all API interactions using Laravel's default logging system. Log entries include:

Note: Logging errors are silently ignored to prevent them from breaking the main application functionality.


Features

This package provides the following features:

  1. Structured Response Classes: Each API response is wrapped in a dedicated response class that provides methods to access the data in a type-safe way.
  2. Automatic Token Management: The package automatically manages authentication and wallet tokens, refreshing them when needed.
  3. Retry Mechanism: Failed requests due to token expiration or certain HTTP status codes are automatically retried.
  4. SSL Verification Control: Option to disable SSL verification for development or when working with self-signed certificates.
  5. Simplified API: The API is simplified to focus on the essential parameters, with tokens managed automatically.
  6. Enhanced Error Handling: Comprehensive error information with API response preservation and user-friendly error messages.
  7. Optional Logging: Built-in request/response logging for debugging purposes.
  8. Input Validation: Automatic validation of request parameters to prevent common errors.

Usage

You can use the Jawali facade or inject the Alsharie\Jawali\Services\JawaliService class.


Enhanced Error Handling

The package now provides comprehensive error handling with detailed API response information and standardized method names that match successful responses:

Standardized Method Names

Both successful responses and exceptions now use the same method names for consistency:

Purpose Method Name Available On Description
Get raw data getData() ✅ Success & Exception Returns the complete response data array
Get response body getResponseBody($attribute?) ✅ Success & Exception Gets response body or specific attribute
Get response value getResponse($attribute?) ✅ Success & Exception Gets response data or specific attribute
Get error message getErrorMessage() ✅ Success & Exception Gets API error message if available
Check success isSuccess() ✅ Success only Not applicable for exceptions

Example - Same methods work for both success and error:

Breaking Change: Old method names (getApiResponse(), getApiResponseBody(), getApiResponseHeaders()) have been removed. Use the standardized method names instead.

Debugging and Logging

Enable logging to debug API requests and responses:

The package automatically logs:

Explanation


License

This package is open-sourced software licensed under the MIT license.


All versions of jawali-payment with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
illuminate/support Version ^8.0|^9.0|^10.0|^11.0
illuminate/http Version ^8.0|^9.0|^10.0|^11.0
nesbot/carbon Version ^2.0|^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package alsharie/jawali-payment contains the following files

Loading the files please wait ....