Download the PHP package keenops/laravel-tcb-cms without Composer

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

Laravel TCB CMS

A Laravel package for integrating with Tanzania Commercial Bank's Cash Management System (CMS) API. This package enables payment reference creation, IPN (Instant Payment Notification) handling, reconciliation, and reference cancellation.

Requirements

Installation

Install the package via Composer:

The package will auto-register its service provider and facade.

Publish Configuration

Run Migrations

This creates the tcb_cms_transactions table for transaction logging.

Configuration

Add the following environment variables to your .env file:

Configuration Options

Option Description Default
api_key Your TCB CMS API key -
partner_code Your partner code assigned by TCB -
profile_id Your profile ID -
base_url TCB CMS API base URL https://partners.tcbbank.co.tz
reconciliation_base_url Reconciliation API base URL https://partners.tcbbank.co.tz:8444
ipn.route IPN callback route /tcb-cms/ipn
ipn.middleware Middleware for IPN route ['api']
verify_ip Enable IP verification for IPN false
allowed_ips Comma-separated allowed IPs -
timeout HTTP request timeout (seconds) 30
retry_times Number of retry attempts 3
logging.enabled Enable transaction logging true

Usage

Using the Facade

Create a Payment Reference

Create a payment reference for a customer to make payments:

With optional amount and expiry date:

Cancel a Payment Reference

Reconciliation

Fetch all transactions within a date range:

Handling Payment Notifications (IPN)

The package automatically registers an IPN route at /tcb-cms/ipn (configurable). When TCB Bank sends a payment notification, the package dispatches a PaymentReceived event.

Create an Event Listener

Register the Listener

Or using Laravel 11+ event discovery, the listener will be auto-registered.

Available Events

Event Description Payload
PaymentReceived Dispatched when IPN callback is received IpnPayload $payload
ReferenceCreated Dispatched on successful reference creation CreateReferenceRequest $request, CreateReferenceResponse $response
ReferenceCancelled Dispatched on successful reference cancellation CancelReferenceRequest $request, CancelReferenceResponse $response
ReconciliationCompleted Dispatched after successful reconciliation ReconciliationRequest $request, ReconciliationResponse $response

Payment Channel Helper

Get payment instructions for different channels:

Available channels:

Transaction Logging

All API requests and IPN callbacks are logged to the tcb_cms_transactions table when logging is enabled.

Query Transaction Logs

Disable Logging

Set TCB_CMS_LOGGING_ENABLED=false in your .env file or update the config:

IP Verification for IPN

For additional security, enable IP verification to only accept IPN callbacks from TCB Bank's servers:

Error Handling

The package throws specific exceptions for different error scenarios:

Response Status Codes

Testing

Run the package tests:

Or using Pest directly:

Mocking in Your Application Tests

Changelog

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

License

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

Credits

Support

For issues and feature requests, please use the GitHub issue tracker.


All versions of laravel-tcb-cms with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/contracts Version ^11.0|^12.0|^13.0
illuminate/http Version ^11.0|^12.0|^13.0
illuminate/support Version ^11.0|^12.0|^13.0
illuminate/routing Version ^11.0|^12.0|^13.0
illuminate/database Version ^11.0|^12.0|^13.0
illuminate/events Version ^11.0|^12.0|^13.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 keenops/laravel-tcb-cms contains the following files

Loading the files please wait ...