Download the PHP package shubhamc4/cgrate-laravel without Composer

On this page you can find all versions of the php package shubhamc4/cgrate-laravel. 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 cgrate-laravel

CGrate Laravel Package

Latest Version on Packagist Total Downloads License

A Laravel package for integrating with the CGrate payment service to process mobile money transactions in Zambia. This package provides a seamless Laravel wrapper around the cgrate-php core package.

Table of Contents

Introduction

CGrate (543 Konse Konse) is a payment service provider based in Zambia that facilitates mobile money transactions. This Laravel package allows businesses to:

The service operates via a SOAP API that requires WS-Security authentication. CGrate is widely used for integrating with local payment systems in Zambia, making it easier for businesses to accept mobile payments from customers.

For more information about CGrate payment service, visit their official website or contact their support team at [email protected].

Official Documentation

For detailed information on the CGrate SOAP API, including setup instructions, request formats, and response codes, please refer to the official EVDSpec 2024.pdf document. This comprehensive guide provides all the technical specifications required for integrating with the CGrate service.

Requirements

Installation

You can install the package via composer:

The package will automatically register its service provider and facade through Laravel's package auto-discovery feature.

Configuration

Publish the configuration file:

This will create a config/cgrate.php configuration file in your application where you can modify the settings.

Environment Variables

The package requires the following environment variables to be set in your .env file:

Available Soap Methods

Method Description
getAccountBalance() Get the account balance
getAvailableCashDepositIssuers() Get Available Cash Deposit Issuers
processCustomerPayment(PaymentRequestDTO $payment) Process a new customer payment
queryCustomerPayment(string $transactionReference) Check the status of a customer payment
processCashDeposit(string $paymentReference) Process Cash Deposit

Available Static Helper Methods

Method Description
generateTransactionReference(string $prefix = 'CG') Generate a unique transaction reference
getCustomerIssuerName(string $customerAccount) Get Customer Account Issuer Name

Usage

Getting Account Balance

Get Available Cash Deposit Issuers

Processing a Payment

Query Customer Payment

Process Cash Deposit

Events

The package includes following events that you can dispatch and listen for in your application:

Event Description Properties
PaymentProcessed Dispatch this when a payment is successful response (PaymentResponseDTO), paymentData (array)
PaymentFailed Dispatch this when a payment fails request (PaymentRequestDTO), errorMessage (string), responseCode (ResponseCode or null), exception (CGrateException or null)
CashDeposit Dispatch this when a cash deposit is successful response (CashDepositResponse), cashDepositData (array)

Data Transfer Objects

The package uses DTOs to handle API requests and responses:

Request DTOs

Response DTOs

Artisan Commands

The package provides the following Artisan commands:

This command will check your account balance and display it in the console.

Core PHP Package

This Laravel package is a wrapper around the cgrate-php core package. The core package handles all the low-level SOAP API interactions, request validation, and response parsing.

If you need to use CGrate with a non-Laravel PHP application, you can use the core package directly. See the cgrate-php repository for documentation on direct usage.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of cgrate-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-soap Version *
shubhamc4/cgrate-php Version ^2.0.3
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 shubhamc4/cgrate-laravel contains the following files

Loading the files please wait ...