Download the PHP package divergent/bkash without Composer

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

Laravel Package for bKash Payment Gateway

Installation & Configuration

Go to project directory and open terminal. Then run this command

For Laravel version below 5.5 open config/app file and add this line in providers array

If you are using Laravel version greater than 5.5 then skip this section

After that run this command in command line/Terminal

After successfully publishing, update your .env file. Here is an Example ENV file.

You will also see bkash.php located in config folder. Below contents will found in bkash.php file after successfully published.

Finally, just run this command

This command will generate some necessary database tables which allow merchant to use this package more efficiently.

NOTE: You can add/remove any fields (if you need) of these tables.

Usage

Checkout

Tokenized

Recurring

Webhook

Checkout Payment

For calling Checkout Payment methods, first you need to create instance of CheckoutApi class.

Don't forget to import use Divergent\Bkash\Apis\Checkout\CheckoutApi; top of the file.

NOTE: Configurations will be fetch from your previously setup in .env file. Remember that you need to set token for authorization.

Create Payment (Sale or Capture)

$merchantAssociationInfo is optional field. Default $currency is BDT.

Execute Payment

You will get $paymentID from Create Payment

Query Payment

You will get $paymentID from Execute Payment

Capture Payment

You will get $paymentID from Execute Payment

NOTE: Capture Payment will be used for payment with authorization intent.

Void Payment

You will get $paymentID from Execute Payment

NOTE: Void Payment will be used for payment with authorization intent.

Checkout Payout

Checkout B2C Payout

Checkout B2B Payout

First you have to call initiatPayout method which return you a payoutID. Then you can call b2bPayout to make B2B Payout.

Checkout B2B Query Payout

You will get $payoutID from Checkout B2B Payout.

Checkout Supporting Operations

Search Transaction

You will get $trxID from Execute Payment

Query Organization Balance

Intra-Account Transfer

Checkout Refund

Refund Transaction

$sku and $reason are optional fields. You will get $paymentID and $trxID from Execute Payment.

Refund Status

You will get $paymentID and $trxID from Execute Payment.

Tokenized Agreement

For calling Tokenized Agreement methods, first you need to create instance of TokenizedApi class.

Don't forget to import use Divergent\Bkash\Apis\Tokenized\TokenizedApi; top of the file.

NOTE: Configurations will be fetch from your previously setup in .env file. Remember that you need to set token for authorization.

Create Agreement

To create agreement, first BkashConstant::CREATE_AGREEMENT parameter need to pass which allow callback url to know which page to redirect. The possible constant list with defination is given below for better understanding -

Bkash Constant Defination

NOTE: Merchant side must need to main database table to get to know if user is already created agreement or not.

Execute Agreement

You will get $paymentID from Create Agreement.

Agreement Status

You will get $agreementID from Create Agreement.

Agreement Cancel

You will get $agreementID from Create Agreement.

Tokenized Payment

Tokenized Create Payment (Sale or Capture)

To create payment, first BkashConstant::PAYMENT parameter need to pass which allow callback url to know which page to redirect. This constant also define which action you are going to call. You can find more about it Create Agreement. $merchantAssociationInfo is optional field. Default $currency is BDT.

Tokenized Execute Payment

You will get $paymentID from Create Payment.

Tokenized Query Payment

You will get $paymentID from Execute Payment.

Tokenized Capture Payment

You will get $paymentID from Execute Payment

NOTE: Tokenized Capture Payment will be used for payment with authorization intent.

Tokenized Void Payment

You will get $paymentID from Execute Payment

NOTE: Tokenized Void Payment will be used for payment with authorization intent.

Tokenized Payout

Tokenized Intra-Account Transfer

Tokenized B2C Payout

Tokenized B2B Payout

First you have to call initiatPayout method which return you a payoutID. Then you can call b2bPayout to make B2B Payout.

Tokenized B2B Query Payout

You will get $payoutID from Tokenized B2B Payout.

Tokenized Refund

Refund Transaction

$sku and $reason are optional fields. You will get $paymentID and $trxID from Execute Payment.

Refund Status

You will get $paymentID and $trxID from Execute Payment.

Recurring Subscription

For calling Recurring Subscription methods, first you need to create instance of Subscription class.

Don't forget to import use Divergent\Bkash\Apis\Recurring\Subscription; top of the file.

NOTE: Configurations will be fetch from your previously setup in .env file.

Create Subscription

Available recurring cycles are given below -

Subscription Query by Request ID

You will get $requestId from Create Subscription.

Subscription Query by Subscription ID

You will get $subscriptionID from Subscription Query by Request ID.

Cancel Subscription

You will get $subscriptionID from Subscription Query by Request ID. $reason is Optional value that contains string value.

Subscription List

$page is defines from which page you want to see subscription list and $size defines the number of rows you want to show.

Recurring Payment

For calling Recurring Payment methods, first you need to create instance of Payment class.

Don't forget to import use Divergent\Bkash\Apis\Recurring\Payment; top of the file.

NOTE: Configurations will be fetch from your previously setup in .env file.

Payment List by Subscription ID

You will get $subscriptionID from Subscription Query by Request ID.

Payment Info by Payment ID

You will get $paymentId from Payment List by Subscription ID.

Payment Schedule

$frequency defines the cycles for each subscriptions. Available recurring cycles are given below -

$startDate and $expiryDate indicates from and to date for payment schedule.

Payment Refund

You will get $paymentId from Payment List by Subscription ID. $amount is which amount you want to refund.

Webhook

To integrate webhook in your website, you need to create two url (route).

One is to get notification from Recurring product.

For calling Webhook methods, first you need to create instance of Webhook class.

Don't forget to import use Divergent\Bkash\Apis\Webhook\Webhook; top of the file.

General Webhook

Recurring Webhook

Don't worry if you find complexity in implatation by reading this documentation. Here is a demo project. Feel free to use this code. :heart:

Support

This version supports Laravel 5.0 or greater.


All versions of bkash with dependencies

PHP Build Version
Package Version
No informations.
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 divergent/bkash contains the following files

Loading the files please wait ....