Download the PHP package wmsn-web/bkash-php-client without Composer

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

PHP bKash Payment Gateway

Packagist Version

A simple, lightweight PHP library for integrating the bKash REST payment gateway in your PHP projects.


Features

Requirements

Installation

Install via Composer:

Then in your PHP code, initialize the client:

OR

Usage Examples

1. Grant Token

Grant Token API provides an access token as a response. This token can be used to access other bKash APIs as authorization parameter. Once the token gets expired, new token can be generated through Refresh Token API.

Sample Response

Save the id_token into the database for reuse without generate a new token. Once it get expire (3600 seconds) Refresh a new token using refresh_token.

2. Refresh Token

This API provides a new access token against the existing token. This new token can be used in subsequent bKash API calls.

3. Create a Payment

Through this API, a tokenized payment creation request is received by bKash. Upon validation of customer's wallet information, the create payment request will be confirmed by the Execute Payment request.

Get $token from your database.

Sample response

4. Execute the Payment

Using this API, a tokenized payment request created using the Create Payment API can be finalized. Thus, a payment can be successful or can be failure. The final result of the payment request can be found through this API.

Basically in callback URL Execute payment API should be call to confirm the payment.

Get $token from your database.

Sample Response

5. Query Transaction Status

Configuration Options

Option Type Default Description
app_key string null Your bKash API App Key
app_secret string null Your bKash API App Secret
username string null API username
password string null API password
base_url string Sandbox URL Base URL for bKash endpoints
mode string sandbox sandbox or production
timeout int 30 HTTP request timeout in seconds

Running Tests

This library uses PHPUnit. To run tests:

Tip: Copy phpunit.xml.dist to phpunit.xml and update with your sandbox credentials.

Examples Directory

See the examples/ directory for full scripts:

Please follow PSR-12 coding standards and ensure all tests pass.

Troubleshooting

📚 Official Documentation Reference

This library is built on top of the official Bkash API documentation.
Please refer to it for detailed API behavior, limitations, and authentication guidelines.

Credit goes to the Bkash Developer Team for providing well-structured documentation.

License

This library is released under the MIT License.


All versions of bkash-php-client with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ^7.0
psr/http-message Version ^1.0 || ^2.0
psr/http-client Version ^1.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 wmsn-web/bkash-php-client contains the following files

Loading the files please wait ...