Download the PHP package theihasan/laravel-bkash without Composer

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

Free Palestine

Laravel bKash

A simple Laravel package for integrating the bKash Tokenized Payment Gateway into your application. With built-in payment flow and full control via manual methods, this package supports payment creation, execution, status queries, refunds, and token management.


Table of Contents

  1. Overview
  2. Requirements
  3. Installation
  4. Configuration
  5. Usage
    • Initiating a Payment
    • Handling the Callback
    • Querying Payment Status
    • Processing a Refund
    • Managing Tokens
  6. Built-in Payment Flow
  7. Error Handling
  8. Customization
  9. Test Credentials
  10. Testing
  11. Contributing
  12. Credits and License

Overview

The Laravel bKash package simplifies integrating bKash’s tokenized payment gateway into your Laravel projects. It provides:


Requirements


Installation

Install the package via Composer:

Publish the migrations

Migrate the database

Then, run the setup command to test the connection and publish assets:

Alternatively, publish individual assets as needed:


Configuration

After publishing, update the config/bkash.php file with your bKash credentials and settings:

Also, add the necessary variables to your .env file:


Usage

You can use the package with its built-in payment flow or build a custom process.

Initiating a Payment

Use the provided createPayment method to start a payment:

Multi-tenant Support

Starting from version 1.3.0, the package supports multi-tenant applications. This is useful when you have multiple tenants (organizations, businesses, etc.) using the same application but with different bKash credentials.

Handling the Callback

After payment, bKash will redirect to your callback URL:

Check a payment’s status using:

Multi-tenant Support

Processing a Refund

Initiate a refund (partial or full) with:

Multi-tenant Support

Managing Tokens

For manual token operations:


Multi-tenant Support

Token Management

Tokens are tenant-specific, so you can manage them for each tenant:

Built-in Payment Flow

By default, the package registers these routes:

To define your own routes, simply disable the built-in ones in config/bkash.php by setting:


Error Handling

The package provides clear exception classes to help you handle errors:

Handle exceptions as shown in the usage examples above.


Customization

Customize the built-in views and controllers to match your needs:


Database Configuration

Starting from version 1.1.0, you can customize the database table prefix used by the package. This is useful when you want to avoid table name conflicts or organize your database schema.

Setting a Custom Table Prefix

By default, all tables created by this package use the bkash_ prefix. You can change this by updating your .env file:

Or by directly modifying the config/bkash.php file:

For Existing Installations

If you're updating from a previous version and want to use a custom table prefix:

  1. Publish the new migration file:

  2. Set your desired prefix in the .env file or config file.

  3. Run the migration to create new tables with your prefix and migrate existing data:

Note: The migration will automatically copy your existing data to the new tables with your custom prefix. Your original tables will remain untouched, so you can verify the data before removing the old tables if needed.

Important Considerations


Events

Starting from version 1.1.0, the package can fire Laravel events when certain actions occur. You can listen for these events to perform additional actions in your application.

Available Events

Payment Successful Event

This event is fired when a payment is successfully executed:

The event contains:

Configuring Events

By default, all events are enabled. You can disable specific events in your .env file:

Or in your config/bkash.php file:

Listening for Events

You can listen for these events in your EventServiceProvider:

Or if you are using Laravel 11 or higher Laravel will automatically register the listener. Just run this command for listener

Example listener:

Test Credentials

For sandbox testing, you may use these credentials (or update your .env accordingly):


Testing

Run package tests with:

Ensure your testing environment is set up as required by your Laravel configuration.


Contributing

Contributions are welcome. When submitting a pull request:


Credits and License

Credits:

License:
Licensed under the MIT License.



All versions of laravel-bkash with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1|^8.2
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0||^11.0||^12.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 theihasan/laravel-bkash contains the following files

Loading the files please wait ....